Merge pull request #2836 from MediaBrowser/dev

Dev
pull/1154/head
Luke 7 years ago committed by GitHub
commit 97c80297cd

@ -149,12 +149,17 @@ namespace Emby.Server.Implementations.Collections
return GetCollectionsFolder(string.Empty); return GetCollectionsFolder(string.Empty);
} }
public Task AddToCollection(Guid collectionId, string[] ids) public Task AddToCollection(Guid collectionId, IEnumerable<string> ids)
{ {
return AddToCollection(collectionId, ids, true, new MetadataRefreshOptions(_fileSystem)); 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<Guid> ids)
{
return AddToCollection(collectionId, ids.Select(i => i.ToString("N")), true, new MetadataRefreshOptions(_fileSystem));
}
private async Task AddToCollection(Guid collectionId, IEnumerable<string> ids, bool fireEvent, MetadataRefreshOptions refreshOptions)
{ {
var collection = _libraryManager.GetItemById(collectionId) as BoxSet; var collection = _libraryManager.GetItemById(collectionId) as BoxSet;
@ -167,9 +172,9 @@ namespace Emby.Server.Implementations.Collections
var itemList = new List<BaseItem>(); var itemList = new List<BaseItem>();
var currentLinkedChildrenIds = collection.GetLinkedChildren().Select(i => i.Id).ToList(); 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); var item = _libraryManager.GetItemById(guidId);
if (string.IsNullOrWhiteSpace(item.Path)) 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<string> itemIds)
{
return RemoveFromCollection(collectionId, itemIds.Select(i => new Guid(i)));
}
public async Task RemoveFromCollection(Guid collectionId, IEnumerable<Guid> itemIds)
{ {
var collection = _libraryManager.GetItemById(collectionId) as BoxSet; var collection = _libraryManager.GetItemById(collectionId) as BoxSet;
@ -226,9 +236,8 @@ namespace Emby.Server.Implementations.Collections
var list = new List<LinkedChild>(); var list = new List<LinkedChild>();
var itemList = new List<BaseItem>(); var itemList = new List<BaseItem>();
foreach (var itemId in itemIds) foreach (var guidId in itemIds)
{ {
var guidId = new Guid(itemId);
var childItem = _libraryManager.GetItemById(guidId); 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))); var child = collection.LinkedChildren.FirstOrDefault(i => (i.ItemId.HasValue && i.ItemId.Value == guidId) || (childItem != null && string.Equals(childItem.Path, i.Path, StringComparison.OrdinalIgnoreCase)));

@ -353,7 +353,7 @@ namespace Emby.Server.Implementations.Library
} }
else else
{ {
if (item is Photo) if (!(item is Video))
{ {
return; return;
} }
@ -599,18 +599,16 @@ namespace Emby.Server.Implementations.Library
// When resolving the root, we need it's grandchildren (children of user views) // When resolving the root, we need it's grandchildren (children of user views)
var flattenFolderDepth = isPhysicalRoot ? 2 : 0; 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 // Need to remove subpaths that may have been resolved from shortcuts
// Example: if \\server\movies exists, then strip out \\server\movies\action // Example: if \\server\movies exists, then strip out \\server\movies\action
if (isPhysicalRoot) if (isPhysicalRoot)
{ {
var paths = NormalizeRootPathList(fileSystemDictionary.Values); files = NormalizeRootPathList(files).ToArray();
fileSystemDictionary = paths.ToDictionary(i => i.FullName);
} }
args.FileSystemDictionary = fileSystemDictionary; args.FileSystemChildren = files;
} }
// Check to see if we should resolve based on our contents // Check to see if we should resolve based on our contents
@ -656,7 +654,7 @@ namespace Emby.Server.Implementations.Library
return false; return false;
} }
public IEnumerable<FileSystemMetadata> NormalizeRootPathList(IEnumerable<FileSystemMetadata> paths) public List<FileSystemMetadata> NormalizeRootPathList(IEnumerable<FileSystemMetadata> paths)
{ {
var originalList = paths.ToList(); var originalList = paths.ToList();

@ -25,12 +25,14 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
private readonly IHttpClient _httpClient; private readonly IHttpClient _httpClient;
private readonly IServerApplicationHost _appHost; private readonly IServerApplicationHost _appHost;
private readonly IEnvironmentInfo _environment; private readonly IEnvironmentInfo _environment;
private readonly INetworkManager _networkManager;
public M3UTunerHost(IServerConfigurationManager config, ILogger logger, IJsonSerializer jsonSerializer, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IHttpClient httpClient, IServerApplicationHost appHost, IEnvironmentInfo environment) : base(config, logger, jsonSerializer, mediaEncoder, fileSystem) public M3UTunerHost(IServerConfigurationManager config, ILogger logger, IJsonSerializer jsonSerializer, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IHttpClient httpClient, IServerApplicationHost appHost, IEnvironmentInfo environment, INetworkManager networkManager) : base(config, logger, jsonSerializer, mediaEncoder, fileSystem)
{ {
_httpClient = httpClient; _httpClient = httpClient;
_appHost = appHost; _appHost = appHost;
_environment = environment; _environment = environment;
_networkManager = networkManager;
} }
public override string Type public override string Type
@ -38,7 +40,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
get { return "m3u"; } get { return "m3u"; }
} }
public string Name public virtual string Name
{ {
get { return "M3U Tuner"; } get { return "M3U Tuner"; }
} }
@ -99,72 +101,83 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
} }
var channels = await GetChannels(info, true, cancellationToken).ConfigureAwait(false); var channels = await GetChannels(info, true, cancellationToken).ConfigureAwait(false);
var m3uchannels = channels.Cast<M3UChannel>(); var channel = channels.FirstOrDefault(c => string.Equals(c.Id, channelId, StringComparison.OrdinalIgnoreCase));
var channel = m3uchannels.FirstOrDefault(c => string.Equals(c.Id, channelId, StringComparison.OrdinalIgnoreCase));
if (channel != null) if (channel != null)
{ {
var path = channel.Path; return new List<MediaSourceInfo> { CreateMediaSourceInfo(info, channel) };
MediaProtocol protocol = MediaProtocol.File; }
if (path.StartsWith("http", StringComparison.OrdinalIgnoreCase)) return new List<MediaSourceInfo>();
{ }
protocol = MediaProtocol.Http;
} protected virtual MediaSourceInfo CreateMediaSourceInfo(TunerHostInfo info, ChannelInfo channel)
else if (path.StartsWith("rtmp", StringComparison.OrdinalIgnoreCase)) {
{ var path = channel.Path;
protocol = MediaProtocol.Rtmp; MediaProtocol protocol = MediaProtocol.File;
} if (path.StartsWith("http", StringComparison.OrdinalIgnoreCase))
else if (path.StartsWith("rtsp", StringComparison.OrdinalIgnoreCase)) {
{ protocol = MediaProtocol.Http;
protocol = MediaProtocol.Rtsp; }
} else if (path.StartsWith("rtmp", StringComparison.OrdinalIgnoreCase))
else if (path.StartsWith("udp", StringComparison.OrdinalIgnoreCase)) {
{ protocol = MediaProtocol.Rtmp;
protocol = MediaProtocol.Udp; }
} else if (path.StartsWith("rtsp", StringComparison.OrdinalIgnoreCase))
else if (path.StartsWith("rtp", StringComparison.OrdinalIgnoreCase)) {
{ protocol = MediaProtocol.Rtsp;
protocol = MediaProtocol.Rtmp; }
} else if (path.StartsWith("udp", StringComparison.OrdinalIgnoreCase))
{
protocol = MediaProtocol.Udp;
}
else if (path.StartsWith("rtp", StringComparison.OrdinalIgnoreCase))
{
protocol = MediaProtocol.Rtmp;
}
Uri uri;
var isRemote = true;
if (Uri.TryCreate(path, UriKind.Absolute, out uri))
{
isRemote = !_networkManager.IsInLocalNetwork(uri.Host);
}
var mediaSource = new MediaSourceInfo var mediaSource = new MediaSourceInfo
{
Path = path,
Protocol = protocol,
MediaStreams = new List<MediaStream>
{ {
Path = channel.Path, new MediaStream
Protocol = protocol,
MediaStreams = new List<MediaStream>
{ {
new MediaStream Type = MediaStreamType.Video,
{ // Set the index to -1 because we don't know the exact index of the video stream within the container
Type = MediaStreamType.Video, Index = -1,
// Set the index to -1 because we don't know the exact index of the video stream within the container IsInterlaced = true
Index = -1,
IsInterlaced = true
},
new MediaStream
{
Type = MediaStreamType.Audio,
// Set the index to -1 because we don't know the exact index of the audio stream within the container
Index = -1
}
}, },
RequiresOpening = true, new MediaStream
RequiresClosing = true, {
RequiresLooping = info.EnableStreamLooping, Type = MediaStreamType.Audio,
// Set the index to -1 because we don't know the exact index of the audio stream within the container
Index = -1
ReadAtNativeFramerate = false, }
},
RequiresOpening = true,
RequiresClosing = true,
RequiresLooping = info.EnableStreamLooping,
Id = channel.Path.GetMD5().ToString("N"), ReadAtNativeFramerate = false,
IsInfiniteStream = true,
IsRemote = true,
IgnoreDts = true Id = channel.Path.GetMD5().ToString("N"),
}; IsInfiniteStream = true,
IsRemote = isRemote,
mediaSource.InferTotalBitrate(); IgnoreDts = true
};
return new List<MediaSourceInfo> { mediaSource }; mediaSource.InferTotalBitrate();
}
return new List<MediaSourceInfo>(); return mediaSource;
} }
protected override Task<bool> IsAvailableInternal(TunerHostInfo tuner, string channelId, CancellationToken cancellationToken) protected override Task<bool> IsAvailableInternal(TunerHostInfo tuner, string channelId, CancellationToken cancellationToken)

