Better loading of presentations, presenters, and files.
This commit is contained in:
@@ -556,7 +556,7 @@ export function sync_config__event_pres_mgmt(
|
|||||||
// Show content:
|
// Show content:
|
||||||
// pres_mgmt_cfg_local.show__navigation = pres_mgmt_cfg_remote?.show__navigation ?? false;
|
// pres_mgmt_cfg_local.show__navigation = pres_mgmt_cfg_remote?.show__navigation ?? false;
|
||||||
|
|
||||||
pres_mgmt_cfg_local.file_purpose_option_li = pres_mgmt_cfg_remote?.file_purpose_option_li ?? null;
|
pres_mgmt_cfg_local.file_purpose_option_kv = pres_mgmt_cfg_remote?.file_purpose_option_kv ?? null;
|
||||||
|
|
||||||
// Deal with things that can be overridden:
|
// Deal with things that can be overridden:
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ import type { key_val } from '$lib/ae_stores';
|
|||||||
import { api } from '$lib/api';
|
import { api } from '$lib/api';
|
||||||
|
|
||||||
import { db_events } from "$lib/db_events";
|
import { db_events } from "$lib/db_events";
|
||||||
|
import { handle_load_ae_obj_li__event_file } from "$lib/ae_events__event_file";
|
||||||
|
import { load_ae_obj_li__event_presenter } from "$lib/ae_events__event_presenter";
|
||||||
|
|
||||||
let ae_promises: key_val = {};
|
let ae_promises: key_val = {};
|
||||||
|
|
||||||
|
|
||||||
// Updated 2024-06-20
|
// Updated 2024-10-08
|
||||||
export async function load_ae_obj_id__event_presentation(
|
export async function load_ae_obj_id__event_presentation(
|
||||||
{
|
{
|
||||||
api_cfg,
|
api_cfg,
|
||||||
@@ -62,6 +64,25 @@ export async function load_ae_obj_id__event_presentation(
|
|||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`Need to load the file list for the presentation now.`);
|
console.log(`Need to load the file list for the presentation now.`);
|
||||||
}
|
}
|
||||||
|
let load_event_file_obj_li = handle_load_ae_obj_li__event_file({
|
||||||
|
api_cfg: api_cfg,
|
||||||
|
for_obj_type: 'event_presentation',
|
||||||
|
for_obj_id: event_presentation_id,
|
||||||
|
params: {qry__enabled: 'all', qry__limit: 25},
|
||||||
|
try_cache: try_cache,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
})
|
||||||
|
.then((event_file_obj_li) => {
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_file_obj_li = `, event_file_obj_li);
|
||||||
|
}
|
||||||
|
return event_file_obj_li;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_file_obj_li = `, load_event_file_obj_li);
|
||||||
|
}
|
||||||
|
ae_promises.load__event_presentation_obj.event_file_li = load_event_file_obj_li;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inc_presenter_li) {
|
if (inc_presenter_li) {
|
||||||
@@ -69,13 +90,33 @@ export async function load_ae_obj_id__event_presentation(
|
|||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`Need to load the presenter list for the presentation now.`);
|
console.log(`Need to load the presenter list for the presentation now.`);
|
||||||
}
|
}
|
||||||
|
let load_event_presenter_obj_li = load_ae_obj_li__event_presenter({
|
||||||
|
api_cfg: api_cfg,
|
||||||
|
for_obj_type: 'event_presentation',
|
||||||
|
for_obj_id: event_presentation_id,
|
||||||
|
inc_file_li: inc_file_li,
|
||||||
|
params: {qry__enabled: 'all', qry__limit: 25},
|
||||||
|
try_cache: try_cache,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
})
|
||||||
|
.then((event_presenter_obj_li) => {
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_presenter_obj_li = `, event_presenter_obj_li);
|
||||||
|
}
|
||||||
|
return event_presenter_obj_li;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_presenter_obj_li = `, load_event_presenter_obj_li);
|
||||||
|
}
|
||||||
|
ae_promises.load__event_presentation_obj.event_presenter_li = load_event_presenter_obj_li;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ae_promises.load__event_presentation_obj;
|
return ae_promises.load__event_presentation_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Updated 2024-06-10
|
// Updated 2024-10-08
|
||||||
export async function load_ae_obj_li__event_presentation(
|
export async function load_ae_obj_li__event_presentation(
|
||||||
{
|
{
|
||||||
api_cfg,
|
api_cfg,
|
||||||
@@ -151,6 +192,30 @@ export async function load_ae_obj_li__event_presentation(
|
|||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`Need to load the file list for each presentation now.`);
|
console.log(`Need to load the file list for each presentation now.`);
|
||||||
}
|
}
|
||||||
|
for (let i = 0; i < ae_promises.load__event_presentation_obj_li.length; i++) {
|
||||||
|
let event_presentation_obj = ae_promises.load__event_presentation_obj_li[i];
|
||||||
|
let event_presentation_id = event_presentation_obj.event_presentation_id_random;
|
||||||
|
|
||||||
|
let load_event_file_obj_li = handle_load_ae_obj_li__event_file({
|
||||||
|
api_cfg: api_cfg,
|
||||||
|
for_obj_type: 'event_presentation',
|
||||||
|
for_obj_id: event_presentation_id,
|
||||||
|
params: {qry__enabled: 'all', qry__limit: 25},
|
||||||
|
try_cache: try_cache,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
})
|
||||||
|
.then((event_file_obj_li) => {
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_file_obj_li = `, event_file_obj_li);
|
||||||
|
}
|
||||||
|
return event_file_obj_li;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_file_obj_li = `, load_event_file_obj_li);
|
||||||
|
}
|
||||||
|
// ae_promises.load__event_presentation_obj.event_file_li = load_event_file_obj_li;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inc_presenter_li) {
|
if (inc_presenter_li) {
|
||||||
@@ -158,6 +223,30 @@ export async function load_ae_obj_li__event_presentation(
|
|||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`Need to load the presenter list for each presentation now.`);
|
console.log(`Need to load the presenter list for each presentation now.`);
|
||||||
}
|
}
|
||||||
|
for (let i = 0; i < ae_promises.load__event_presentation_obj_li.length; i++) {
|
||||||
|
let event_presentation_obj = ae_promises.load__event_presentation_obj_li[i];
|
||||||
|
let event_presentation_id = event_presentation_obj.event_presentation_id_random;
|
||||||
|
|
||||||
|
let load_event_presenter_obj_li = load_ae_obj_li__event_presenter({
|
||||||
|
api_cfg: api_cfg,
|
||||||
|
for_obj_type: 'event_presentation',
|
||||||
|
for_obj_id: event_presentation_id,
|
||||||
|
params: {qry__enabled: 'all', qry__limit: 25},
|
||||||
|
try_cache: try_cache,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
})
|
||||||
|
.then((event_presenter_obj_li) => {
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_presenter_obj_li = `, event_presenter_obj_li);
|
||||||
|
}
|
||||||
|
return event_presenter_obj_li;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_presenter_obj_li = `, load_event_presenter_obj_li);
|
||||||
|
}
|
||||||
|
// ae_promises.load__event_presentation_obj.event_presenter_li = load_event_presenter_obj_li;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ae_promises.load__event_presentation_obj_li;
|
return ae_promises.load__event_presentation_obj_li;
|
||||||
|
|||||||
@@ -2,20 +2,23 @@ import type { key_val } from '$lib/ae_stores';
|
|||||||
import { api } from '$lib/api';
|
import { api } from '$lib/api';
|
||||||
|
|
||||||
import { db_events } from "$lib/db_events";
|
import { db_events } from "$lib/db_events";
|
||||||
|
import { handle_load_ae_obj_li__event_file } from "$lib/ae_events__event_file";
|
||||||
|
|
||||||
let ae_promises: key_val = {};
|
let ae_promises: key_val = {};
|
||||||
|
|
||||||
|
|
||||||
// Updated 2024-06-13
|
// Updated 2024-10-08
|
||||||
export async function load_ae_obj_id__event_presenter(
|
export async function load_ae_obj_id__event_presenter(
|
||||||
{
|
{
|
||||||
api_cfg,
|
api_cfg,
|
||||||
event_presenter_id,
|
event_presenter_id,
|
||||||
|
inc_file_li = false,
|
||||||
try_cache = true,
|
try_cache = true,
|
||||||
log_lvl=0
|
log_lvl = 0
|
||||||
}: {
|
}: {
|
||||||
api_cfg: any,
|
api_cfg: any,
|
||||||
event_presenter_id: string,
|
event_presenter_id: string,
|
||||||
|
inc_file_li?: boolean,
|
||||||
try_cache?: boolean,
|
try_cache?: boolean,
|
||||||
log_lvl?: number
|
log_lvl?: number
|
||||||
}
|
}
|
||||||
@@ -52,16 +55,43 @@ export async function load_ae_obj_id__event_presenter(
|
|||||||
console.log('No results returned or failed.', error);
|
console.log('No results returned or failed.', error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (inc_file_li) {
|
||||||
|
// Load the files for the presenter
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`Need to load the file list for the presenter now.`);
|
||||||
|
}
|
||||||
|
let load_event_file_obj_li = handle_load_ae_obj_li__event_file({
|
||||||
|
api_cfg: api_cfg,
|
||||||
|
for_obj_type: 'event_presenter',
|
||||||
|
for_obj_id: event_presenter_id,
|
||||||
|
params: {qry__enabled: 'all', qry__limit: 25},
|
||||||
|
try_cache: try_cache,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
})
|
||||||
|
.then((event_file_obj_li) => {
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_file_obj_li = `, event_file_obj_li);
|
||||||
|
}
|
||||||
|
return event_file_obj_li;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_file_obj_li = `, load_event_file_obj_li);
|
||||||
|
}
|
||||||
|
ae_promises.load__event_presenter_obj.event_file_li = load_event_file_obj_li;
|
||||||
|
}
|
||||||
|
|
||||||
return ae_promises.load__event_presenter_obj;
|
return ae_promises.load__event_presenter_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Updated 2024-06-10
|
// Updated 2024-10-08
|
||||||
export async function load_ae_obj_li__event_presenter(
|
export async function load_ae_obj_li__event_presenter(
|
||||||
{
|
{
|
||||||
api_cfg,
|
api_cfg,
|
||||||
for_obj_type,
|
for_obj_type,
|
||||||
for_obj_id,
|
for_obj_id,
|
||||||
|
inc_file_li = false,
|
||||||
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'given_name': 'ASC', 'family_name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'given_name': 'ASC', 'family_name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||||
params={},
|
params={},
|
||||||
try_cache=true,
|
try_cache=true,
|
||||||
@@ -70,6 +100,7 @@ export async function load_ae_obj_li__event_presenter(
|
|||||||
api_cfg: any,
|
api_cfg: any,
|
||||||
for_obj_type: string,
|
for_obj_type: string,
|
||||||
for_obj_id: string,
|
for_obj_id: string,
|
||||||
|
inc_file_li?: boolean,
|
||||||
order_by_li?: key_val,
|
order_by_li?: key_val,
|
||||||
params?: key_val,
|
params?: key_val,
|
||||||
try_cache?: boolean,
|
try_cache?: boolean,
|
||||||
@@ -125,6 +156,38 @@ export async function load_ae_obj_li__event_presenter(
|
|||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log('ae_promises.load__event_presenter_obj_li:', ae_promises.load__event_presenter_obj_li);
|
console.log('ae_promises.load__event_presenter_obj_li:', ae_promises.load__event_presenter_obj_li);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (inc_file_li) {
|
||||||
|
// Load the files for the presenters
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`Need to load the file list for each presenter now.`);
|
||||||
|
}
|
||||||
|
for (let i = 0; i < ae_promises.load__event_presenter_obj_li.length; i++) {
|
||||||
|
let event_presenter_obj = ae_promises.load__event_presenter_obj_li[i];
|
||||||
|
let event_presenter_id = event_presenter_obj.event_presenter_id_random;
|
||||||
|
|
||||||
|
let load_event_file_obj_li = handle_load_ae_obj_li__event_file({
|
||||||
|
api_cfg: api_cfg,
|
||||||
|
for_obj_type: 'event_presenter',
|
||||||
|
for_obj_id: event_presenter_id,
|
||||||
|
params: {qry__enabled: 'all', qry__limit: 25},
|
||||||
|
try_cache: try_cache,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
})
|
||||||
|
.then((event_file_obj_li) => {
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_file_obj_li = `, event_file_obj_li);
|
||||||
|
}
|
||||||
|
return event_file_obj_li;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`event_file_obj_li = `, load_event_file_obj_li);
|
||||||
|
}
|
||||||
|
// ae_promises.load__event_presenter_obj.event_file_li = load_event_file_obj_li;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ae_promises.load__event_presenter_obj_li;
|
return ae_promises.load__event_presenter_obj_li;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -443,8 +443,8 @@ onMount(() => {
|
|||||||
class="select min-w-fit max-w-fit text-sm mx-1 border border-gray-300 rounded-md p-1 hover:border-gray-400"
|
class="select min-w-fit max-w-fit text-sm mx-1 border border-gray-300 rounded-md p-1 hover:border-gray-400"
|
||||||
>
|
>
|
||||||
<option value={null} selected={!event_file_obj.file_purpose} class="text-xs">-- purpose not set --</option>
|
<option value={null} selected={!event_file_obj.file_purpose} class="text-xs">-- purpose not set --</option>
|
||||||
{#if $events_loc.pres_mgmt?.file_purpose_option_li}
|
{#if $events_loc.pres_mgmt?.file_purpose_option_kv}
|
||||||
{#each Object.entries($events_loc.pres_mgmt.file_purpose_option_li) as [key, file_purpose_option]}
|
{#each Object.entries($events_loc.pres_mgmt.file_purpose_option_kv) as [key, file_purpose_option]}
|
||||||
<option
|
<option
|
||||||
value={key} selected={event_file_obj.file_purpose === key}
|
value={key} selected={event_file_obj.file_purpose === key}
|
||||||
disabled={file_purpose_option?.disabled}
|
disabled={file_purpose_option?.disabled}
|
||||||
|
|||||||
@@ -204,13 +204,14 @@ function handle_ws_recv(event) {
|
|||||||
// .then(async (load_results) => {
|
// .then(async (load_results) => {
|
||||||
|
|
||||||
// });
|
// });
|
||||||
|
// tick();
|
||||||
console.log(`Current URL`, data.url);
|
console.log(`Current URL`, data.url);
|
||||||
// let new_url = new URL(data.url);
|
let new_url = new URL(data.url);
|
||||||
// new_url.pathname = `/events/${$events_slct.event_id}/launcher/${$events_slct.event_location_id}`;
|
new_url.pathname = `/events/${$lq__event_session_obj?.event_id}/launcher/${$lq__event_session_obj?.event_location_id}`;
|
||||||
// new_url.searchParams.set('session_id', $events_slct.event_session_id);
|
new_url.searchParams.set('session_id', $events_slct.event_session_id);
|
||||||
// let new_url = data.url.toString();
|
console.log(`New URL: ${new_url}`);
|
||||||
// console.log(`New URL: ${new_url}`);
|
let new_url_str = new_url.toString();
|
||||||
// goto(new_url, {replaceState: false});
|
goto(new_url_str, {replaceState: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
// AE Open (event file ID)
|
// AE Open (event file ID)
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export async function load({ params, parent, url }) { // route
|
|||||||
for_obj_id: event_id,
|
for_obj_id: event_id,
|
||||||
params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
||||||
try_cache: true,
|
try_cache: true,
|
||||||
log_lvl: 1
|
log_lvl: log_lvl
|
||||||
});
|
});
|
||||||
console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
|
console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
|
||||||
ae_acct.slct.event_location_obj_li = load_event_location_obj_li;
|
ae_acct.slct.event_location_obj_li = load_event_location_obj_li;
|
||||||
@@ -76,7 +76,11 @@ export async function load({ params, parent, url }) { // route
|
|||||||
let load_event_session_obj = events_func.load_ae_obj_id__event_session({
|
let load_event_session_obj = events_func.load_ae_obj_id__event_session({
|
||||||
api_cfg: ae_acct.api,
|
api_cfg: ae_acct.api,
|
||||||
event_session_id: event_session_id,
|
event_session_id: event_session_id,
|
||||||
try_cache: true
|
inc_file_li: true,
|
||||||
|
inc_presentation_li: true,
|
||||||
|
inc_presenter_li: true,
|
||||||
|
try_cache: true,
|
||||||
|
log_lvl: log_lvl
|
||||||
});
|
});
|
||||||
ae_acct.slct.event_session_id = event_session_id;
|
ae_acct.slct.event_session_id = event_session_id;
|
||||||
console.log(`load_event_session_obj = `, load_event_session_obj);
|
console.log(`load_event_session_obj = `, load_event_session_obj);
|
||||||
|
|||||||
Reference in New Issue
Block a user