diff --git a/model/model.go b/model/datastore.go similarity index 100% rename from model/model.go rename to model/datastore.go diff --git a/model/mediafile.go b/model/mediafile.go index 07b72f68a..0f6fa4321 100644 --- a/model/mediafile.go +++ b/model/mediafile.go @@ -42,7 +42,7 @@ type MediaFiles []MediaFile type MediaFileRepository interface { CountAll() (int64, error) Exists(id string) (bool, error) - Put(m *MediaFile, overrideAnnotation bool) error + Put(m *MediaFile) error Get(id string) (*MediaFile, error) FindByAlbum(albumId string) (MediaFiles, error) FindByPath(path string) (MediaFiles, error) diff --git a/persistence/mediafile_repository.go b/persistence/mediafile_repository.go index 58489a27c..a38f4c522 100644 --- a/persistence/mediafile_repository.go +++ b/persistence/mediafile_repository.go @@ -48,15 +48,12 @@ func NewMediaFileRepository(o orm.Ormer) model.MediaFileRepository { return r } -func (r *mediaFileRepository) Put(m *model.MediaFile, overrideAnnotation bool) error { +func (r *mediaFileRepository) Put(m *model.MediaFile) error { tm := mediaFile(*m) - if !overrideAnnotation { - // Don't update media annotation fields (playcount, starred, etc..) - return r.put(m.ID, m.Title, &tm, "path", "title", "album", "artist", "artist_id", "album_artist", - "album_id", "has_cover_art", "track_number", "disc_number", "year", "size", "suffix", "duration", - "bit_rate", "genre", "compilation", "updated_at") - } - return r.put(m.ID, m.Title, &tm) + // Don't update media annotation fields (playcount, starred, etc..) + return r.put(m.ID, m.Title, &tm, "path", "title", "album", "artist", "artist_id", "album_artist", + "album_id", "has_cover_art", "track_number", "disc_number", "year", "size", "suffix", "duration", + "bit_rate", "genre", "compilation", "updated_at") } func (r *mediaFileRepository) Get(id string) (*model.MediaFile, error) { diff --git a/persistence/persistence_suite_test.go b/persistence/persistence_suite_test.go index 70edb1fb2..02260954a 100644 --- a/persistence/persistence_suite_test.go +++ b/persistence/persistence_suite_test.go @@ -71,7 +71,7 @@ var _ = Describe("Initialize test DB", func() { } mediaFileRepository := ds.MediaFile() for _, s := range testSongs { - err := mediaFileRepository.Put(&s, true) + err := mediaFileRepository.Put(&s) if err != nil { panic(err) } diff --git a/scanner/tag_scanner.go b/scanner/tag_scanner.go index 8aba6d702..c62ea7354 100644 --- a/scanner/tag_scanner.go +++ b/scanner/tag_scanner.go @@ -169,7 +169,7 @@ func (s *TagScanner) processChangedDir(dir string, updatedArtists map[string]boo for _, n := range newTracks { c, ok := currentTracks[n.ID] if !ok || (ok && n.UpdatedAt.After(c.UpdatedAt)) { - err := s.ds.MediaFile().Put(&n, false) + err := s.ds.MediaFile().Put(&n) updatedArtists[n.ArtistID] = true updatedAlbums[n.AlbumID] = true numUpdatedTracks++