@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
_appHost = appHost; _appHost = appHost;
} }
public async Task<List<M3UChannel>> Parse(string url, string channelIdPrefix, string tunerHostId, CancellationToken cancellationToken) public async Task<List<ChannelInfo>> Parse(string url, string channelIdPrefix, string tunerHostId, CancellationToken cancellationToken)
{ {
// Read the file and display it line by line. // Read the file and display it line by line.
using (var reader = new StreamReader(await GetListingsStream(url, cancellationToken).ConfigureAwait(false))) using (var reader = new StreamReader(await GetListingsStream(url, cancellationToken).ConfigureAwait(false)))
@ -41,7 +41,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
} }
} }
public List<M3UChannel> ParseString(string text, string channelIdPrefix, string tunerHostId) public List<ChannelInfo> ParseString(string text, string channelIdPrefix, string tunerHostId)
{ {
// Read the file and display it line by line. // Read the file and display it line by line.
using (var reader = new StringReader(text)) using (var reader = new StringReader(text))
@ -66,9 +66,9 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
} }
const string ExtInfPrefix = "#EXTINF:"; const string ExtInfPrefix = "#EXTINF:";
private List<M3UChannel> GetChannels(TextReader reader, string channelIdPrefix, string tunerHostId) private List<ChannelInfo> GetChannels(TextReader reader, string channelIdPrefix, string tunerHostId)
{ {
var channels = new List<M3UChannel>(); var channels = new List<ChannelInfo>();
string line; string line;
string extInf = ""; string extInf = "";
@ -111,9 +111,9 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
return channels; return channels;
} }
private M3UChannel GetChannelnfo(string extInf, string tunerHostId, string mediaUrl) private ChannelInfo GetChannelnfo(string extInf, string tunerHostId, string mediaUrl)
{ {
var channel = new M3UChannel(); var channel = new ChannelInfo();
channel.TunerHostId = tunerHostId; channel.TunerHostId = tunerHostId;
extInf = extInf.Trim(); extInf = extInf.Trim();
@ -335,10 +335,4 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
return dict; return dict;
} }
} }
public class M3UChannel : ChannelInfo
{
public string Path { get; set; }
}
} }

