Lots of changes. Things are working better. Files are now showing for the session and presenter. Next is location and event.
This commit is contained in:
@@ -3,25 +3,26 @@ import { api } from '$lib/api';
|
||||
|
||||
import { db_events } from "$lib/db_events";
|
||||
|
||||
import { handle_load_ae_obj_li__event_file } from "$lib/ae_events__event_file";
|
||||
import { handle_load_ae_obj_li__event_presentation } from "$lib/ae_events__event_presentation";
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
|
||||
|
||||
// Updated 2024-06-10
|
||||
// Updated 2024-08-09
|
||||
export async function handle_load_ae_obj_id__event_session(
|
||||
{
|
||||
api_cfg,
|
||||
event_session_id,
|
||||
inc_file_li = false,
|
||||
inc_presenter_li = false, // Actually presentations and presenters
|
||||
inc_presentation_li = false,
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
event_session_id: string,
|
||||
inc_file_li?: boolean,
|
||||
inc_presenter_li?: boolean,
|
||||
inc_presentation_li?: boolean,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
@@ -59,16 +60,45 @@ export async function handle_load_ae_obj_id__event_session(
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_session_obj:', ae_promises.load__event_session_obj);
|
||||
}
|
||||
|
||||
if (inc_presenter_li) {
|
||||
if (inc_file_li) {
|
||||
// Load the files for the session
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the file list for the session now`);
|
||||
}
|
||||
let load_event_file_obj_li = handle_load_ae_obj_li__event_file({
|
||||
api_cfg: api_cfg,
|
||||
for_obj_type: 'event_session',
|
||||
for_obj_id: event_session_id,
|
||||
params: {qry__enabled: 'all', qry__limit: 15},
|
||||
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(`load_event_file_obj_li = `, load_event_file_obj_li);
|
||||
}
|
||||
ae_promises.load__event_session_obj.event_file_li = load_event_file_obj_li;
|
||||
}
|
||||
|
||||
if (inc_presentation_li) {
|
||||
// Load the presentations for the session
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the presentation list now`);
|
||||
console.log(`Need to load the presentation list for the session now`);
|
||||
}
|
||||
let load_event_presentation_obj_li = handle_load_ae_obj_li__event_presentation({
|
||||
api_cfg: api_cfg,
|
||||
event_session_id: event_session_id,
|
||||
params: {enabled: 'all', qry__limit: 15},
|
||||
params: {qry__enabled: 'all', qry__limit: 15},
|
||||
try_cache: try_cache,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
@@ -76,15 +106,15 @@ export async function handle_load_ae_obj_id__event_session(
|
||||
if (log_lvl) {
|
||||
console.log(`event_presentation_obj_li = `, event_presentation_obj_li);
|
||||
}
|
||||
if (try_cache) {
|
||||
ae_promises.load__event_session_obj.event_presentation_li = event_presentation_obj_li;
|
||||
// Re-save the session object with the new presentation list
|
||||
handle_db_save_ae_obj_li__event_session({
|
||||
obj_type: 'event_session',
|
||||
obj_li: ae_promises.load__event_session_obj
|
||||
});
|
||||
}
|
||||
|
||||
// if (try_cache) {
|
||||
// console.log(`ae_promises.load__event_session_obj = `, ae_promises.load__event_session_obj);
|
||||
// ae_promises.load__event_session_obj.event_presentation_li = event_presentation_obj_li;
|
||||
// // Re-save the session object with the new presentation list
|
||||
// handle_db_save_ae_obj_li__event_session({
|
||||
// obj_type: 'event_session',
|
||||
// obj_li: [ae_promises.load__event_session_obj]
|
||||
// });
|
||||
// }
|
||||
return event_presentation_obj_li;
|
||||
});
|
||||
|
||||
@@ -98,14 +128,14 @@ export async function handle_load_ae_obj_id__event_session(
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-05-24
|
||||
// Updated 2024-08-09
|
||||
export async function handle_load_ae_obj_li__event_session(
|
||||
{
|
||||
api_cfg,
|
||||
for_obj_type,
|
||||
for_obj_id,
|
||||
inc_file_li = false,
|
||||
inc_presenter_li = false, // Actually presentations and presenters
|
||||
inc_presentation_li = false,
|
||||
params={},
|
||||
try_cache=true,
|
||||
log_lvl=0
|
||||
@@ -114,13 +144,13 @@ export async function handle_load_ae_obj_li__event_session(
|
||||
for_obj_type: string,
|
||||
for_obj_id: string,
|
||||
inc_file_li?: boolean,
|
||||
inc_presenter_li?: boolean,
|
||||
inc_presentation_li?: boolean,
|
||||
params?: key_val,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
console.log(`*** handle_load_ae_obj_li__event_session() ***`);
|
||||
console.log(`*** handle_load_ae_obj_li__event_session() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
|
||||
|
||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
||||
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
|
||||
@@ -168,8 +198,41 @@ export async function handle_load_ae_obj_li__event_session(
|
||||
console.log('ae_promises.load__event_session_obj_li:', ae_promises.load__event_session_obj_li);
|
||||
}
|
||||
|
||||
if (inc_presenter_li) {
|
||||
if (inc_file_li) {
|
||||
// Load the files for the sessions
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the file list for each session now`);
|
||||
}
|
||||
for (let i = 0; i < ae_promises.load__event_session_obj_li.length; i++) {
|
||||
let event_session_obj = ae_promises.load__event_session_obj_li[i];
|
||||
let event_session_id = event_session_obj.event_session_id_random;
|
||||
|
||||
let load_event_file_obj_li = handle_load_ae_obj_li__event_file({
|
||||
api_cfg: api_cfg,
|
||||
for_obj_type: 'event_session',
|
||||
for_obj_id: event_session_id,
|
||||
params: {qry__enabled: 'all', qry__limit: 15},
|
||||
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(`load_event_file_obj_li = `, load_event_file_obj_li);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inc_presentation_li) {
|
||||
// Load the presentations for the sessions
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the presentation list for each session now`);
|
||||
}
|
||||
for (let i = 0; i < ae_promises.load__event_session_obj_li.length; i++) {
|
||||
let event_session_obj = ae_promises.load__event_session_obj_li[i];
|
||||
let event_session_id = event_session_obj.event_session_id_random;
|
||||
@@ -182,7 +245,11 @@ export async function handle_load_ae_obj_li__event_session(
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then((event_presentation_obj_li) => {
|
||||
if (log_lvl) {
|
||||
console.log(`event_presentation_obj_li = `, event_presentation_obj_li);
|
||||
}
|
||||
if (try_cache) {
|
||||
console.log(`event_session_obj = `, event_session_obj);
|
||||
event_session_obj.event_presentation_li = event_presentation_obj_li;
|
||||
// Re-save the session object with the new presentation list
|
||||
handle_db_save_ae_obj_li__event_session({
|
||||
@@ -190,17 +257,16 @@ export async function handle_load_ae_obj_li__event_session(
|
||||
obj_li: event_session_obj
|
||||
});
|
||||
}
|
||||
|
||||
return event_presentation_obj_li;
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`load_event_presentation_obj_li = `, load_event_presentation_obj_li);
|
||||
}
|
||||
// event_session_obj.event_presentation_li = load_event_presentation_obj_li;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ae_promises.load__event_session_obj_li;
|
||||
}
|
||||
|
||||
@@ -392,6 +458,7 @@ export function handle_db_save_ae_obj_li__event_session(
|
||||
file_count: obj.file_count,
|
||||
file_count_all: obj.file_count_all,
|
||||
internal_use_count: obj.internal_use_count,
|
||||
event_file_id_li_json: obj.event_file_id_li_json,
|
||||
|
||||
poc_person_given_name: obj.poc_person_given_name,
|
||||
poc_person_family_name: obj.poc_person_family_name,
|
||||
|
||||
Reference in New Issue
Block a user