mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-13 02:37:18 +03:00
Using Entries instead of []Entry
This commit is contained in:
parent
393d6fb2dc
commit
0ee070b38c
@ -56,7 +56,7 @@ func (b browser) Indexes(ifModifiedSince time.Time) (*domain.ArtistIndexes, time
|
||||
type DirectoryInfo struct {
|
||||
Id string
|
||||
Name string
|
||||
Entries []Entry
|
||||
Entries Entries
|
||||
}
|
||||
|
||||
func (c browser) Directory(id string) (*DirectoryInfo, error) {
|
||||
@ -87,7 +87,7 @@ func (c browser) Directory(id string) (*DirectoryInfo, error) {
|
||||
func (c browser) buildArtistDir(a *domain.Artist, albums *domain.Albums) *DirectoryInfo {
|
||||
dir := &DirectoryInfo{Id: a.Id, Name: a.Name}
|
||||
|
||||
dir.Entries = make([]Entry, len(*albums))
|
||||
dir.Entries = make(Entries, len(*albums))
|
||||
for i, al := range *albums {
|
||||
dir.Entries[i] = FromAlbum(&al)
|
||||
}
|
||||
@ -97,7 +97,7 @@ func (c browser) buildArtistDir(a *domain.Artist, albums *domain.Albums) *Direct
|
||||
func (c browser) buildAlbumDir(al *domain.Album, tracks *domain.MediaFiles) *DirectoryInfo {
|
||||
dir := &DirectoryInfo{Id: al.Id, Name: al.Name}
|
||||
|
||||
dir.Entries = make([]Entry, len(*tracks))
|
||||
dir.Entries = make(Entries, len(*tracks))
|
||||
for i, mf := range *tracks {
|
||||
dir.Entries[i] = FromMediaFile(&mf)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ func (p playlists) GetAll() (*domain.Playlists, error) {
|
||||
type PlaylistInfo struct {
|
||||
Id string
|
||||
Name string
|
||||
Entries []Entry
|
||||
Entries Entries
|
||||
}
|
||||
|
||||
func (p playlists) Get(id string) (*PlaylistInfo, error) {
|
||||
@ -39,7 +39,7 @@ func (p playlists) Get(id string) (*PlaylistInfo, error) {
|
||||
}
|
||||
|
||||
pinfo := &PlaylistInfo{Id: pl.Id, Name: pl.Name}
|
||||
pinfo.Entries = make([]Entry, len(pl.Tracks))
|
||||
pinfo.Entries = make(Entries, len(pl.Tracks))
|
||||
|
||||
// TODO Optimize: Get all tracks at once
|
||||
for i, mfId := range pl.Tracks {
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/deluan/gosonic/domain"
|
||||
)
|
||||
|
||||
type Results []Entry
|
||||
type Results Entries
|
||||
|
||||
type Search interface {
|
||||
ClearAll() error
|
||||
|
Loading…
x
Reference in New Issue
Block a user