@ -290,6 +290,7 @@ namespace Emby.Server.Implementations.Updates
protected PackageInfo[] FilterPackages(List<PackageInfo> packages) protected PackageInfo[] FilterPackages(List<PackageInfo> packages)
{ {
foreach (var package in packages) foreach (var package in packages)
{ {
package.versions = package.versions.Where(v => !string.IsNullOrWhiteSpace(v.sourceUrl)) package.versions = package.versions.Where(v => !string.IsNullOrWhiteSpace(v.sourceUrl))
@ -308,9 +309,11 @@ namespace Emby.Server.Implementations.Updates
.OrderByDescending(GetPackageVersion).ToArray(); .OrderByDescending(GetPackageVersion).ToArray();
} }
IEnumerable<PackageInfo> packagesList = packages;
if (!string.IsNullOrWhiteSpace(packageType)) if (!string.IsNullOrWhiteSpace(packageType))
{ {
packages = packages.Where(p => string.Equals(p.type, packageType, StringComparison.OrdinalIgnoreCase)).ToArray(); packagesList = packagesList.Where(p => string.Equals(p.type, packageType, StringComparison.OrdinalIgnoreCase));
} }
// If an app version was supplied, filter the versions for each package to only include supported versions // If an app version was supplied, filter the versions for each package to only include supported versions
@ -323,7 +326,9 @@ namespace Emby.Server.Implementations.Updates
} }
// Remove packages with no versions // Remove packages with no versions
return packages.Where(p => p.versions.Any()).ToArray(); packagesList = packagesList.Where(p => p.versions.Any());
return packagesList.ToArray();
} }
/// <summary> /// <summary>

