mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 04:27:37 +03:00
fix(bfr): force upgrade to read all folders. (#3871)
* chore(scanner): add trace logs Signed-off-by: Deluan <deluan@navidrome.org> * fix(bfr): force upgrade to read all folders. It was skipping folders for certain timezones Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
d331ee904b
commit
55ce28b2c6
2 changed files with 13 additions and 1 deletions
|
@ -164,7 +164,9 @@ join library on media_file.library_id = library.id`, string(os.PathSeparator)))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt, err := tx.PrepareContext(ctx, "insert into folder (id, library_id, path, name, parent_id) values (?, ?, ?, ?, ?)")
|
stmt, err := tx.PrepareContext(ctx,
|
||||||
|
"insert into folder (id, library_id, path, name, parent_id, updated_at) values (?, ?, ?, ?, ?, '0000-00-00 00:00:00')",
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,6 +150,14 @@ func (p *phaseFolders) producer() ppl.Producer[*folderEntry] {
|
||||||
Path: folder.path,
|
Path: folder.path,
|
||||||
Phase: "1",
|
Phase: "1",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Log folder info
|
||||||
|
log.Trace(p.ctx, "Scanner: Checking folder state", " folder", folder.path, "_updTime", folder.updTime,
|
||||||
|
"_modTime", folder.modTime, "_lastScanStartedAt", folder.job.lib.LastScanStartedAt,
|
||||||
|
"numAudioFiles", len(folder.audioFiles), "numImageFiles", len(folder.imageFiles),
|
||||||
|
"numPlaylists", folder.numPlaylists, "numSubfolders", folder.numSubFolders)
|
||||||
|
|
||||||
|
// Check if folder is outdated
|
||||||
if folder.isOutdated() {
|
if folder.isOutdated() {
|
||||||
if !p.state.fullScan {
|
if !p.state.fullScan {
|
||||||
if folder.hasNoFiles() && folder.isNew() {
|
if folder.hasNoFiles() && folder.isNew() {
|
||||||
|
@ -161,6 +169,8 @@ func (p *phaseFolders) producer() ppl.Producer[*folderEntry] {
|
||||||
totalChanged++
|
totalChanged++
|
||||||
folder.elapsed.Stop()
|
folder.elapsed.Stop()
|
||||||
put(folder)
|
put(folder)
|
||||||
|
} else {
|
||||||
|
log.Trace(p.ctx, "Scanner: Skipping up-to-date folder", "folder", folder.path, "lastUpdate", folder.modTime, "lib", job.lib.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
total += job.numFolders.Load()
|
total += job.numFolders.Load()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue