From f4765a87cc15efb06331aaeeff3c695be4e77f07 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 20 Aug 2017 15:10:00 -0400 Subject: update m3u tuner --- .../Entities/AggregateFolder.cs | 8 ++--- .../Entities/CollectionFolder.cs | 8 ++--- MediaBrowser.Controller/Entities/Movies/BoxSet.cs | 38 ---------------------- MediaBrowser.Controller/IO/FileData.cs | 10 +++--- MediaBrowser.Controller/Library/ILibraryManager.cs | 2 +- MediaBrowser.Controller/Library/ItemResolveArgs.cs | 29 +++-------------- MediaBrowser.Controller/LiveTv/ChannelInfo.cs | 2 ++ 7 files changed, 18 insertions(+), 79 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.cs index f88522f78a..db84d6e2f9 100644 --- a/MediaBrowser.Controller/Entities/AggregateFolder.cs +++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs @@ -148,18 +148,16 @@ namespace MediaBrowser.Controller.Entities // When resolving the root, we need it's grandchildren (children of user views) var flattenFolderDepth = isPhysicalRoot ? 2 : 0; - var fileSystemDictionary = FileData.GetFilteredFileSystemEntries(directoryService, args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf); + var files = FileData.GetFilteredFileSystemEntries(directoryService, args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf); // Need to remove subpaths that may have been resolved from shortcuts // Example: if \\server\movies exists, then strip out \\server\movies\action if (isPhysicalRoot) { - var paths = LibraryManager.NormalizeRootPathList(fileSystemDictionary.Values); - - fileSystemDictionary = paths.ToDictionary(i => i.FullName); + files = LibraryManager.NormalizeRootPathList(files).ToArray(); } - args.FileSystemDictionary = fileSystemDictionary; + args.FileSystemChildren = files; } _requiresRefresh = _requiresRefresh || !args.PhysicalLocations.SequenceEqual(PhysicalLocations); diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index d02e469d46..3e2c501b44 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -292,18 +292,16 @@ namespace MediaBrowser.Controller.Entities // When resolving the root, we need it's grandchildren (children of user views) var flattenFolderDepth = isPhysicalRoot ? 2 : 0; - var fileSystemDictionary = FileData.GetFilteredFileSystemEntries(directoryService, args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf); + var files = FileData.GetFilteredFileSystemEntries(directoryService, args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf); // Need to remove subpaths that may have been resolved from shortcuts // Example: if \\server\movies exists, then strip out \\server\movies\action if (isPhysicalRoot) { - var paths = LibraryManager.NormalizeRootPathList(fileSystemDictionary.Values); - - fileSystemDictionary = paths.ToDictionary(i => i.FullName); + files = LibraryManager.NormalizeRootPathList(files).ToArray(); } - args.FileSystemDictionary = fileSystemDictionary; + args.FileSystemChildren = files; } _requiresRefresh = _requiresRefresh || !args.PhysicalLocations.SequenceEqual(PhysicalLocations); diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index 376f65d60d..2768d84659 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using System.Linq; using MediaBrowser.Model.Serialization; -using MediaBrowser.Controller.Entities.Audio; namespace MediaBrowser.Controller.Entities.Movies { @@ -82,20 +81,11 @@ namespace MediaBrowser.Controller.Entities.Movies protected override IEnumerable GetNonCachedChildren(IDirectoryService directoryService) { - if (IsLegacyBoxSet) - { - return base.GetNonCachedChildren(directoryService); - } return new List(); } protected override List LoadChildren() { - if (IsLegacyBoxSet) - { - return base.LoadChildren(); - } - // Save a trip to the database return new List(); } @@ -109,34 +99,6 @@ namespace MediaBrowser.Controller.Entities.Movies } } - [IgnoreDataMember] - protected override bool SupportsShortcutChildren - { - get - { - if (IsLegacyBoxSet) - { - return false; - } - - return false; - } - } - - [IgnoreDataMember] - private bool IsLegacyBoxSet - { - get - { - if (string.IsNullOrWhiteSpace(Path)) - { - return false; - } - - return !FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, Path); - } - } - public override bool IsAuthorizedToDelete(User user) { return true; diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.cs index 64a7610fe2..27af60700e 100644 --- a/MediaBrowser.Controller/IO/FileData.cs +++ b/MediaBrowser.Controller/IO/FileData.cs @@ -3,7 +3,7 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; - +using System.Linq; using MediaBrowser.Model.IO; namespace MediaBrowser.Controller.IO @@ -36,7 +36,7 @@ namespace MediaBrowser.Controller.IO /// if set to true [resolve shortcuts]. /// Dictionary{System.StringFileSystemInfo}. /// path - public static Dictionary GetFilteredFileSystemEntries(IDirectoryService directoryService, + public static FileSystemMetadata[] GetFilteredFileSystemEntries(IDirectoryService directoryService, string path, IFileSystem fileSystem, ILogger logger, @@ -57,7 +57,7 @@ namespace MediaBrowser.Controller.IO if (!resolveShortcuts && flattenFolderDepth == 0) { - return GetFileSystemDictionary(entries); + return entries; } var dict = new Dictionary(StringComparer.OrdinalIgnoreCase); @@ -98,7 +98,7 @@ namespace MediaBrowser.Controller.IO { foreach (var child in GetFilteredFileSystemEntries(directoryService, fullName, fileSystem, logger, args, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts)) { - dict[child.Key] = child.Value; + dict[child.FullName] = child; } } else @@ -107,7 +107,7 @@ namespace MediaBrowser.Controller.IO } } - return dict; + return dict.Values.ToArray(); } } diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 025254d4b3..cd1781220e 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -277,7 +277,7 @@ namespace MediaBrowser.Controller.Library /// /// The paths. /// IEnumerable{System.String}. - IEnumerable NormalizeRootPathList(IEnumerable paths); + List NormalizeRootPathList(IEnumerable paths); /// /// Registers the item. diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 76b6d87689..963e4b71b2 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -40,20 +40,7 @@ namespace MediaBrowser.Controller.Library /// Gets the file system children. /// /// The file system children. - public IEnumerable FileSystemChildren - { - get - { - var dict = FileSystemDictionary; - - if (dict == null) - { - return new List(); - } - - return dict.Values; - } - } + public FileSystemMetadata[] FileSystemChildren { get; set; } public LibraryOptions LibraryOptions { get; set; } @@ -62,12 +49,6 @@ namespace MediaBrowser.Controller.Library return LibraryOptions ?? (LibraryOptions = (Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent))); } - /// - /// Gets or sets the file system dictionary. - /// - /// The file system dictionary. - public Dictionary FileSystemDictionary { get; set; } - /// /// Gets or sets the parent. /// @@ -224,13 +205,11 @@ namespace MediaBrowser.Controller.Library throw new ArgumentNullException(); } - if (FileSystemDictionary != null) + foreach (var file in FileSystemChildren) { - FileSystemMetadata entry; - - if (FileSystemDictionary.TryGetValue(path, out entry)) + if (string.Equals(file.FullName, path, StringComparison.Ordinal)) { - return entry; + return file; } } diff --git a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs index 6682942ad8..892a7d5b78 100644 --- a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs @@ -25,6 +25,8 @@ namespace MediaBrowser.Controller.LiveTv /// The id of the channel. public string Id { get; set; } + public string Path { get; set; } + public string TunerChannelId { get; set; } public string CallSign { get; set; } -- cgit v1.2.3 From 2e5db767f349bcbc3ac0b7a24b670ea6c74d84ab Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 20 Aug 2017 17:07:47 -0400 Subject: 3.2.28.2 --- .../Collections/CollectionManager.cs | 23 +++++++++++++++------- .../Updates/InstallationManager.cs | 1 + .../Collections/ICollectionManager.cs | 7 +++++-- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 ++-- SharedVersion.cs | 2 +- 6 files changed, 26 insertions(+), 13 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs index 18823fa9dc..0fc8fdc48c 100644 --- a/Emby.Server.Implementations/Collections/CollectionManager.cs +++ b/Emby.Server.Implementations/Collections/CollectionManager.cs @@ -149,12 +149,17 @@ namespace Emby.Server.Implementations.Collections return GetCollectionsFolder(string.Empty); } - public Task AddToCollection(Guid collectionId, string[] ids) + public Task AddToCollection(Guid collectionId, IEnumerable ids) { return AddToCollection(collectionId, ids, true, new MetadataRefreshOptions(_fileSystem)); } - private async Task AddToCollection(Guid collectionId, string[] ids, bool fireEvent, MetadataRefreshOptions refreshOptions) + public Task AddToCollection(Guid collectionId, IEnumerable ids) + { + return AddToCollection(collectionId, ids.Select(i => i.ToString("N")), true, new MetadataRefreshOptions(_fileSystem)); + } + + private async Task AddToCollection(Guid collectionId, IEnumerable ids, bool fireEvent, MetadataRefreshOptions refreshOptions) { var collection = _libraryManager.GetItemById(collectionId) as BoxSet; @@ -167,9 +172,9 @@ namespace Emby.Server.Implementations.Collections var itemList = new List(); var currentLinkedChildrenIds = collection.GetLinkedChildren().Select(i => i.Id).ToList(); - foreach (var itemId in ids) + foreach (var id in ids) { - var guidId = new Guid(itemId); + var guidId = new Guid(id); var item = _libraryManager.GetItemById(guidId); if (string.IsNullOrWhiteSpace(item.Path)) @@ -214,7 +219,12 @@ namespace Emby.Server.Implementations.Collections } } - public async Task RemoveFromCollection(Guid collectionId, string[] itemIds) + public Task RemoveFromCollection(Guid collectionId, IEnumerable itemIds) + { + return RemoveFromCollection(collectionId, itemIds.Select(i => new Guid(i))); + } + + public async Task RemoveFromCollection(Guid collectionId, IEnumerable itemIds) { var collection = _libraryManager.GetItemById(collectionId) as BoxSet; @@ -226,9 +236,8 @@ namespace Emby.Server.Implementations.Collections var list = new List(); var itemList = new List(); - foreach (var itemId in itemIds) + foreach (var guidId in itemIds) { - var guidId = new Guid(itemId); var childItem = _libraryManager.GetItemById(guidId); var child = collection.LinkedChildren.FirstOrDefault(i => (i.ItemId.HasValue && i.ItemId.Value == guidId) || (childItem != null && string.Equals(childItem.Path, i.Path, StringComparison.OrdinalIgnoreCase))); diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index ab1255b574..4d1e1eaac7 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -290,6 +290,7 @@ namespace Emby.Server.Implementations.Updates protected PackageInfo[] FilterPackages(List packages) { + foreach (var package in packages) { package.versions = package.versions.Where(v => !string.IsNullOrWhiteSpace(v.sourceUrl)) diff --git a/MediaBrowser.Controller/Collections/ICollectionManager.cs b/MediaBrowser.Controller/Collections/ICollectionManager.cs index 0ca7b2e3e5..d89843cc0d 100644 --- a/MediaBrowser.Controller/Collections/ICollectionManager.cs +++ b/MediaBrowser.Controller/Collections/ICollectionManager.cs @@ -36,7 +36,7 @@ namespace MediaBrowser.Controller.Collections /// The collection identifier. /// The item ids. /// Task. - Task AddToCollection(Guid collectionId, string[] itemIds); + Task AddToCollection(Guid collectionId, IEnumerable itemIds); /// /// Removes from collection. @@ -44,7 +44,10 @@ namespace MediaBrowser.Controller.Collections /// The collection identifier. /// The item ids. /// Task. - Task RemoveFromCollection(Guid collectionId, string[] itemIds); + Task RemoveFromCollection(Guid collectionId, IEnumerable itemIds); + + Task AddToCollection(Guid collectionId, IEnumerable itemIds); + Task RemoveFromCollection(Guid collectionId, IEnumerable itemIds); /// /// Collapses the items within box sets. diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index a86735bcac..e4eff48886 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.735 + 3.0.736 Emby.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 3b9c0c83be..f153d3e6b7 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.735 + 3.0.736 Emby.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - + diff --git a/SharedVersion.cs b/SharedVersion.cs index 9e7217a6de..0f504796b3 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.28.1")] +[assembly: AssemblyVersion("3.2.28.2")] -- cgit v1.2.3