From fc6a270fb71c1c5db34562759d043531d242775d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 20 Mar 2016 13:52:36 -0400 Subject: [PATCH] update sorting --- MediaBrowser.Controller/Entities/Folder.cs | 5 ----- .../Persistence/SqliteItemRepository.cs | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 0cf102d93..3d4e90671 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -916,11 +916,6 @@ namespace MediaBrowser.Controller.Entities Logger.Debug("Query requires post-filtering due to ItemSortBy.Players"); return true; } - if (query.SortBy.Contains(ItemSortBy.Random, StringComparer.OrdinalIgnoreCase)) - { - Logger.Debug("Query requires post-filtering due to ItemSortBy.Random"); - return true; - } if (query.SortBy.Contains(ItemSortBy.Revenue, StringComparer.OrdinalIgnoreCase)) { Logger.Debug("Query requires post-filtering due to ItemSortBy.Revenue"); diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index 12e444017..1eaff1a6a 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -1592,6 +1592,10 @@ namespace MediaBrowser.Server.Implementations.Persistence { return "RuntimeTicks"; } + if (string.Equals(name, ItemSortBy.Random, StringComparison.OrdinalIgnoreCase)) + { + return "RANDOM()"; + } return name; }