The Free Software Media System - Server Backend & API
rename channel category to channel folder
Luke Pulverenti40836f194bc4
diff --git a/MediaBrowser.Api/ChannelService.cs b/MediaBrowser.Api/ChannelService.csindex 9fa4eec4ae..bc3c11374a 100644--- a/MediaBrowser.Api/ChannelService.cs+++ b/MediaBrowser.Api/ChannelService.cs@@ -41,7 +41,7 @@ namespace MediaBrowser.Api{public string Id { get; set; }- public string CategoryId { get; set; }+ public string FolderId { get; set; }/// <summary>/// Gets or sets the user id.@@ -120,7 +120,7 @@ namespace MediaBrowser.ApiStartIndex = request.StartIndex,UserId = request.UserId,ChannelId = request.Id,- CategoryId = request.CategoryId,+ FolderId = request.FolderId,SortOrder = request.SortOrder,SortBy = (request.SortBy ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToArray(),Filters = request.GetFilters().ToArray()diff --git a/MediaBrowser.Api/Images/ImageByNameService.cs b/MediaBrowser.Api/Images/ImageByNameService.csindex 6dda2ae7af..c741dd8a80 100644--- a/MediaBrowser.Api/Images/ImageByNameService.cs+++ b/MediaBrowser.Api/Images/ImageByNameService.cs@@ -1,5 +1,4 @@using MediaBrowser.Common.Extensions;-using MediaBrowser.Common.IO;using MediaBrowser.Controller;using MediaBrowser.Controller.Entities;using ServiceStack;diff --git a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs b/MediaBrowser.Controller/Channels/ChannelAudioItem.csindex 7072d42848..f62573780f 100644--- a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs+++ b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs@@ -53,5 +53,10 @@ namespace MediaBrowser.Controller.Channelsreturn base.LocationType;}}++ public override string GetClientTypeName()+ {+ return "audio.channelItem";+ }}}diff --git a/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs b/MediaBrowser.Controller/Channels/ChannelFolderItem.cssimilarity index 79%rename from MediaBrowser.Controller/Channels/ChannelCategoryItem.csrename to MediaBrowser.Controller/Channels/ChannelFolderItem.csindex c18f748563..56262ab20d 100644--- a/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs+++ b/MediaBrowser.Controller/Channels/ChannelFolderItem.cs@@ -4,7 +4,7 @@ using System.Collections.Generic;namespace MediaBrowser.Controller.Channels{- public class ChannelCategoryItem : Folder, IChannelItem+ public class ChannelFolderItem : Folder, IChannelItem{public string ExternalId { get; set; }@@ -29,9 +29,14 @@ namespace MediaBrowser.Controller.Channels}}- public ChannelCategoryItem()+ public ChannelFolderItem(){Tags = new List<string>();}++ public override string GetClientTypeName()+ {+ return "folder.channelItem";+ }}}diff --git a/MediaBrowser.Controller/Channels/ChannelItemType.cs b/MediaBrowser.Controller/Channels/ChannelItemType.csindex ba9d7f414e..184ce8a767 100644--- a/MediaBrowser.Controller/Channels/ChannelItemType.cs+++ b/MediaBrowser.Controller/Channels/ChannelItemType.cs@@ -4,6 +4,6 @@{Media = 0,- Category = 1+ Folder = 1}}\ No newline at end of filediff --git a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs b/MediaBrowser.Controller/Channels/ChannelVideoItem.csindex 572e316a0f..6d0497c4d3 100644--- a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs+++ b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs@@ -77,5 +77,10 @@ namespace MediaBrowser.Controller.Channelsreturn base.LocationType;}}++ public override string GetClientTypeName()+ {+ return "video.channelItem";+ }}}diff --git a/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs b/MediaBrowser.Controller/Channels/InternalChannelItemQuery.csindex 3846e8a007..aa8e7b9f1e 100644--- a/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs+++ b/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs@@ -4,7 +4,7 @@ namespace MediaBrowser.Controller.Channels{public class InternalChannelItemQuery{- public string CategoryId { get; set; }+ public string FolderId { get; set; }public User User { get; set; }diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csprojindex fa7842a684..a198f10911 100644--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj@@ -68,7 +68,7 @@<Compile Include="..\SharedVersion.cs"><Link>Properties\SharedVersion.cs</Link></Compile>- <Compile Include="Channels\ChannelCategoryItem.cs" />+ <Compile Include="Channels\ChannelFolderItem.cs" /><Compile Include="Channels\ChannelItemInfo.cs" /><Compile Include="Channels\ChannelItemResult.cs" /><Compile Include="Channels\ChannelItemType.cs" />diff --git a/MediaBrowser.Model/Channels/ChannelItemQuery.cs b/MediaBrowser.Model/Channels/ChannelItemQuery.csindex 2da955e885..632db55814 100644--- a/MediaBrowser.Model/Channels/ChannelItemQuery.cs+++ b/MediaBrowser.Model/Channels/ChannelItemQuery.cs@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.Channels/// Gets or sets the category identifier./// </summary>/// <value>The category identifier.</value>- public string CategoryId { get; set; }+ public string FolderId { get; set; }/// <summary>/// Gets or sets the user identifier.diff --git a/MediaBrowser.Model/Channels/ChannelMediaType.cs b/MediaBrowser.Model/Channels/ChannelMediaType.csindex 5d2201aaf0..102cb66447 100644--- a/MediaBrowser.Model/Channels/ChannelMediaType.cs+++ b/MediaBrowser.Model/Channels/ChannelMediaType.cs@@ -4,6 +4,8 @@{Audio = 0,- Video = 1+ Video = 1,++ Photo = 2}}\ No newline at end of filediff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.csindex 06408d525d..db5c6b4399 100644--- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs+++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs@@ -278,7 +278,7 @@ namespace MediaBrowser.Server.Implementations.Channels? null: _userManager.GetUserById(new Guid(query.UserId));- var itemsResult = await GetChannelItems(channelProvider, user, query.CategoryId, providerStartIndex, providerLimit, cancellationToken)+ var itemsResult = await GetChannelItems(channelProvider, user, query.FolderId, providerStartIndex, providerLimit, cancellationToken).ConfigureAwait(false);var providerTotalRecordCount = providerLimit.HasValue ? itemsResult.TotalRecordCount : null;@@ -301,9 +301,9 @@ namespace MediaBrowser.Server.Implementations.Channels}private readonly SemaphoreSlim _resourcePool = new SemaphoreSlim(1, 1);- private async Task<ChannelItemResult> GetChannelItems(IChannel channel, User user, string categoryId, int? startIndex, int? limit, CancellationToken cancellationToken)+ private async Task<ChannelItemResult> GetChannelItems(IChannel channel, User user, string folderId, int? startIndex, int? limit, CancellationToken cancellationToken){- var cachePath = GetChannelDataCachePath(channel, user, categoryId);+ var cachePath = GetChannelDataCachePath(channel, user, folderId);try{@@ -358,11 +358,11 @@ namespace MediaBrowser.Server.Implementations.ChannelsLimit = limit};- if (!string.IsNullOrWhiteSpace(categoryId))+ if (!string.IsNullOrWhiteSpace(folderId)){- var categoryItem = (IChannelItem)_libraryManager.GetItemById(new Guid(categoryId));+ var categoryItem = (IChannelItem)_libraryManager.GetItemById(new Guid(folderId));- query.CategoryId = categoryItem.ExternalId;+ query.FolderId = categoryItem.ExternalId;}var result = await channel.GetChannelItems(query, cancellationToken).ConfigureAwait(false);@@ -394,15 +394,15 @@ namespace MediaBrowser.Server.Implementations.Channels}}- private string GetChannelDataCachePath(IChannel channel, User user, string categoryId)+ private string GetChannelDataCachePath(IChannel channel, User user, string folderId){var channelId = GetInternalChannelId(channel.Name).ToString("N");- var categoryKey = string.IsNullOrWhiteSpace(categoryId) ? "root" : categoryId.GetMD5().ToString("N");+ var folderKey = string.IsNullOrWhiteSpace(folderId) ? "root" : folderId.GetMD5().ToString("N");var version = string.IsNullOrWhiteSpace(channel.DataVersion) ? "0" : channel.DataVersion;- return Path.Combine(_config.ApplicationPaths.CachePath, "channels", channelId, version, categoryKey, user.Id.ToString("N") + ".json");+ return Path.Combine(_config.ApplicationPaths.CachePath, "channels", channelId, version, folderKey, user.Id.ToString("N") + ".json");}private async Task<QueryResult<BaseItemDto>> GetReturnItems(IEnumerable<BaseItem> items, int? totalCountFromProvider, User user, ChannelItemQuery query, CancellationToken cancellationToken)@@ -448,7 +448,7 @@ namespace MediaBrowser.Server.Implementations.Channels{// Increment this as needed to force new downloads// Incorporate Name because it's being used to convert channel entity to provider- return externalId + (channelProvider.DataVersion ?? string.Empty) + (channelProvider.Name ?? string.Empty) + "11";+ return externalId + (channelProvider.DataVersion ?? string.Empty) + (channelProvider.Name ?? string.Empty) + "12";}private async Task<BaseItem> GetChannelItemEntity(ChannelItemInfo info, IChannel channelProvider, Channel internalChannel, CancellationToken cancellationToken)@@ -459,21 +459,21 @@ namespace MediaBrowser.Server.Implementations.Channelsvar idToHash = GetIdToHash(info.Id, channelProvider);- if (info.Type == ChannelItemType.Category)+ if (info.Type == ChannelItemType.Folder){- id = idToHash.GetMBId(typeof(ChannelCategoryItem));+ id = idToHash.GetMBId(typeof(ChannelFolderItem));- item = _libraryManager.GetItemById(id) as ChannelCategoryItem;+ item = _libraryManager.GetItemById(id) as ChannelFolderItem;if (item == null){isNew = true;- item = new ChannelCategoryItem();+ item = new ChannelFolderItem();}}else if (info.MediaType == ChannelMediaType.Audio){- id = idToHash.GetMBId(typeof(ChannelCategoryItem));+ id = idToHash.GetMBId(typeof(ChannelFolderItem));item = _libraryManager.GetItemById(id) as ChannelAudioItem;diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csprojindex 3c97f8d4ba..84e9645c23 100644--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj@@ -172,6 +172,9 @@<Content Include="dashboard-ui\css\images\items\folders\edit.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>+ <Content Include="dashboard-ui\css\images\items\folders\home.png">+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>+ </Content><Content Include="dashboard-ui\css\images\items\folders\report.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex b2bb75a9a6..5f90fd709a 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.372</version>+ <version>3.0.374</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.372" />+ <dependency id="MediaBrowser.Common" version="3.0.374" /><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 348d67d07b..bb936bc0c3 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.372</version>+ <version>3.0.374</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 08c81391f7..e3bc343ab4 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.372</version>+ <version>3.0.374</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.372" />+ <dependency id="MediaBrowser.Common" version="3.0.374" /></dependencies></metadata><files>