Using PersistentIDs instead of "Database" IDs
This commit is contained in:
@@ -38,7 +38,7 @@ func (r *mediaFileRepository) Get(id string) (*domain.MediaFile, error) {
|
||||
|
||||
func (r *mediaFileRepository) FindByAlbum(albumId string) (domain.MediaFiles, error) {
|
||||
var mfs = make(domain.MediaFiles, 0)
|
||||
err := r.loadChildren("album", albumId, &mfs)
|
||||
err := r.loadChildren("album", albumId, &mfs, domain.QueryOptions{SortBy: "TrackNumber"})
|
||||
sort.Sort(mfs)
|
||||
return mfs, err
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ func (r *playlistRepository) Get(id string) (*domain.Playlist, error) {
|
||||
|
||||
func (r *playlistRepository) GetAll(options domain.QueryOptions) (domain.Playlists, error) {
|
||||
var as = make(domain.Playlists, 0)
|
||||
if options.SortBy == "" {
|
||||
options.SortBy = "Name"
|
||||
options.Alpha = true
|
||||
}
|
||||
err := r.loadAll(&as, options)
|
||||
return as, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user