diff --git a/engine/browser.go b/engine/browser.go index e85946834..a066883b5 100644 --- a/engine/browser.go +++ b/engine/browser.go @@ -80,10 +80,6 @@ func (b *browser) Artist(ctx context.Context, id string) (*DirectoryInfo, error) return nil, err } log.Debug(ctx, "Found Artist", "id", id, "name", a.Name) - var albumIds []string - for _, al := range albums { - albumIds = append(albumIds, al.ID) - } return b.buildArtistDir(a, albums), nil } @@ -93,11 +89,6 @@ func (b *browser) Album(ctx context.Context, id string) (*DirectoryInfo, error) return nil, err } log.Debug(ctx, "Found Album", "id", id, "name", al.Name) - var mfIds []string - for _, mf := range tracks { - mfIds = append(mfIds, mf.ID) - } - return b.buildAlbumDir(al, tracks), nil } diff --git a/engine/list_generator.go b/engine/list_generator.go index 9599097a4..fa300e868 100644 --- a/engine/list_generator.go +++ b/engine/list_generator.go @@ -106,18 +106,6 @@ type listGenerator struct { npRepo NowPlayingRepository } -func (g *listGenerator) query(ctx context.Context, qo model.QueryOptions) (Entries, error) { - albums, err := g.ds.Album(ctx).GetAll(qo) - if err != nil { - return nil, err - } - albumIds := make([]string, len(albums)) - for i, al := range albums { - albumIds[i] = al.ID - } - return FromAlbums(albums), err -} - func (g *listGenerator) GetSongs(ctx context.Context, offset, size int, filter ListFilter) (Entries, error) { qo := model.QueryOptions(filter) qo.Offset = offset @@ -170,16 +158,6 @@ func (g *listGenerator) GetAllStarred(ctx context.Context) (artists Entries, alb return nil, nil, nil, err } - var mfIds []string - for _, mf := range mfs { - mfIds = append(mfIds, mf.ID) - } - - var artistIds []string - for _, ar := range ars { - artistIds = append(artistIds, ar.ID) - } - artists = FromArtists(ars) albums = FromAlbums(als) mediaFiles = FromMediaFiles(mfs) @@ -200,7 +178,7 @@ func (g *listGenerator) GetNowPlaying(ctx context.Context) (Entries, error) { } entries[i] = FromMediaFile(mf) entries[i].UserName = np.Username - entries[i].MinutesAgo = int(time.Now().Sub(np.Start).Minutes()) + entries[i].MinutesAgo = int(time.Since(np.Start).Minutes()) entries[i].PlayerId = np.PlayerId entries[i].PlayerName = np.PlayerName