diff --git a/server/db/model.go b/server/db/model.go index 050e39e..4baad50 100644 --- a/server/db/model.go +++ b/server/db/model.go @@ -195,9 +195,8 @@ type Album struct { TagBrainzID string `sql:"default: null"` TagYear int `sql:"default: null"` Tracks []*Track - ChildCount int `sql:"-"` - Duration int `sql:"-"` - ShouldSave bool `sql:"-"` + ChildCount int `sql:"-"` + Duration int `sql:"-"` } func (a *Album) SID() *specid.ID { diff --git a/server/scanner/scanner.go b/server/scanner/scanner.go index 6ae0f44..648c5f7 100644 --- a/server/scanner/scanner.go +++ b/server/scanner/scanner.go @@ -324,7 +324,7 @@ func (s *Scanner) callbackPost(fullPath string, info *godirwalk.Dirent) error { // begin taking the current folder off the stack and add it's // parent, cover that we found, etc. folder := s.curFolders.Pop() - if !folder.ShouldSave { + if folder.ParentID != 0 { return nil } folder.ParentID = s.curFolders.PeekID() @@ -477,7 +477,7 @@ func (s *Scanner) handleTrack(it *item) error { // ** begin set album if this is the first track in the folder folder := s.curFolders.Peek() - if folder.ShouldSave { + if folder.TagTitle != "" { return nil } err = s.trTx. @@ -501,7 +501,6 @@ func (s *Scanner) handleTrack(it *item) error { folder.TagBrainzID = trTags.AlbumBrainzID() folder.TagYear = trTags.Year() folder.TagArtistID = artist.ID - folder.ShouldSave = true return nil }