aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-18 18:26:06 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-18 18:26:06 -0400
commit708d5a416ed373c158b3dc45952a1fd123fb74e8 (patch)
treeebdf2c12344afd856c040b8396b288dc6be8f8e2
parentcf4adb84383d937db27c2052721417863908e2fd (diff)
updated nuget
-rw-r--r--MediaBrowser.Controller/Channels/IChannel.cs6
-rw-r--r--MediaBrowser.Server.Implementations/Channels/ChannelManager.cs27
-rw-r--r--Nuget/MediaBrowser.Common.Internal.nuspec4
-rw-r--r--Nuget/MediaBrowser.Common.nuspec2
-rw-r--r--Nuget/MediaBrowser.Server.Core.nuspec4
5 files changed, 28 insertions, 15 deletions
diff --git a/MediaBrowser.Controller/Channels/IChannel.cs b/MediaBrowser.Controller/Channels/IChannel.cs
index 8a21179b1..85744119c 100644
--- a/MediaBrowser.Controller/Channels/IChannel.cs
+++ b/MediaBrowser.Controller/Channels/IChannel.cs
@@ -16,6 +16,12 @@ namespace MediaBrowser.Controller.Channels
string Name { get; }
/// <summary>
+ /// Gets the data version.
+ /// </summary>
+ /// <value>The data version.</value>
+ string DataVersion { get; }
+
+ /// <summary>
/// Gets the channel information.
/// </summary>
/// <returns>ChannelInfo.</returns>
diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
index f1558e9de..db2728ebe 100644
--- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
+++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
@@ -162,9 +162,9 @@ namespace MediaBrowser.Server.Implementations.Channels
var 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.Channels
var 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.Channels
var 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.Channels
Guid 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.nuspec
index 798d7169d..69ef27c11 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.nuspec
index bc1fb3896..9e2af2bca 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.nuspec
index ba2889603..34c558302 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>