Getting ready to make the new hosted file management and tools live on dev. Then on prod...
This commit is contained in:
@@ -122,6 +122,7 @@ function handle_clip_video(event) {
|
||||
api_cfg: $ae_api,
|
||||
endpoint: endpoint,
|
||||
params: params,
|
||||
timeout: 300000, // 5 minutes
|
||||
// return_blob: true,
|
||||
// filename: event.target.new_filename.value,
|
||||
// auto_download: false,
|
||||
@@ -160,12 +161,19 @@ function handle_clip_video(event) {
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
<section
|
||||
class="{class_li_default} {class_li}"
|
||||
>
|
||||
|
||||
<!-- <h3 class="h3">{hosted_file_obj_li.length}× files uploaded</h3>
|
||||
{#each hosted_file_obj_li as hosted_file_obj, i} -->
|
||||
|
||||
<h3 class="h3">{Object.entries(hosted_file_obj_kv).length}× files uploaded</h3>
|
||||
<h3
|
||||
class="h3"
|
||||
>
|
||||
{Object.entries(hosted_file_obj_kv).length}× files uploaded
|
||||
</h3>
|
||||
|
||||
{#each Object.entries(hosted_file_obj_kv) as [hosted_file_id, hosted_file_obj]}
|
||||
<div class="border border-gray-300 rounded-lg p-2 m-2">
|
||||
<!-- {#if $ae_sess.files[hosted_file_id].upload_complete}
|
||||
@@ -187,12 +195,11 @@ function handle_clip_video(event) {
|
||||
// delete $ae_loc.files.uploaded_file_kv[hosted_file_obj.hosted_file_id];
|
||||
console.log(`Removed hosted file ID: ${hosted_file_obj.hosted_file_id}`, $ae_loc.files.uploaded_file_kv);
|
||||
}}
|
||||
class:hidden={!$ae_loc.edit_mode}
|
||||
class="btn btn-sm variant-soft-danger hover:variant-filled-danger"
|
||||
title={`Remove this file:\n${hosted_file_obj.filename}\n[API] SHA256: ${hosted_file_obj?.hash_sha256?.slice(0, 10)}... Hosted ID: ${hosted_file_obj.hosted_file_id_random}`}
|
||||
class="btn btn-sm variant-soft-warning hover:variant-filled-warning"
|
||||
title={`Remove this file from list of videos:\n${hosted_file_obj.filename}\n[API] SHA256: ${hosted_file_obj?.hash_sha256?.slice(0, 10)}... Hosted ID: ${hosted_file_obj.hosted_file_id_random}`}
|
||||
>
|
||||
<span class="fas fa-minus-circle m-1"></span>
|
||||
<span class="hidden">Remove</span>
|
||||
<span class="">Remove</span>
|
||||
</button>
|
||||
|
||||
<!-- Download the file -->
|
||||
@@ -367,4 +374,4 @@ function handle_clip_video(event) {
|
||||
{/if}
|
||||
{/await} -->
|
||||
|
||||
</div>
|
||||
</section>
|
||||
@@ -154,6 +154,7 @@ export async function delete_ae_obj_id__hosted_file(
|
||||
rm_orphan = false,
|
||||
fake_delete = false, // Fake the delete result to "true"
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
@@ -163,6 +164,7 @@ export async function delete_ae_obj_id__hosted_file(
|
||||
rm_orphan?: boolean,
|
||||
fake_delete?: boolean,
|
||||
params?: key_val,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
@@ -191,8 +193,29 @@ export async function delete_ae_obj_id__hosted_file(
|
||||
params: params,
|
||||
// return_meta: return_meta,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then(function (hosted_file_obj_li_get_result) {
|
||||
if (hosted_file_obj_li_get_result) {
|
||||
if (try_cache) {
|
||||
if (log_lvl) {
|
||||
console.log(`Attempting to remove IDB entry for hosted_file_id=${hosted_file_id}`);
|
||||
}
|
||||
db_core.file.delete(hosted_file_id); // Delete from the DB no matter what.
|
||||
}
|
||||
return hosted_file_obj_li_get_result;
|
||||
} else {
|
||||
console.log('No results returned.');
|
||||
return [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.delete__hosted_file_obj:', ae_promises.delete__hosted_file_obj);
|
||||
}
|
||||
|
||||
return ae_promises.delete__hosted_file_obj;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user