The Free Software Media System - Server Backend & API
updated nuget
Luke Pulverenti708d5a416ed3
diff --git a/MediaBrowser.Controller/Channels/IChannel.cs b/MediaBrowser.Controller/Channels/IChannel.csindex 8a21179b11..85744119ca 100644--- a/MediaBrowser.Controller/Channels/IChannel.cs+++ b/MediaBrowser.Controller/Channels/IChannel.cs@@ -15,6 +15,12 @@ namespace MediaBrowser.Controller.Channels/// <value>The name.</value>string Name { get; }+ /// <summary>+ /// Gets the data version.+ /// </summary>+ /// <value>The data version.</value>+ string DataVersion { get; }+/// <summary>/// Gets the channel information./// </summary>diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.csindex f1558e9dec..db2728ebe9 100644--- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs+++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs@@ -162,9 +162,9 @@ namespace MediaBrowser.Server.Implementations.Channelsvar channelGuid = new Guid(item.ChannelId);var channel = _channelEntities.First(i => i.Id == channelGuid);- var internalChannel = _channels.First(i => string.Equals(i.Name, channel.OriginalChannelName, StringComparison.OrdinalIgnoreCase));+ var channelPlugin = GetChannelProvider(channel);- var requiresCallback = internalChannel as IRequiresMediaInfoCallback;+ var requiresCallback = channelPlugin as IRequiresMediaInfoCallback;if (requiresCallback != null){@@ -264,7 +264,9 @@ namespace MediaBrowser.Server.Implementations.Channelsvar channelId = channel.Id.ToString("N");- var tasks = items.Select(i => GetChannelItemEntity(i, channelId, cancellationToken));+ var channelPlugin = GetChannelProvider(channel);++ var tasks = items.Select(i => GetChannelItemEntity(i, channelPlugin, channelId, cancellationToken));return await Task.WhenAll(tasks).ConfigureAwait(false);});@@ -363,7 +365,9 @@ namespace MediaBrowser.Server.Implementations.Channelsvar categoryKey = string.IsNullOrWhiteSpace(categoryId) ? "root" : categoryId.GetMD5().ToString("N");- return Path.Combine(_config.ApplicationPaths.CachePath, "channels", channelId, categoryKey, user.Id.ToString("N") + ".json");+ var version = string.IsNullOrWhiteSpace(channel.DataVersion) ? "0" : channel.DataVersion;++ return Path.Combine(_config.ApplicationPaths.CachePath, "channels", channelId, version, categoryKey, user.Id.ToString("N") + ".json");}private async Task<QueryResult<BaseItemDto>> GetReturnItems(IEnumerable<BaseItem> items, User user, ChannelItemQuery query, CancellationToken cancellationToken)@@ -401,13 +405,14 @@ namespace MediaBrowser.Server.Implementations.Channels};}- private string GetIdToHash(string externalId)+ private string GetIdToHash(string externalId, IChannel channelProvider){// Increment this as needed to force new downloads- return externalId + "8";+ // Incorporate Name because it's being used to convert channel entity to provider+ return externalId + (channelProvider.DataVersion ?? string.Empty) + (channelProvider.Name ?? string.Empty) + "11";}- private async Task<BaseItem> GetChannelItemEntity(ChannelItemInfo info, string internalChannnelId, CancellationToken cancellationToken)+ private async Task<BaseItem> GetChannelItemEntity(ChannelItemInfo info, IChannel channelProvider, string internalChannnelId, CancellationToken cancellationToken){if (string.IsNullOrEmpty(internalChannnelId)){@@ -418,9 +423,11 @@ namespace MediaBrowser.Server.Implementations.ChannelsGuid id;var isNew = false;+ var idToHash = GetIdToHash(info.Id, channelProvider);+if (info.Type == ChannelItemType.Category){- id = GetIdToHash(info.Id).GetMBId(typeof(ChannelCategoryItem));+ id = idToHash.GetMBId(typeof(ChannelCategoryItem));item = _libraryManager.GetItemById(id) as ChannelCategoryItem;@@ -432,7 +439,7 @@ namespace MediaBrowser.Server.Implementations.Channels}else if (info.MediaType == ChannelMediaType.Audio){- id = GetIdToHash(info.Id).GetMBId(typeof(ChannelCategoryItem));+ id = idToHash.GetMBId(typeof(ChannelCategoryItem));item = _libraryManager.GetItemById(id) as ChannelAudioItem;@@ -444,7 +451,7 @@ namespace MediaBrowser.Server.Implementations.Channels}else{- id = GetIdToHash(info.Id).GetMBId(typeof(ChannelVideoItem));+ id = idToHash.GetMBId(typeof(ChannelVideoItem));item = _libraryManager.GetItemById(id) as ChannelVideoItem;diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex 798d7169de..69ef27c113 100644--- a/Nuget/MediaBrowser.Common.Internal.nuspec+++ b/Nuget/MediaBrowser.Common.Internal.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common.Internal</id>- <version>3.0.369</version>+ <version>3.0.371</version><title>MediaBrowser.Common.Internal</title><authors>Luke</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.369" />+ <dependency id="MediaBrowser.Common" version="3.0.371" /><dependency id="NLog" version="2.1.0" /><dependency id="SimpleInjector" version="2.5.0" /><dependency id="sharpcompress" version="0.10.2" />diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex bc1fb3896f..9e2af2bcaa 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.369</version>+ <version>3.0.371</version><title>MediaBrowser.Common</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspecindex ba28896035..34c558302b 100644--- a/Nuget/MediaBrowser.Server.Core.nuspec+++ b/Nuget/MediaBrowser.Server.Core.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Server.Core</id>- <version>3.0.369</version>+ <version>3.0.371</version><title>Media Browser.Server.Core</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains core components required to build plugins for Media Browser Server.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.369" />+ <dependency id="MediaBrowser.Common" version="3.0.371" /></dependencies></metadata><files>