mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Only refresh the Collections cache when loading an item page which may be included in a Collection
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
|
||||
// Wait for all fetches to complete
|
||||
const collectionResults = await Promise.all(collectionPromises);
|
||||
|
||||
|
||||
const endTime = performance.now();
|
||||
const duration = endTime - startTime;
|
||||
LOG(`Collections cache populated in ${duration.toFixed(2)}ms`);
|
||||
@@ -225,8 +225,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
await populateCollectionsCache();
|
||||
|
||||
// Only handle details pages
|
||||
const activePage = document.querySelector('.libraryPage:not(.hide)');
|
||||
if (!activePage) return;
|
||||
@@ -234,6 +232,15 @@
|
||||
// Await the item promise to get the actual item data
|
||||
const item = await itemPromise;
|
||||
|
||||
const supportedTypes = ['Movie', 'Series', 'Season', 'Episode', 'MusicArtist', 'MusicAlbum', 'Audio', 'Book', 'AudioBook', 'MusicVideo' ];
|
||||
|
||||
if (!supportedTypes.includes(item.Type)) {
|
||||
LOG(`Item type ${item.Type} not supported for collections, skipping...`);
|
||||
return;
|
||||
}
|
||||
|
||||
await populateCollectionsCache();
|
||||
|
||||
// Small delay to ensure details DOM is ready
|
||||
setTimeout(async () => {
|
||||
if (item && item.Id) {
|
||||
@@ -265,9 +272,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Forcefully populate the collections cache
|
||||
populateCollectionsCache(true);
|
||||
|
||||
// Initialize collections hook
|
||||
initializeCollectionsHook();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user