update playlist content

This commit is contained in:
Luke Pulverenti 2016-10-12 14:23:09 -04:00
parent 2c6fc11dcf
commit 038b11702e
6 changed files with 29 additions and 28 deletions

View File

@ -134,18 +134,28 @@ namespace MediaBrowser.Api.UserLibrary
private async Task<QueryResult<BaseItem>> GetQueryResult(GetItems request, DtoOptions dtoOptions, User user) private async Task<QueryResult<BaseItem>> GetQueryResult(GetItems request, DtoOptions dtoOptions, User user)
{ {
var item = string.IsNullOrEmpty(request.ParentId) ? var item = string.IsNullOrEmpty(request.ParentId) ?
user == null ? _libraryManager.RootFolder : user.RootFolder : null :
_libraryManager.GetItemById(request.ParentId); _libraryManager.GetItemById(request.ParentId);
if (string.Equals(request.IncludeItemTypes, "Playlist", StringComparison.OrdinalIgnoreCase)) 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)) else if (string.Equals(request.IncludeItemTypes, "BoxSet", StringComparison.OrdinalIgnoreCase))
{ {
item = user == null ? _libraryManager.RootFolder : user.RootFolder; 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 // Default list type = children
var folder = item as Folder; var folder = item as Folder;

View File

@ -5,6 +5,7 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.MediaInfo;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Runtime.Serialization; using System.Runtime.Serialization;
namespace MediaBrowser.Controller.LiveTv namespace MediaBrowser.Controller.LiveTv
@ -81,10 +82,10 @@ namespace MediaBrowser.Controller.LiveTv
if (!string.IsNullOrEmpty(Number)) 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] [IgnoreDataMember]

View File

@ -789,8 +789,6 @@ namespace MediaBrowser.Model.Dto
/// <value>The home page URL.</value> /// <value>The home page URL.</value>
public string HomePageUrl { get; set; } public string HomePageUrl { get; set; }
public string PlaceOfBirth { get; set; }
/// <summary> /// <summary>
/// Gets or sets the budget. /// Gets or sets the budget.
/// </summary> /// </summary>

View File

@ -60,6 +60,7 @@ namespace MediaBrowser.Model.LiveTv
public TunerHostInfo() public TunerHostInfo()
{ {
IsEnabled = true; IsEnabled = true;
AllowHWTranscoding = true;
} }
} }

View File

@ -387,8 +387,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
} }
id += "_" + url.GetMD5().ToString("N"); id += "_" + url.GetMD5().ToString("N");
var enableLocalBuffer = EnableLocalBuffer();
var mediaSource = new MediaSourceInfo var mediaSource = new MediaSourceInfo
{ {
Path = url, Path = url,
@ -422,8 +420,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
BufferMs = 0, BufferMs = 0,
Container = "ts", Container = "ts",
Id = id, Id = id,
SupportsDirectPlay = !enableLocalBuffer, SupportsDirectPlay = false,
SupportsDirectStream = enableLocalBuffer, SupportsDirectStream = true,
SupportsTranscoding = true, SupportsTranscoding = true,
IsInfiniteStream = true IsInfiniteStream = true
}; };
@ -490,11 +488,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
return channelId.StartsWith(ChannelIdPrefix, StringComparison.OrdinalIgnoreCase); 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) protected override async Task<LiveStream> GetChannelStream(TunerHostInfo info, string channelId, string streamId, CancellationToken cancellationToken)
{ {
var profile = streamId.Split('_')[0]; 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); 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;
var liveStream = new HdHomerunLiveStream(mediaSource, streamId, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost); return liveStream;
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) public async Task Validate(TunerHostInfo info)

View File

@ -5,6 +5,8 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using CommonIO; using CommonIO;
using MediaBrowser.Model.Querying;
using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.Playlists namespace MediaBrowser.Server.Implementations.Playlists
{ {
@ -37,6 +39,12 @@ namespace MediaBrowser.Server.Implementations.Playlists
{ {
get { return Model.Entities.CollectionType.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 public class PlaylistsDynamicFolder : IVirtualFolderCreator