getRandomSongs.view (partially) implemented

This commit is contained in:
Deluan
2016-03-29 00:01:27 -04:00
parent 880521360f
commit 768764bea7
7 changed files with 70 additions and 5 deletions
+16
View File
@@ -52,6 +52,22 @@ func (r *mediaFileRepository) GetStarred(options domain.QueryOptions) (domain.Me
return mfs, err
}
func (r *mediaFileRepository) GetAllIds() ([]string, error) {
idMap, err := r.getAllIds()
if err != nil {
return nil, err
}
ids := make([]string, len(idMap))
i := 0
for id := range idMap {
ids[i] = id
i++
}
return ids, nil
}
func (r *mediaFileRepository) PurgeInactive(active domain.MediaFiles) ([]string, error) {
return r.purgeInactive(active, func(e interface{}) string {
return e.(domain.MediaFile).Id