aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/UserLibrary/ItemsService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-07 14:17:18 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-07 14:17:18 -0400
commiteb63e0d264d563b100a353c12859f226e9303910 (patch)
tree6b0ac7a9745a254870c9720805f8fd91d2009f01 /MediaBrowser.Api/UserLibrary/ItemsService.cs
parentab3e79e6aaa5bf90c90578f514e5ab26def9cb0e (diff)
update image processor
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ItemsService.cs')
-rw-r--r--MediaBrowser.Api/UserLibrary/ItemsService.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs
index fb48f65e4..5919c50d4 100644
--- a/MediaBrowser.Api/UserLibrary/ItemsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs
@@ -408,6 +408,20 @@ namespace MediaBrowser.Api.UserLibrary
}).Where(i => i != null).Select(i => i.Id.ToString("N")).ToArray();
}
+ // Apply default sorting if none requested
+ if (query.OrderBy.Length == 0)
+ {
+ // Albums by artist
+ if (query.ArtistIds.Length > 0 && query.IncludeItemTypes.Length == 1 && string.Equals(query.IncludeItemTypes[0], "MusicAlbum", StringComparison.OrdinalIgnoreCase))
+ {
+ query.OrderBy = new Tuple<string, SortOrder>[]
+ {
+ new Tuple<string, SortOrder>(ItemSortBy.ProductionYear, SortOrder.Descending),
+ new Tuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending)
+ };
+ }
+ }
+
return query;
}
}