@ -36,7 +36,7 @@ namespace MediaBrowser.Controller.Collections
/// <param name="collectionId">The collection identifier.</param> /// <param name="collectionId">The collection identifier.</param>
/// <param name="itemIds">The item ids.</param> /// <param name="itemIds">The item ids.</param>
/// <returns>Task.</returns> /// <returns>Task.</returns>
Task AddToCollection(Guid collectionId, string[] itemIds); Task AddToCollection(Guid collectionId, IEnumerable<string> itemIds);
/// <summary> /// <summary>
/// Removes from collection. /// Removes from collection.
@ -44,7 +44,10 @@ namespace MediaBrowser.Controller.Collections
/// <param name="collectionId">The collection identifier.</param> /// <param name="collectionId">The collection identifier.</param>
/// <param name="itemIds">The item ids.</param> /// <param name="itemIds">The item ids.</param>
/// <returns>Task.</returns> /// <returns>Task.</returns>
Task RemoveFromCollection(Guid collectionId, string[] itemIds); Task RemoveFromCollection(Guid collectionId, IEnumerable<string> itemIds);
Task AddToCollection(Guid collectionId, IEnumerable<Guid> itemIds);
Task RemoveFromCollection(Guid collectionId, IEnumerable<Guid> itemIds);
/// <summary> /// <summary>
/// Collapses the items within box sets. /// Collapses the items within box sets.

