Add debugging for video directory persistence issue
- Added logging to saveLinkedDirectories to show when data is saved - Added detailed logging to loadLinkedDirectories showing raw data and directory details - Added localStorage inspection in porn cinema initialization - Added final state logging after directory refresh - Should help identify why linked directories become unlinked between library and porn cinema
This commit is contained in:
parent
5931d643cb
commit
8bf1f6fe4b
|
|
@ -278,13 +278,20 @@
|
|||
|
||||
// Force refresh of linked directories to ensure we have the latest video data
|
||||
try {
|
||||
// First check what's currently in localStorage
|
||||
const storedData = localStorage.getItem('linkedVideoDirectories');
|
||||
console.log('📁 Stored directory data:', storedData ? JSON.parse(storedData) : 'None');
|
||||
|
||||
// Force reload from storage first
|
||||
await window.desktopFileManager.loadLinkedDirectories();
|
||||
console.log('✅ Force reloaded linked directories');
|
||||
console.log(`✅ Force reloaded linked directories: ${window.desktopFileManager.externalVideoDirectories.length} directories`);
|
||||
|
||||
// Then refresh all directories to get current video lists
|
||||
await window.desktopFileManager.refreshAllDirectories();
|
||||
console.log('✅ Refreshed all video directories');
|
||||
|
||||
// Log final state
|
||||
console.log(`📁 Final state: ${window.desktopFileManager.getAllVideos().length} videos from ${window.desktopFileManager.externalVideoDirectories.length} directories`);
|
||||
} catch (error) {
|
||||
console.warn('⚠️ Error refreshing directories:', error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -483,6 +483,7 @@ class DesktopFileManager {
|
|||
lastUpdated: new Date().toISOString()
|
||||
};
|
||||
this.dataManager.set('linkedVideoDirectories', data);
|
||||
console.log(`💾 Saved ${this.externalVideoDirectories.length} linked directories to storage`);
|
||||
}
|
||||
|
||||
async loadLinkedDirectories() {
|
||||
|
|
@ -492,9 +493,12 @@ class DesktopFileManager {
|
|||
|
||||
try {
|
||||
const data = this.dataManager.get('linkedVideoDirectories');
|
||||
console.log('📂 Raw directory data from storage:', data);
|
||||
|
||||
if (data && data.directories) {
|
||||
this.externalVideoDirectories = data.directories;
|
||||
console.log(`📁 Loaded ${this.externalVideoDirectories.length} linked directories`);
|
||||
console.log(`📁 Loaded ${this.externalVideoDirectories.length} linked directories from storage`);
|
||||
console.log('📁 Directory details:', this.externalVideoDirectories.map(d => ({ name: d.name, path: d.path, id: d.id })));
|
||||
|
||||
// Refresh all directories to get current video lists
|
||||
await this.refreshAllDirectories();
|
||||
|
|
|
|||
Loading…
Reference in New Issue