(files)
| 15591 | } |
| 15592 | |
| 15593 | // Final validation: ensure we don't have a file path |
| 15594 | if (directoryFilterPath && directoryFilterPath === file.filePath) { |
| 15595 | console.error('Directory filter is same as file path, this should not happen. File path:', file.filePath); |
| 15596 | const lastSlash = Math.max(directoryFilterPath.lastIndexOf('\\'), directoryFilterPath.lastIndexOf('/')); |
| 15597 | directoryFilterPath = lastSlash > 0 ? directoryFilterPath.substring(0, lastSlash) : ''; |
| 15598 | } |
| 15599 | |
| 15600 | console.log('Setting directory filter to:', directoryFilterPath, 'from file path:', file.filePath); |
| 15601 | |
| 15602 | // Set the global directory filter with the full path |
| 15603 | window.currentDirectoryFilter = directoryFilterPath; |
| 15604 | if (window.viewingEntireLibrary) { |
| 15605 | window.viewingEntireLibrary = false; |
| 15606 | } |
| 15607 | // Restore this folder's view preference (list/preview/detailed) when switching folders |
| 15608 | if (typeof window.applyViewForCurrentFolder === 'function') { |
| 15609 | await window.applyViewForCurrentFolder(); |
| 15610 | } |
| 15611 | // Instead of filtering just by directory here, trigger the combined search which applies all filters. |
| 15612 | // The updateFilterIndicator function in search.js will handle displaying the filter correctly |
| 15613 | if (typeof window.performCombinedSearch === 'function') { |
nothing calls this directly
no test coverage detected