Skip to content

Commit

Permalink
refactor(scanner): remove unused genreIDs arg
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed May 18, 2022
1 parent 53a4247 commit d6d1fe2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"github.com/jinzhu/gorm"
"github.com/rainycape/unidecode"

"go.senan.xyz/gonic/multierr"
"go.senan.xyz/gonic/db"
"go.senan.xyz/gonic/mime"
"go.senan.xyz/gonic/multierr"
"go.senan.xyz/gonic/scanner/tags"
)

Expand Down Expand Up @@ -224,7 +224,7 @@ func (s *Scanner) populateTrackAndAlbumArtists(tx *db.DB, c *Context, i int, par
if err != nil {
return fmt.Errorf("populate album artist: %w", err)
}
if err := populateAlbum(tx, album, albumArtist, trags, genreIDs, stat.ModTime(), statCreateTime(stat)); err != nil {
if err := populateAlbum(tx, album, albumArtist, trags, stat.ModTime(), statCreateTime(stat)); err != nil {
return fmt.Errorf("populate album: %w", err)
}
if err := populateAlbumGenres(tx, album, genreIDs); err != nil {
Expand All @@ -235,7 +235,6 @@ func (s *Scanner) populateTrackAndAlbumArtists(tx *db.DB, c *Context, i int, par
if err := populateTrack(tx, album, track, trags, basename, int(stat.Size())); err != nil {
return fmt.Errorf("process %q: %w", basename, err)
}

if err := populateTrackGenres(tx, track, genreIDs); err != nil {
return fmt.Errorf("populate track genres: %w", err)
}
Expand All @@ -246,7 +245,7 @@ func (s *Scanner) populateTrackAndAlbumArtists(tx *db.DB, c *Context, i int, par
return nil
}

func populateAlbum(tx *db.DB, album *db.Album, albumArtist *db.Artist, trags tags.Parser, genreIDs []int, modTime, createTime time.Time) error {
func populateAlbum(tx *db.DB, album *db.Album, albumArtist *db.Artist, trags tags.Parser, modTime, createTime time.Time) error {
albumName := trags.SomeAlbum()
album.TagTitle = albumName
album.TagTitleUDec = decoded(albumName)
Expand Down
2 changes: 1 addition & 1 deletion scanner/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
_ "github.com/jinzhu/gorm/dialects/sqlite"
"github.com/matryer/is"

"go.senan.xyz/gonic/multierr"
"go.senan.xyz/gonic/db"
"go.senan.xyz/gonic/mockfs"
"go.senan.xyz/gonic/multierr"
"go.senan.xyz/gonic/scanner"
)

Expand Down

0 comments on commit d6d1fe2

Please sign in to comment.