diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 6a9b5631b..04395da3c 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -134,18 +134,28 @@ namespace MediaBrowser.Api.UserLibrary private async Task> GetQueryResult(GetItems request, DtoOptions dtoOptions, User user) { var item = string.IsNullOrEmpty(request.ParentId) ? - user == null ? _libraryManager.RootFolder : user.RootFolder : + null : _libraryManager.GetItemById(request.ParentId); if (string.Equals(request.IncludeItemTypes, "Playlist", StringComparison.OrdinalIgnoreCase)) { - //item = user == null ? _libraryManager.RootFolder : user.RootFolder; + if (item == null || user != null) + { + item = _libraryManager.RootFolder.Children.OfType().FirstOrDefault(i => string.Equals(i.GetType().Name, "PlaylistsFolder", StringComparison.OrdinalIgnoreCase)); + } } else if (string.Equals(request.IncludeItemTypes, "BoxSet", StringComparison.OrdinalIgnoreCase)) { item = user == null ? _libraryManager.RootFolder : user.RootFolder; } + if (item == null) + { + item = string.IsNullOrEmpty(request.ParentId) ? + user == null ? _libraryManager.RootFolder : user.RootFolder : + _libraryManager.GetItemById(request.ParentId); + } + // Default list type = children var folder = item as Folder; diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 69a1c24ea..610d4b6f8 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -5,6 +5,7 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.MediaInfo; using System.Collections.Generic; +using System.Globalization; using System.Runtime.Serialization; namespace MediaBrowser.Controller.LiveTv @@ -81,10 +82,10 @@ namespace MediaBrowser.Controller.LiveTv if (!string.IsNullOrEmpty(Number)) { - double.TryParse(Number, out number); + double.TryParse(Number, NumberStyles.Any, CultureInfo.InvariantCulture, out number); } - return number.ToString("000-") + (Name ?? string.Empty); + return number.ToString("00000-") + (Name ?? string.Empty); } [IgnoreDataMember] diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 33aa8bb1c..9267222ad 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -789,8 +789,6 @@ namespace MediaBrowser.Model.Dto /// The home page URL. public string HomePageUrl { get; set; } - public string PlaceOfBirth { get; set; } - /// /// Gets or sets the budget. /// diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs index a6240afe6..ee7dd8b98 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs @@ -60,6 +60,7 @@ namespace MediaBrowser.Model.LiveTv public TunerHostInfo() { IsEnabled = true; + AllowHWTranscoding = true; } } diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index c4922eec5..97d52836d 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -387,8 +387,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun } id += "_" + url.GetMD5().ToString("N"); - var enableLocalBuffer = EnableLocalBuffer(); - var mediaSource = new MediaSourceInfo { Path = url, @@ -422,8 +420,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun BufferMs = 0, Container = "ts", Id = id, - SupportsDirectPlay = !enableLocalBuffer, - SupportsDirectStream = enableLocalBuffer, + SupportsDirectPlay = false, + SupportsDirectStream = true, SupportsTranscoding = true, IsInfiniteStream = true }; @@ -490,11 +488,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun return channelId.StartsWith(ChannelIdPrefix, StringComparison.OrdinalIgnoreCase); } - private bool EnableLocalBuffer() - { - return true; - } - protected override async Task GetChannelStream(TunerHostInfo info, string channelId, string streamId, CancellationToken cancellationToken) { var profile = streamId.Split('_')[0]; @@ -509,19 +502,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun var mediaSource = await GetMediaSource(info, hdhrId, profile).ConfigureAwait(false); - if (EnableLocalBuffer()) - { - var liveStream = new HdHomerunLiveStream(mediaSource, streamId, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost); - liveStream.EnableStreamSharing = true; - return liveStream; - } - else - { - var liveStream = new LiveStream(mediaSource); - liveStream.EnableStreamSharing = true; - //liveStream.EnableStreamSharing = false; - return liveStream; - } + var liveStream = new HdHomerunLiveStream(mediaSource, streamId, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost); + liveStream.EnableStreamSharing = true; + return liveStream; } public async Task Validate(TunerHostInfo info) diff --git a/MediaBrowser.Server.Implementations/Playlists/ManualPlaylistsFolder.cs b/MediaBrowser.Server.Implementations/Playlists/ManualPlaylistsFolder.cs index d9c36cd3b..63dfe20b2 100644 --- a/MediaBrowser.Server.Implementations/Playlists/ManualPlaylistsFolder.cs +++ b/MediaBrowser.Server.Implementations/Playlists/ManualPlaylistsFolder.cs @@ -5,6 +5,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; using CommonIO; +using MediaBrowser.Model.Querying; +using System.Threading.Tasks; namespace MediaBrowser.Server.Implementations.Playlists { @@ -37,6 +39,12 @@ namespace MediaBrowser.Server.Implementations.Playlists { get { return Model.Entities.CollectionType.Playlists; } } + + protected override Task> GetItemsInternal(InternalItemsQuery query) + { + query.Recursive = false; + return base.GetItemsInternal(query); + } } public class PlaylistsDynamicFolder : IVirtualFolderCreator