From e46c40faf2b14bd50ef4c32fdbd8685d0b1e0dfe Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 23 Mar 2015 22:26:19 -0400 Subject: [PATCH] fix image randomization --- .../Photos/BaseDynamicImageProvider.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs b/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs index 4ff42c1fd..2cfc873de 100644 --- a/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs +++ b/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs @@ -128,7 +128,10 @@ namespace MediaBrowser.Server.Implementations.Photos private const string Version = "3"; protected string GetConfigurationCacheKey(List items, string itemName) { - return (Version + "_" + (itemName ?? string.Empty) + "_" + string.Join(",", items.Select(i => i.Id.ToString("N")).ToArray())).GetMD5().ToString("N"); + var parts = Version + "_" + (itemName ?? string.Empty) + "_" + + string.Join(",", items.Select(i => i.Id.ToString("N")).ToArray()); + + return parts.GetMD5().ToString("N"); } protected Task GetThumbCollage(List items) @@ -224,7 +227,7 @@ namespace MediaBrowser.Server.Implementations.Photos var random = new Random(GetWeekOfYear()).Next(); return items - .OrderBy(i => random - items.IndexOf(i)) + .OrderBy(i => (random + "" + items.IndexOf(i)).GetMD5()) .Take(limit) .OrderBy(i => i.Name) .ToList(); @@ -232,6 +235,7 @@ namespace MediaBrowser.Server.Implementations.Photos private int GetWeekOfYear() { + return DateTime.Now.Second; var usCulture = new CultureInfo("en-US"); var weekNo = usCulture.Calendar.GetWeekOfYear( DateTime.Now,