Skip to content

Commit

Permalink
update created_at logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Dec 7, 2023
1 parent 09967e3 commit 688f9d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion scanner/scanner.go
Expand Up @@ -399,7 +399,9 @@ func populateAlbum(tx *db.DB, album *db.Album, trags tagcommon.Info, modTime tim
album.TagYear = trags.Year()

album.ModifiedAt = modTime
album.CreatedAt = modTime
if album.CreatedAt.After(modTime) {
album.CreatedAt = modTime // reset created at to match filesytem for new albums
}

if err := tx.Save(&album).Error; err != nil {
return fmt.Errorf("saving album: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion tags/tagcommon/tagcommmon.go
Expand Up @@ -13,7 +13,7 @@ type Reader interface {

type Info interface {
Title() string
BrainzID() string
BrainzID() string // musicbrainz recording ID
Artist() string
Artists() []string
Album() string
Expand Down

0 comments on commit 688f9d3

Please sign in to comment.