@ -148,18 +148,16 @@ namespace MediaBrowser.Controller.Entities
// When resolving the root, we need it's grandchildren (children of user views) // When resolving the root, we need it's grandchildren (children of user views)
var flattenFolderDepth = isPhysicalRoot ? 2 : 0; 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 // Need to remove subpaths that may have been resolved from shortcuts
// Example: if \\server\movies exists, then strip out \\server\movies\action // Example: if \\server\movies exists, then strip out \\server\movies\action
if (isPhysicalRoot) if (isPhysicalRoot)
{ {
var paths = LibraryManager.NormalizeRootPathList(fileSystemDictionary.Values); files = LibraryManager.NormalizeRootPathList(files).ToArray();
fileSystemDictionary = paths.ToDictionary(i => i.FullName);
} }
args.FileSystemDictionary = fileSystemDictionary; args.FileSystemChildren = files;
} }
_requiresRefresh = _requiresRefresh || !args.PhysicalLocations.SequenceEqual(PhysicalLocations); _requiresRefresh = _requiresRefresh || !args.PhysicalLocations.SequenceEqual(PhysicalLocations);

@ -292,18 +292,16 @@ namespace MediaBrowser.Controller.Entities
// When resolving the root, we need it's grandchildren (children of user views) // When resolving the root, we need it's grandchildren (children of user views)
var flattenFolderDepth = isPhysicalRoot ? 2 : 0; 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 // Need to remove subpaths that may have been resolved from shortcuts
// Example: if \\server\movies exists, then strip out \\server\movies\action // Example: if \\server\movies exists, then strip out \\server\movies\action
if (isPhysicalRoot) if (isPhysicalRoot)
{ {
var paths = LibraryManager.NormalizeRootPathList(fileSystemDictionary.Values); files = LibraryManager.NormalizeRootPathList(files).ToArray();
fileSystemDictionary = paths.ToDictionary(i => i.FullName);
} }
args.FileSystemDictionary = fileSystemDictionary; args.FileSystemChildren = files;
} }
_requiresRefresh = _requiresRefresh || !args.PhysicalLocations.SequenceEqual(PhysicalLocations); _requiresRefresh = _requiresRefresh || !args.PhysicalLocations.SequenceEqual(PhysicalLocations);

@ -8,7 +8,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;
using MediaBrowser.Controller.Entities.Audio;
namespace MediaBrowser.Controller.Entities.Movies namespace MediaBrowser.Controller.Entities.Movies
{ {
@ -82,20 +81,11 @@ namespace MediaBrowser.Controller.Entities.Movies
protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService) protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
{ {
if (IsLegacyBoxSet)
{
return base.GetNonCachedChildren(directoryService);
}
return new List<BaseItem>(); return new List<BaseItem>();
} }
protected override List<BaseItem> LoadChildren() protected override List<BaseItem> LoadChildren()
{ {
if (IsLegacyBoxSet)
{
return base.LoadChildren();
}
// Save a trip to the database // Save a trip to the database
return new List<BaseItem>(); return new List<BaseItem>();
} }
@ -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) public override bool IsAuthorizedToDelete(User user)
{ {
return true; return true;

@ -3,7 +3,7 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
namespace MediaBrowser.Controller.IO namespace MediaBrowser.Controller.IO
@ -36,7 +36,7 @@ namespace MediaBrowser.Controller.IO
/// <param name="resolveShortcuts">if set to <c>true</c> [resolve shortcuts].</param> /// <param name="resolveShortcuts">if set to <c>true</c> [resolve shortcuts].</param>
/// <returns>Dictionary{System.StringFileSystemInfo}.</returns> /// <returns>Dictionary{System.StringFileSystemInfo}.</returns>
/// <exception cref="System.ArgumentNullException">path</exception> /// <exception cref="System.ArgumentNullException">path</exception>
public static Dictionary<string, FileSystemMetadata> GetFilteredFileSystemEntries(IDirectoryService directoryService, public static FileSystemMetadata[] GetFilteredFileSystemEntries(IDirectoryService directoryService,
string path, string path,
IFileSystem fileSystem, IFileSystem fileSystem,
ILogger logger, ILogger logger,
@ -57,7 +57,7 @@ namespace MediaBrowser.Controller.IO
if (!resolveShortcuts && flattenFolderDepth == 0) if (!resolveShortcuts && flattenFolderDepth == 0)
{ {
return GetFileSystemDictionary(entries); return entries;
} }
var dict = new Dictionary<string, FileSystemMetadata>(StringComparer.OrdinalIgnoreCase); var dict = new Dictionary<string, FileSystemMetadata>(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)) 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 else
@ -107,7 +107,7 @@ namespace MediaBrowser.Controller.IO
} }
} }
return dict; return dict.Values.ToArray();
} }
} }

