Skip to content

🎧 Your Personal Streaming Service

Add Dev flag to disable file presence verification

Deluana4a8360a945e
diff --git a/conf/configuration.go b/conf/configuration.go
index fd84eb8aa..804689e7c 100644
--- a/conf/configuration.go
+++ b/conf/configuration.go
@@ -23,6 +23,9 @@ type sonic struct {
DownsampleCommand string `default:"ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -"`
PlsIgnoreFolders bool `default:"true"`
PlsIgnoredPatterns string `default:"^iCloud;\\~"`
+
+ // DevFlags
+ DevDisableFileCheck bool `default:"false"`
}
var Sonic *sonic
diff --git a/scanner/itunes_scanner.go b/scanner/itunes_scanner.go
index 0e0e2dbef..857985c1c 100644
--- a/scanner/itunes_scanner.go
+++ b/scanner/itunes_scanner.go
@@ -135,7 +135,15 @@ func (s *ItunesScanner) Playlists() map[string]*domain.Playlist {
}
func (s *ItunesScanner) skipTrack(t *itl.Track) bool {
- if !strings.HasPrefix(t.Location, "file://") || t.Podcast {
+ if t.Podcast {
+ return true
+ }
+
+ if conf.Sonic.DevDisableFileCheck {
+ return false
+ }
+
+ if !strings.HasPrefix(t.Location, "file://") {
return true
}
@@ -262,7 +270,7 @@ func (s *ItunesScanner) collectMediaFiles(t *itl.Track) *domain.MediaFile {
mf.CreatedAt = t.DateAdded
mf.UpdatedAt = s.lastChangedDate(t)
- if mf.UpdatedAt.After(s.lastModifiedSince) {
+ if mf.UpdatedAt.After(s.lastModifiedSince) && !conf.Sonic.DevDisableFileCheck {
mf.HasCoverArt = hasCoverArt(path)
}