update latest channel content display

pull/702/head
Luke Pulverenti 10 years ago
parent e765fef271
commit 43ab885530

@ -34,6 +34,9 @@ namespace MediaBrowser.Api
/// <value>The limit.</value>
[ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
public int? Limit { get; set; }
[ApiMember(Name = "SupportsLatestItems", Description = "Optional. Filter by channels that support getting latest items.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")]
public bool? SupportsLatestItems { get; set; }
}
[Route("/Channels/{Id}/Features", "GET", Summary = "Gets features for a channel")]
@ -137,6 +140,9 @@ namespace MediaBrowser.Api
[ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Budget, Chapters, CriticRatingSummary, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
public string Fields { get; set; }
[ApiMember(Name = "ChannelIds", Description = "Optional. Specify one or more channel id's, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
public string ChannelIds { get; set; }
/// <summary>
/// Gets the filters.
/// </summary>
@ -196,6 +202,7 @@ namespace MediaBrowser.Api
Limit = request.Limit,
StartIndex = request.StartIndex,
UserId = request.UserId,
SupportsLatestItems = request.SupportsLatestItems
}, CancellationToken.None).Result;
@ -227,6 +234,7 @@ namespace MediaBrowser.Api
{
Limit = request.Limit,
StartIndex = request.StartIndex,
ChannelIds = (request.ChannelIds ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToArray(),
UserId = request.UserId,
Filters = request.GetFilters().ToArray(),
Fields = request.GetItemFields().ToList()

@ -1,8 +1,11 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Controller.LiveTv
{
@ -115,9 +118,26 @@ namespace MediaBrowser.Controller.LiveTv
return new List<BaseItem>();
}
public IEnumerable<Model.Dto.MediaSourceInfo> GetMediaSources(bool enablePathSubstitution)
public IEnumerable<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution)
{
throw new System.NotImplementedException();
var list = new List<MediaSourceInfo>();
var locationType = LocationType;
var info = new MediaSourceInfo
{
Id = Id.ToString("N"),
Protocol = locationType == LocationType.Remote ? MediaProtocol.Http : MediaProtocol.File,
MediaStreams = new List<MediaStream>(),
Name = Name,
Path = Path,
RunTimeTicks = RunTimeTicks,
Type = MediaSourceType.Default
};
list.Add(info);
return list;
}
}
}

@ -1,7 +1,4 @@
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.MediaInfo;
using System;
using MediaBrowser.Model.MediaInfo;
using System.Collections.Generic;
using System.Linq;
@ -61,37 +58,5 @@ namespace MediaBrowser.MediaEncoding.Encoder
{
return isDvd ? "-probesize 1G -analyzeduration 200M" : string.Empty;
}
/// <summary>
/// Gets the number of audio channels to specify on the command line
/// </summary>
/// <param name="request">The request.</param>
/// <param name="audioStream">The audio stream.</param>
/// <returns>System.Nullable{System.Int32}.</returns>
public static int? GetNumAudioChannelsParam(EncodingOptions request, MediaStream audioStream)
{
if (audioStream != null)
{
var codec = request.AudioCodec ?? string.Empty;
if (audioStream.Channels > 2 && codec.IndexOf("wma", StringComparison.OrdinalIgnoreCase) != -1)
{
// wmav2 currently only supports two channel output
return 2;
}
}
if (request.MaxAudioChannels.HasValue)
{
if (audioStream != null && audioStream.Channels.HasValue)
{
return Math.Min(request.MaxAudioChannels.Value, audioStream.Channels.Value);
}
return request.MaxAudioChannels.Value;
}
return request.AudioChannels;
}
}
}

@ -22,10 +22,20 @@ namespace MediaBrowser.Model.Channels
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports latest items].
/// </summary>
/// <value><c>true</c> if [supports latest items]; otherwise, <c>false</c>.</value>
public bool? SupportsLatestItems { get; set; }
}
public class AllChannelMediaQuery
{
/// <summary>
/// Gets or sets the channel ids.
/// </summary>
/// <value>The channel ids.</value>
public string[] ChannelIds { get; set; }
/// <summary>

@ -107,6 +107,13 @@ namespace MediaBrowser.Server.Implementations.Channels
var channels = _channelEntities.OrderBy(i => i.SortName).ToList();
if (query.SupportsLatestItems.HasValue)
{
var val = query.SupportsLatestItems.Value;
channels = channels.Where(i => (GetChannelProvider(i) is ISupportsLatestMedia) == val)
.ToList();
}
if (user != null)
{
channels = channels.Where(i => GetChannelProvider(i).IsEnabledFor(user.Id.ToString("N")) && i.IsVisible(user))

@ -38,6 +38,7 @@
"LabelEpisode": "Episode",
"LabelSeries": "Series",
"LabelStopping": "Stopping",
"ButtonStop": "Stop",
"LabelCancelled": "(cancelled)",
"LabelFailed": "(failed)",
"LabelAbortedByServerShutdown": "(Aborted by server shutdown)",
@ -170,5 +171,15 @@
"MessageConfirmShutdown": "Are you sure you wish to shutdown Media Browser Server?",
"ButtonUpdateNow": "Update Now",
"NewVersionOfSomethingAvailable": "A new version of {0} is available!",
"VersionXIsAvailableForDownload": "Version {0} is now available for download."
"VersionXIsAvailableForDownload": "Version {0} is now available for download.",
"LabelVersionNumber": "Version {0}",
"LabelPlayMethodTranscoding": "Transcoding",
"LabelPlayMethodDirectStream": "Direct Streaming",
"LabelPlayMethodDirectPlay": "Direct Playing",
"LabelAudioCodec": "Audio: {0}",
"LabelVideoCodec": "Video: {0}",
"LabelRemoteAccessUrl": "Remote access: {0}",
"LabelRunningOnPort": "Running on port {0}.",
"LabelRunningOnPorts": "Running on ports {0} and {1}.",
"HeaderLatestFromChannel": "Latest from {0}"
}
Loading…
Cancel
Save