commit
a6f0ceb78b
|
@ -134,18 +134,28 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
private async Task<QueryResult<BaseItem>> 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<Folder>().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;
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -789,8 +789,6 @@ namespace MediaBrowser.Model.Dto
|
|||
/// <value>The home page URL.</value>
|
||||
public string HomePageUrl { get; set; }
|
||||
|
||||
public string PlaceOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the budget.
|
||||
/// </summary>
|
||||
|
|
|
@ -60,6 +60,7 @@ namespace MediaBrowser.Model.LiveTv
|
|||
public TunerHostInfo()
|
||||
{
|
||||
IsEnabled = true;
|
||||
AllowHWTranscoding = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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<LiveStream> GetChannelStream(TunerHostInfo info, string channelId, string streamId, CancellationToken cancellationToken)
|
||||
{
|
||||
var profile = streamId.Split('_')[0];
|
||||
|
@ -509,20 +502,10 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task Validate(TunerHostInfo info)
|
||||
{
|
||||
|
|
|
@ -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<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||
{
|
||||
query.Recursive = false;
|
||||
return base.GetItemsInternal(query);
|
||||
}
|
||||
}
|
||||
|
||||
public class PlaylistsDynamicFolder : IVirtualFolderCreator
|
||||
|
|
Loading…
Reference in New Issue
Block a user