@ -277,7 +277,7 @@ namespace MediaBrowser.Controller.Library
/// </summary> /// </summary>
/// <param name="paths">The paths.</param> /// <param name="paths">The paths.</param>
/// <returns>IEnumerable{System.String}.</returns> /// <returns>IEnumerable{System.String}.</returns>
IEnumerable<FileSystemMetadata> NormalizeRootPathList(IEnumerable<FileSystemMetadata> paths); List<FileSystemMetadata> NormalizeRootPathList(IEnumerable<FileSystemMetadata> paths);
/// <summary> /// <summary>
/// Registers the item. /// Registers the item.

@ -40,20 +40,7 @@ namespace MediaBrowser.Controller.Library
/// Gets the file system children. /// Gets the file system children.
/// </summary> /// </summary>
/// <value>The file system children.</value> /// <value>The file system children.</value>
public IEnumerable<FileSystemMetadata> FileSystemChildren public FileSystemMetadata[] FileSystemChildren { get; set; }
{
get
{
var dict = FileSystemDictionary;
if (dict == null)
{
return new List<FileSystemMetadata>();
}
return dict.Values;
}
}
public LibraryOptions LibraryOptions { 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))); return LibraryOptions ?? (LibraryOptions = (Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent)));
} }
/// <summary>
/// Gets or sets the file system dictionary.
/// </summary>
/// <value>The file system dictionary.</value>
public Dictionary<string, FileSystemMetadata> FileSystemDictionary { get; set; }
/// <summary> /// <summary>
/// Gets or sets the parent. /// Gets or sets the parent.
/// </summary> /// </summary>
@ -224,13 +205,11 @@ namespace MediaBrowser.Controller.Library
throw new ArgumentNullException(); throw new ArgumentNullException();
} }
if (FileSystemDictionary != null) foreach (var file in FileSystemChildren)
{ {
FileSystemMetadata entry; if (string.Equals(file.FullName, path, StringComparison.Ordinal))
if (FileSystemDictionary.TryGetValue(path, out entry))
{ {
return entry; return file;
} }
} }

@ -25,6 +25,8 @@ namespace MediaBrowser.Controller.LiveTv
/// <value>The id of the channel.</value> /// <value>The id of the channel.</value>
public string Id { get; set; } public string Id { get; set; }
public string Path { get; set; }
public string TunerChannelId { get; set; } public string TunerChannelId { get; set; }
public string CallSign { get; set; } public string CallSign { get; set; }

@ -48,6 +48,7 @@ namespace MediaBrowser.Model.LiveTv
public bool AllowHWTranscoding { get; set; } public bool AllowHWTranscoding { get; set; }
public bool EnableStreamLooping { get; set; } public bool EnableStreamLooping { get; set; }
public bool EnableNewHdhrChannelIds { get; set; } public bool EnableNewHdhrChannelIds { get; set; }
public string Source { get; set; }
public TunerHostInfo() public TunerHostInfo()
{ {

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.735</version> <version>3.0.736</version>
<title>Emby.Common</title> <title>Emby.Common</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.735</version> <version>3.0.736</version>
<title>Emby.Server.Core</title> <title>Emby.Server.Core</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description> <description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright> <copyright>Copyright © Emby 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.735" /> <dependency id="MediaBrowser.Common" version="3.0.736" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.28.1")] [assembly: AssemblyVersion("3.2.28.2")]

Loading…
Cancel
Save