Add Dev flag to disable file presence verification

This commit is contained in:
Deluan 2020-01-11 01:38:40 -05:00 committed by Deluan Quintão
parent 57390fcda3
commit a4a8360a94
2 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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)
}