The Free Software Media System - Server Backend & API
add notification services tab
Luke Pulverenti3cc0ad2a3599
diff --git a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs b/MediaBrowser.Controller/Channels/ChannelAudioItem.csindex 8d90246765..7582f4c91b 100644--- a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs+++ b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs@@ -1,4 +1,5 @@-using MediaBrowser.Controller.Entities.Audio;+using MediaBrowser.Controller.Entities;+using MediaBrowser.Controller.Entities.Audio;using MediaBrowser.Model.Channels;using MediaBrowser.Model.Configuration;using MediaBrowser.Model.Dto;@@ -100,5 +101,10 @@ namespace MediaBrowser.Controller.Channels{return false;}++ public override bool IsVisibleStandalone(User user)+ {+ return base.IsVisibleStandalone(user) && ChannelVideoItem.IsChannelVisible(this, user);+ }}}diff --git a/MediaBrowser.Controller/Channels/ChannelFolderItem.cs b/MediaBrowser.Controller/Channels/ChannelFolderItem.csindex 7ba73d126c..43f5160a45 100644--- a/MediaBrowser.Controller/Channels/ChannelFolderItem.cs+++ b/MediaBrowser.Controller/Channels/ChannelFolderItem.cs@@ -80,5 +80,10 @@ namespace MediaBrowser.Controller.Channels{return false;}++ public override bool IsVisibleStandalone(User user)+ {+ return base.IsVisibleStandalone(user) && ChannelVideoItem.IsChannelVisible(this, user);+ }}}diff --git a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs b/MediaBrowser.Controller/Channels/ChannelVideoItem.csindex 8eec2021b5..d97341d8f9 100644--- a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs+++ b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs@@ -130,5 +130,17 @@ namespace MediaBrowser.Controller.Channels{return false;}++ public override bool IsVisibleStandalone(User user)+ {+ return base.IsVisibleStandalone(user) && IsChannelVisible(this, user);+ }++ internal static bool IsChannelVisible(IChannelItem item, User user)+ {+ var channel = ChannelManager.GetChannel(item.ChannelId);++ return channel.IsVisible(user);+ }}}diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex 94fc761253..27bd09ec7d 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -1154,9 +1154,19 @@ namespace MediaBrowser.Controller.Entitiesreturn false;}- // TODO: Need some work here, e.g. is in user library, for channels, can user access channel, etc.+ var topParent = Parents.LastOrDefault() ?? this;- return true;+ if (string.IsNullOrWhiteSpace(topParent.Path))+ {+ return true;+ }++ var locations = user.RootFolder+ .GetChildren(user, true)+ .OfType<CollectionFolder>()+ .SelectMany(i => i.PhysicalLocations);++ return locations.Any(l => FileSystem.ContainsSubPath(l, topParent.Path));}/// <summary>diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csprojindex c3038cadb3..ad561c4849 100644--- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj+++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj@@ -106,7 +106,9 @@<ItemGroup><None Include="packages.config" /></ItemGroup>- <ItemGroup />+ <ItemGroup>+ <EmbeddedResource Include="Probing\whitelist.txt" />+ </ItemGroup><Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /><!-- To modify your build process, add your task inside one of the targets below and uncomment it.Other similar extension points exist, see Microsoft.Common.targets.diff --git a/MediaBrowser.Providers/MediaInfo/whitelist.txt b/MediaBrowser.MediaEncoding/Probing/whitelist.txtsimilarity index 100%rename from MediaBrowser.Providers/MediaInfo/whitelist.txtrename to MediaBrowser.MediaEncoding/Probing/whitelist.txtdiff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csprojindex b58c6648ab..09951b29d5 100644--- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj+++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj@@ -209,9 +209,6 @@<ItemGroup><None Include="packages.config" /></ItemGroup>- <ItemGroup>- <EmbeddedResource Include="MediaInfo\whitelist.txt" />- </ItemGroup><ItemGroup /><Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /><!-- To modify your build process, add your task inside one of the targets below and uncomment it.diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.csindex e22bf2e7f7..6a0e1208a0 100644--- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs+++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs@@ -330,7 +330,7 @@ namespace MediaBrowser.Server.Implementations.Channels{files = files.Where(i => _libraryManager.IsAudioFile(i.FullName));}-+var file = files.FirstOrDefault(i => i.Name.StartsWith(filenamePrefix, StringComparison.OrdinalIgnoreCase));@@ -1454,7 +1454,14 @@ namespace MediaBrowser.Server.Implementations.Channelsvar host = new Uri(source.Path).Host.ToLower();var channel = GetChannel(item.ChannelId);var channelProvider = GetChannelProvider(channel);- var limit = channelProvider.GetChannelFeatures().DailyDownloadLimit;+ var features = channelProvider.GetChannelFeatures();++ if (!features.SupportsContentDownloading)+ {+ throw new ArgumentException("The channel does not support downloading.");+ }++ var limit = features.DailyDownloadLimit;if (!ValidateDownloadLimit(host, limit)){diff --git a/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.csindex 090f1e7569..1ffaf5b8ce 100644--- a/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs+++ b/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs@@ -245,23 +245,17 @@ namespace MediaBrowser.Server.Implementations.EntryPointsvar collections = user.RootFolder.GetChildren(user, true).ToList();- var allRecursiveChildren = user.RootFolder- .GetRecursiveChildren(user)- .Select(i => i.Id)- .Distinct()- .ToDictionary(i => i);-return new LibraryUpdateInfo{- ItemsAdded = itemsAdded.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections, allRecursiveChildren)).Select(i => i.Id.ToString("N")).Distinct().ToList(),+ ItemsAdded = itemsAdded.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections)).Select(i => i.Id.ToString("N")).Distinct().ToList(),- ItemsUpdated = itemsUpdated.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections, allRecursiveChildren)).Select(i => i.Id.ToString("N")).Distinct().ToList(),+ ItemsUpdated = itemsUpdated.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections)).Select(i => i.Id.ToString("N")).Distinct().ToList(),- ItemsRemoved = itemsRemoved.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections, allRecursiveChildren, true)).Select(i => i.Id.ToString("N")).Distinct().ToList(),+ ItemsRemoved = itemsRemoved.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections, true)).Select(i => i.Id.ToString("N")).Distinct().ToList(),- FoldersAddedTo = foldersAddedTo.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections, allRecursiveChildren)).Select(i => i.Id.ToString("N")).Distinct().ToList(),+ FoldersAddedTo = foldersAddedTo.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections)).Select(i => i.Id.ToString("N")).Distinct().ToList(),- FoldersRemovedFrom = foldersRemovedFrom.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections, allRecursiveChildren)).Select(i => i.Id.ToString("N")).Distinct().ToList()+ FoldersRemovedFrom = foldersRemovedFrom.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user, collections)).Select(i => i.Id.ToString("N")).Distinct().ToList()};}@@ -272,10 +266,9 @@ namespace MediaBrowser.Server.Implementations.EntryPoints/// <param name="item">The item.</param>/// <param name="user">The user.</param>/// <param name="collections">The collections.</param>- /// <param name="allRecursiveChildren">All recursive children.</param>/// <param name="includeIfNotFound">if set to <c>true</c> [include if not found].</param>/// <returns>IEnumerable{``0}.</returns>- private IEnumerable<T> TranslatePhysicalItemToUserLibrary<T>(T item, User user, IEnumerable<BaseItem> collections, Dictionary<Guid, Guid> allRecursiveChildren, bool includeIfNotFound = false)+ private IEnumerable<T> TranslatePhysicalItemToUserLibrary<T>(T item, User user, IEnumerable<BaseItem> collections, bool includeIfNotFound = false)where T : BaseItem{// If the physical root changed, return the user root@@ -294,7 +287,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints}// Return it only if it's in the user's library- if (includeIfNotFound || allRecursiveChildren.ContainsKey(item.Id) || (item.Parents.Any(i => i is BasePluginFolder) && item.IsVisibleStandalone(user)))+ if (includeIfNotFound || item.IsVisibleStandalone(user)){return new[] { item };}diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.jsonindex 9c53eb92e0..f0f7ba36fe 100644--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json@@ -40,6 +40,7 @@"TitleLiveTV": "Live TV","TitleSync": "Sync","ButtonDonate": "Donate",+ "TitleNotifications": "Notifications","ErrorLaunchingChromecast": "There was an error launching chromecast. Please ensure your device is connected to your wireless network.","MessageErrorLoadingSupporterInfo": "There was an error loading supporter information. Please try again later.","MessageLinkYourSupporterKey": "Link your supporter key with up to {0} Emby Connect members to enjoy free access to the following apps:",