Storm MediaFileRepository complete.
This commit is contained in:
@@ -74,7 +74,7 @@ func (r *stormRepository) purgeInactive(ids []string) (deleted []string, err err
|
||||
return deleted, nil
|
||||
}
|
||||
|
||||
func (r *stormRepository) execute(matcher q.Matcher, result *[]_Album, options ...*domain.QueryOptions) error {
|
||||
func (r *stormRepository) execute(matcher q.Matcher, result interface{}, options ...*domain.QueryOptions) error {
|
||||
query := Db().Select(matcher)
|
||||
if len(options) > 0 {
|
||||
query = addQueryOptions(query, options[0])
|
||||
@@ -86,6 +86,15 @@ func (r *stormRepository) execute(matcher q.Matcher, result *[]_Album, options .
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *stormRepository) getAll(all interface{}, options *domain.QueryOptions) (err error) {
|
||||
if options.SortBy != "" {
|
||||
err = Db().AllByIndex(options.SortBy, all, stormOptions(options))
|
||||
} else {
|
||||
err = Db().All(all, stormOptions(options))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func stormOptions(options *domain.QueryOptions) func(*index.Options) {
|
||||
return func(opts *index.Options) {
|
||||
opts.Reverse = options.Desc
|
||||
|
||||
Reference in New Issue
Block a user