🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
fix(bfr): force upgrade to read all folders. (#3871)
Deluan Quintão55ce28b2c635
diff --git a/db/migrations/20241026183640_support_new_scanner.go b/db/migrations/20241026183640_support_new_scanner.goindex 3e7c47f54..251b27f63 100644--- a/db/migrations/20241026183640_support_new_scanner.go+++ b/db/migrations/20241026183640_support_new_scanner.go@@ -164,7 +164,9 @@ join library on media_file.library_id = library.id`, string(os.PathSeparator)))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 {return err}diff --git a/scanner/phase_1_folders.go b/scanner/phase_1_folders.goindex ca7851f17..ae0d906de 100644--- a/scanner/phase_1_folders.go+++ b/scanner/phase_1_folders.go@@ -150,6 +150,14 @@ func (p *phaseFolders) producer() ppl.Producer[*folderEntry] {Path: folder.path,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 outdatedif folder.isOutdated() {if !p.state.fullScan {if folder.hasNoFiles() && folder.isNew() {@@ -161,6 +169,8 @@ func (p *phaseFolders) producer() ppl.Producer[*folderEntry] {totalChanged++folder.elapsed.Stop()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()