fixup! run gofumpt / format comments / comment blocks
This commit is contained in:
@@ -126,14 +126,14 @@ func (s *Scanner) Start() error {
|
||||
s.db.Exec(`
|
||||
DELETE FROM albums
|
||||
WHERE tag_artist_id NOT NULL
|
||||
AND NOT EXISTS ( SELECT 1 FROM tracks
|
||||
WHERE tracks.album_id=albums.id
|
||||
AND NOT EXISTS ( SELECT 1 FROM tracks
|
||||
WHERE tracks.album_id=albums.id
|
||||
)`)
|
||||
// delete artists without albums
|
||||
s.db.Exec(`
|
||||
DELETE FROM artists
|
||||
WHERE NOT EXISTS ( SELECT 1 from albums
|
||||
WHERE albums.tag_artist_id=artists.id
|
||||
WHERE NOT EXISTS ( SELECT 1 from albums
|
||||
WHERE albums.tag_artist_id=artists.id
|
||||
)`)
|
||||
// finish up
|
||||
strNow := strconv.FormatInt(time.Now().Unix(), 10)
|
||||
|
||||
@@ -32,6 +32,7 @@ func (t *Tags) firstTag(keys ...string) string {
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (t *Tags) Title() string { return t.firstTag("title") }
|
||||
func (t *Tags) BrainzID() string { return t.firstTag("musicbrainz_trackid") }
|
||||
func (t *Tags) Artist() string { return t.firstTag("artist") }
|
||||
@@ -44,6 +45,7 @@ func (t *Tags) TrackNumber() int { return intSep(t.firstTag("tracknumber"),
|
||||
func (t *Tags) DiscNumber() int { return intSep(t.firstTag("discnumber"), "/") } // eg. 1/2
|
||||
func (t *Tags) Length() int { return t.props.Length }
|
||||
func (t *Tags) Bitrate() int { return t.props.Bitrate }
|
||||
|
||||
func intSep(in, sep string) int {
|
||||
if in == "" {
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user