More fixes related to id_random vs id.
This commit is contained in:
@@ -167,37 +167,37 @@
|
||||
class:dim={event_file_obj?.hide}
|
||||
>
|
||||
<td class="event_file__file align-middle">
|
||||
{#if $events_sess.pres_mgmt?.show_field_edit__filename != event_file_obj.event_file_id_random}
|
||||
{#if $events_sess.pres_mgmt?.show_field_edit__filename != event_file_obj.event_file_id}
|
||||
<button
|
||||
type="button"
|
||||
disabled={!allow_basic &&
|
||||
!allow_moderator &&
|
||||
!$ae_loc.trusted_access}
|
||||
onclick={() => {
|
||||
// ae_promises[event_file_obj.event_file_id_random]
|
||||
ae_promises[event_file_obj.event_file_id_random] =
|
||||
// ae_promises[event_file_obj.event_file_id]
|
||||
ae_promises[event_file_obj.event_file_id] =
|
||||
api.download_hosted_file({
|
||||
api_cfg: $ae_api,
|
||||
hosted_file_id:
|
||||
event_file_obj.hosted_file_id_random,
|
||||
event_file_obj.hosted_file_id,
|
||||
return_file: true,
|
||||
filename: event_file_obj.filename,
|
||||
auto_download: true,
|
||||
log_lvl: 0
|
||||
});
|
||||
|
||||
// window.postMessage({ type: 'download_event_file', event_file_id: event_file_obj.event_file_id_random, filename: event_file_obj.filename, auto_download: true }, '*');
|
||||
// window.postMessage({ type: 'download_event_file', event_file_id: event_file_obj.event_file_id, filename: event_file_obj.filename, auto_download: true }, '*');
|
||||
}}
|
||||
class="btn btn-sm lg:btn-md preset-tonal-primary hover:preset-filled-primary-500 min-w-72 lg:min-w-96"
|
||||
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_obj.event_file_id_random}`}
|
||||
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id} Event File ID: ${event_file_obj.event_file_id}`}
|
||||
>
|
||||
{#await ae_promises[event_file_obj.event_file_id_random]}
|
||||
{#await ae_promises[event_file_obj.event_file_id]}
|
||||
<span class="fas fa-spinner fa-spin mx-1"></span>
|
||||
<span class="">
|
||||
Downloading
|
||||
{#if $ae_sess.api_download_kv[event_file_obj.hosted_file_id_random]}
|
||||
{#if $ae_sess.api_download_kv[event_file_obj.hosted_file_id]}
|
||||
{$ae_sess.api_download_kv[
|
||||
event_file_obj.hosted_file_id_random
|
||||
event_file_obj.hosted_file_id
|
||||
].percent_completed}%
|
||||
{/if}
|
||||
:
|
||||
@@ -238,11 +238,11 @@
|
||||
Original:
|
||||
</span>
|
||||
<a
|
||||
href="{$ae_api.base_url}/event/file/{event_file_obj?.event_file_id_random}/download?filename={ae_util.clean_filename(
|
||||
href="{$ae_api.base_url}/event/file/{event_file_obj?.event_file_id}/download?filename={ae_util.clean_filename(
|
||||
event_file_obj?.filename
|
||||
)}&x_no_account_id_token=direct-download"
|
||||
class="btn btn-sm p-1 preset-tonal-secondary *:hover:inline lg:text-xs underline"
|
||||
title={`Download this file:\n${ae_util.clean_filename(event_file_obj?.filename)}\n[API] SHA256: ${event_file_obj?.hash_sha256.slice(0, 10)}...\nHosted ID: ${event_file_obj?.hosted_file_id_random} Event File ID: ${event_file_obj?.event_file_id_random}`}
|
||||
title={`Download this file:\n${ae_util.clean_filename(event_file_obj?.filename)}\n[API] SHA256: ${event_file_obj?.hash_sha256.slice(0, 10)}...\nHosted ID: ${event_file_obj?.hosted_file_id} Event File ID: ${event_file_obj?.event_file_id}`}
|
||||
>
|
||||
<span class="fas fa-download mx-1"></span>
|
||||
<span class="hidden"> Download </span>
|
||||
@@ -250,7 +250,7 @@
|
||||
<!-- {#if clipboard_success}Copied!{:else}Copy Access Link{/if} -->
|
||||
<!-- <span class="fas fa-copy mx-1"></span> -->
|
||||
<!-- <Clipboard
|
||||
value={encodeURI(`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id_random}/download?filename=${ae_util.clean_filename(event_file_obj?.filename)}&x_no_account_id_token=direct-download`)}
|
||||
value={encodeURI(`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id}/download?filename=${ae_util.clean_filename(event_file_obj?.filename)}&x_no_account_id_token=direct-download`)}
|
||||
bind:success={clipboard_success}
|
||||
class="w-24"
|
||||
>
|
||||
@@ -258,7 +258,7 @@
|
||||
</Clipboard> -->
|
||||
<MyClipboard
|
||||
value={encodeURI(
|
||||
`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id_random}/download?filename=${ae_util.clean_filename(event_file_obj?.filename)}&x_no_account_id_token=direct-download`
|
||||
`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id}/download?filename=${ae_util.clean_filename(event_file_obj?.filename)}&x_no_account_id_token=direct-download`
|
||||
)}
|
||||
btn_text="Copy Link"
|
||||
btn_title="Copy the direct download link to the clipboard."
|
||||
@@ -271,7 +271,7 @@
|
||||
Session Name:
|
||||
</span>
|
||||
<a
|
||||
href="{$ae_api.base_url}/event/file/{event_file_obj?.event_file_id_random}/download?filename={event_file_obj?.event_session_code}-{ae_util
|
||||
href="{$ae_api.base_url}/event/file/{event_file_obj?.event_file_id}/download?filename={event_file_obj?.event_session_code}-{ae_util
|
||||
.clean_filename(
|
||||
event_file_obj?.event_presentation_name
|
||||
)
|
||||
@@ -285,7 +285,7 @@
|
||||
<span class="hidden"> Renamed </span>
|
||||
</a>
|
||||
<!-- <Clipboard
|
||||
value={encodeURI(`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id_random}/download?filename=${event_file_obj?.event_session_code}-${ae_util.clean_filename(event_file_obj?.event_session_name).substring(0, 20)}-${ae_util.clean_filename(event_file_obj?.event_presenter_full_name)}.${event_file_obj?.extension}&x_no_account_id_token=direct-download`)}
|
||||
value={encodeURI(`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id}/download?filename=${event_file_obj?.event_session_code}-${ae_util.clean_filename(event_file_obj?.event_session_name).substring(0, 20)}-${ae_util.clean_filename(event_file_obj?.event_presenter_full_name)}.${event_file_obj?.extension}&x_no_account_id_token=direct-download`)}
|
||||
bind:success={clipboard_success}
|
||||
class="w-24"
|
||||
>
|
||||
@@ -293,7 +293,7 @@
|
||||
</Clipboard> -->
|
||||
<MyClipboard
|
||||
value={encodeURI(
|
||||
`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id_random}/download?filename=${event_file_obj?.event_session_code}-${ae_util.clean_filename(event_file_obj?.event_session_name).substring(0, 20)}-${ae_util.clean_filename(event_file_obj?.event_presenter_full_name)}.${event_file_obj?.extension}&x_no_account_id_token=direct-download`
|
||||
`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id}/download?filename=${event_file_obj?.event_session_code}-${ae_util.clean_filename(event_file_obj?.event_session_name).substring(0, 20)}-${ae_util.clean_filename(event_file_obj?.event_presenter_full_name)}.${event_file_obj?.extension}&x_no_account_id_token=direct-download`
|
||||
)}
|
||||
btn_text="Copy Renamed"
|
||||
btn_title="Copy the renamed download link to the clipboard."
|
||||
@@ -306,7 +306,7 @@
|
||||
Presentation Name:
|
||||
</span>
|
||||
<a
|
||||
href="{$ae_api.base_url}/event/file/{event_file_obj?.event_file_id_random}/download?filename={event_file_obj?.event_session_code}-{ae_util
|
||||
href="{$ae_api.base_url}/event/file/{event_file_obj?.event_file_id}/download?filename={event_file_obj?.event_session_code}-{ae_util
|
||||
.clean_filename(
|
||||
event_file_obj?.event_presentation_name
|
||||
)
|
||||
@@ -322,7 +322,7 @@
|
||||
<!-- {#if clipboard_success}Copied!{:else}Copy Access Link{/if} -->
|
||||
<!-- <span class="fas fa-copy mx-1"></span> -->
|
||||
<!-- <Clipboard
|
||||
value={encodeURI(`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id_random}/download?filename=${event_file_obj?.event_session_code}-${ae_util.clean_filename(event_file_obj?.event_presentation_name).substring(0, 20)}-${ae_util.clean_filename(event_file_obj?.event_presenter_full_name)}.${event_file_obj?.extension}&x_no_account_id_token=direct-download`)}
|
||||
value={encodeURI(`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id}/download?filename=${event_file_obj?.event_session_code}-${ae_util.clean_filename(event_file_obj?.event_presentation_name).substring(0, 20)}-${ae_util.clean_filename(event_file_obj?.event_presenter_full_name)}.${event_file_obj?.extension}&x_no_account_id_token=direct-download`)}
|
||||
bind:success={clipboard_success}
|
||||
class="w-24"
|
||||
>
|
||||
@@ -330,7 +330,7 @@
|
||||
</Clipboard> -->
|
||||
<MyClipboard
|
||||
value={encodeURI(
|
||||
`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id_random}/download?filename=${event_file_obj?.event_session_code}-${ae_util.clean_filename(event_file_obj?.event_presentation_name).substring(0, 20)}-${ae_util.clean_filename(event_file_obj?.event_presenter_full_name)}.${event_file_obj?.extension}&x_no_account_id_token=direct-download`
|
||||
`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id}/download?filename=${event_file_obj?.event_session_code}-${ae_util.clean_filename(event_file_obj?.event_presentation_name).substring(0, 20)}-${ae_util.clean_filename(event_file_obj?.event_presenter_full_name)}.${event_file_obj?.extension}&x_no_account_id_token=direct-download`
|
||||
)}
|
||||
btn_text="Copy Renamed"
|
||||
btn_title="Copy the renamed download link to the clipboard."
|
||||
@@ -384,7 +384,7 @@
|
||||
.update_ae_obj__event_file({
|
||||
api_cfg: $ae_api,
|
||||
event_file_id:
|
||||
event_file_obj.event_file_id_random,
|
||||
event_file_obj.event_file_id,
|
||||
data_kv: event_file_data,
|
||||
log_lvl: 0
|
||||
})
|
||||
@@ -428,7 +428,7 @@
|
||||
if (
|
||||
$events_sess.pres_mgmt
|
||||
.show_field_edit__filename ==
|
||||
event_file_obj.event_file_id_random
|
||||
event_file_obj.event_file_id
|
||||
) {
|
||||
$events_sess.pres_mgmt.tmp_val__filename_no_ext =
|
||||
'';
|
||||
@@ -437,17 +437,17 @@
|
||||
$events_sess.pres_mgmt.tmp_val__filename_no_ext =
|
||||
event_file_obj.filename_no_ext;
|
||||
$events_sess.pres_mgmt.show_field_edit__filename =
|
||||
event_file_obj.event_file_id_random;
|
||||
event_file_obj.event_file_id;
|
||||
}
|
||||
}}
|
||||
class="btn btn-sm preset-tonal-tertiary hover:preset-tonal-success"
|
||||
class:preset-tonal-warning={$events_sess.pres_mgmt
|
||||
.show_field_edit__filename ==
|
||||
event_file_obj.event_file_id_random}
|
||||
event_file_obj.event_file_id}
|
||||
title={`Rename this file? "${event_file_obj.filename}"`}
|
||||
>
|
||||
<span class="fas fa-edit mx-1"></span>
|
||||
{#if $events_sess.pres_mgmt?.show_field_edit__filename == event_file_obj.event_file_id_random}
|
||||
{#if $events_sess.pres_mgmt?.show_field_edit__filename == event_file_obj.event_file_id}
|
||||
Cancel?
|
||||
{:else}
|
||||
Rename
|
||||
@@ -466,7 +466,7 @@
|
||||
.update_ae_obj__event_file({
|
||||
api_cfg: $ae_api,
|
||||
event_file_id:
|
||||
event_file_obj.event_file_id_random,
|
||||
event_file_obj.event_file_id,
|
||||
data_kv: event_file_data,
|
||||
log_lvl: 0
|
||||
})
|
||||
@@ -522,19 +522,19 @@
|
||||
onclick={async () => {
|
||||
if (
|
||||
!confirm(
|
||||
`Are you sure you want to delete this file?\n${event_file_obj.filename} [${event_file_obj.event_file_id_random}]`
|
||||
`Are you sure you want to delete this file?\n${event_file_obj.filename} [${event_file_obj.event_file_id}]`
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ae_promises[event_file_obj.event_file_id_random] = handle_delete__event_file({event_file_id: event_file_obj.event_file_id_random});
|
||||
// ae_promises[event_file_obj.event_file_id] = handle_delete__event_file({event_file_id: event_file_obj.event_file_id});
|
||||
|
||||
ae_promises.delete__event_file_obj =
|
||||
await events_func.delete_ae_obj_id__event_file({
|
||||
api_cfg: $ae_api,
|
||||
event_file_id:
|
||||
event_file_obj.event_file_id_random,
|
||||
event_file_obj.event_file_id,
|
||||
log_lvl: 1
|
||||
});
|
||||
}}
|
||||
@@ -578,14 +578,14 @@
|
||||
!$ae_loc.trusted_access}
|
||||
value={event_file_obj.file_purpose}
|
||||
onchange={(e) => {
|
||||
// ae_tmp[event_file_obj.event_file_id_random].file_purpose = e.target.value;
|
||||
// ae_tmp[event_file_obj.event_file_id].file_purpose = e.target.value;
|
||||
console.log(
|
||||
`Selected file_purpose: ${e.target.value}`
|
||||
);
|
||||
|
||||
let event_file_data = {
|
||||
event_file_id_random:
|
||||
event_file_obj.event_file_id_random,
|
||||
event_file_id:
|
||||
event_file_obj.event_file_id,
|
||||
file_purpose: e.target.value
|
||||
};
|
||||
|
||||
@@ -593,7 +593,7 @@
|
||||
.update_ae_obj__event_file({
|
||||
api_cfg: $ae_api,
|
||||
event_file_id:
|
||||
event_file_obj.event_file_id_random,
|
||||
event_file_obj.event_file_id,
|
||||
data_kv: event_file_data,
|
||||
log_lvl: 1
|
||||
})
|
||||
@@ -698,7 +698,7 @@
|
||||
<span class:hidden={display_mode != 'default'}>
|
||||
ID:
|
||||
</span>
|
||||
<strong>{event_file_obj.hosted_file_id_random}</strong>
|
||||
<strong>{event_file_obj.hosted_file_id}</strong>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
onclick={() => {
|
||||
if (
|
||||
!confirm(
|
||||
`Are you sure you want to delete this hosted file?\n${hosted_file_obj.filename} [${hosted_file_obj.hosted_file_id_random}]`
|
||||
`Are you sure you want to delete this hosted file?\n${hosted_file_obj.filename} [${hosted_file_obj.hosted_file_id}]`
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
@@ -191,7 +191,7 @@
|
||||
ae_promises.delete__hosted_file_obj =
|
||||
core_func.delete_ae_obj_id__hosted_file({
|
||||
api_cfg: $ae_api,
|
||||
hosted_file_id: hosted_file_obj.hosted_file_id_random,
|
||||
hosted_file_id: hosted_file_obj.hosted_file_id,
|
||||
link_to_type: link_to_type,
|
||||
link_to_id: link_to_id,
|
||||
rm_orphan: true,
|
||||
|
||||
Reference in New Issue
Block a user