feat: add library-wide consolidation status update tool and improve consolidation robustness

This commit is contained in:
Tiberiu Ichim 2026-02-15 21:23:34 +02:00
parent 2c77f1fc5a
commit c2693e2460
8 changed files with 118 additions and 11 deletions

View file

@ -927,7 +927,12 @@ class LibraryItem extends Model {
const title = this.title || 'Unknown Title'
const folderName = LibraryItem.getConsolidatedFolderName(author, title)
const currentFolderName = Path.basename(this.path.replace(/[\/\\]$/, ''))
return currentFolderName !== folderName
if (currentFolderName !== folderName) return true
// Check if it is in a subfolder
const relPathPOSIX = (this.relPath || '').replace(/\\/g, '/')
const cleanRelPath = relPathPOSIX.replace(/\/$/, '')
return cleanRelPath !== currentFolderName
}
static getConsolidatedFolderName(author, title) {