From 977d9c7f3b92154642046f06c8ac2c4dfb31d35e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 20 Nov 2013 12:10:02 -0500 Subject: improve episode sorting with embedded specials --- .../Sorting/AiredEpisodeOrderComparer.cs | 134 +++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs (limited to 'MediaBrowser.Server.Implementations/Sorting') diff --git a/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs new file mode 100644 index 0000000000..cec9743bae --- /dev/null +++ b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs @@ -0,0 +1,134 @@ +using System; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.TV; +using MediaBrowser.Controller.Sorting; +using MediaBrowser.Model.Querying; + +namespace MediaBrowser.Server.Implementations.Sorting +{ + class AiredEpisodeOrderComparer : IBaseItemComparer + { + /// + /// Compares the specified x. + /// + /// The x. + /// The y. + /// System.Int32. + public int Compare(BaseItem x, BaseItem y) + { + var val = DateTime.Compare(x.PremiereDate ?? DateTime.MinValue, y.PremiereDate ?? DateTime.MinValue); + + if (val != 0) + { + return val; + } + + var episode1 = x as Episode; + var episode2 = y as Episode; + + if (episode1 == null) + { + if (episode2 == null) + { + return 0; + } + + return 1; + } + + if (episode2 == null) + { + return -1; + } + + return Compare(episode1, episode2); + } + + private int Compare(Episode x, Episode y) + { + var isXSpecial = (x.ParentIndexNumber ?? -1) == 0; + var isYSpecial = (y.ParentIndexNumber ?? -1) == 0; + + if (isXSpecial && isYSpecial) + { + return CompareSpecials(x, y); + } + + if (!isXSpecial && !isYSpecial) + { + return CompareEpisodes(x, y); + } + + if (!isXSpecial && isYSpecial) + { + return CompareEpisodeToSpecial(x, y); + } + + return CompareEpisodeToSpecial(x, y) * -1; + } + + private int CompareEpisodeToSpecial(Episode x, Episode y) + { + var xSeason = x.ParentIndexNumber ?? -1; + var ySeason = y.AirsAfterSeasonNumber ?? y.AirsBeforeSeasonNumber ?? -1; + + if (xSeason != ySeason) + { + return xSeason.CompareTo(ySeason); + } + + // Now we know they have the same season + + // Compare episode number + + // Add 1 to to non-specials to account for AirsBeforeEpisodeNumber + var xEpisode = (x.IndexNumber ?? 0) * 1000 + 1; + var yEpisode = (y.AirsBeforeEpisodeNumber ?? 0) * 1000; + + return xEpisode.CompareTo(yEpisode); + } + + private int CompareSpecials(Episode x, Episode y) + { + return GetSpecialCompareValue(x).CompareTo(GetSpecialCompareValue(y)); + } + + private int GetSpecialCompareValue(Episode item) + { + // First sort by season number + // Since there are three sort orders, pad with 9 digits (3 for each, figure 1000 episode buffer should be enough) + var val = (item.AirsBeforeSeasonNumber ?? item.AirsAfterSeasonNumber ?? 0) * 1000000000; + + // Second sort order is if it airs after the season + if (item.AirsAfterSeasonNumber.HasValue) + { + val += 1000000; + } + + // Third level is the episode number + val += (item.AirsBeforeEpisodeNumber ?? 0) * 1000; + + // Finally, if that's still the same, last resort is the special number itself + val += item.IndexNumber ?? 0; + + return val; + } + + private int CompareEpisodes(Episode x, Episode y) + { + var xValue = ((x.ParentIndexNumber ?? -1) * 1000) + (x.IndexNumber ?? -1); + var yValue = ((y.ParentIndexNumber ?? -1) * 1000) + (y.IndexNumber ?? -1); + + return xValue.CompareTo(yValue); + } + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get { return ItemSortBy.AiredEpisodeOrder; } + } + } +} -- cgit v1.2.3 From 71514af96be684dcbf432c5aca37712bbd773740 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 20 Nov 2013 16:08:12 -0500 Subject: render channels page --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 55 +++++++++++++++------- .../Sorting/AiredEpisodeOrderComparer.cs | 15 +++--- 2 files changed, 48 insertions(+), 22 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Sorting') diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 4239869a52..3936014c5c 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -206,7 +206,7 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "AiredDuringSeason", Description = "Gets all episodes that aired during a season, including specials.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] public int? AiredDuringSeason { get; set; } - + [ApiMember(Name = "MinPremiereDate", Description = "Optional. The minimum premiere date. Format = yyyyMMddHHmmss", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")] public string MinPremiereDate { get; set; } @@ -1012,21 +1012,7 @@ namespace MediaBrowser.Api.UserLibrary if (request.AiredDuringSeason.HasValue) { - var val = request.AiredDuringSeason.Value; - - items = items.Where(i => - { - var episode = i as Episode; - - if (episode != null) - { - var seasonNumber = episode.AirsAfterSeasonNumber ?? episode.AirsBeforeSeasonNumber ?? episode.ParentIndexNumber; - - return episode.PremiereDate.HasValue && seasonNumber.HasValue && seasonNumber.Value == val; - } - - return false; - }); + items = FilterByAiredDuringSeason(items, request.AiredDuringSeason.Value); } if (!string.IsNullOrEmpty(request.MinPremiereDate)) @@ -1046,6 +1032,43 @@ namespace MediaBrowser.Api.UserLibrary return items; } + private IEnumerable FilterByAiredDuringSeason(IEnumerable items, int seasonNumber) + { + var episodes = items.OfType().ToList(); + + // We can only enforce the air date requirement if the episodes have air dates + var enforceAirDate = episodes.Any(i => i.PremiereDate.HasValue); + + return episodes.Where(i => + { + var episode = i; + + if (episode != null) + { + var currentSeasonNumber = episode.AirsAfterSeasonNumber ?? episode.AirsBeforeSeasonNumber ?? episode.ParentIndexNumber; + + // If this produced nothing, try and get it from the parent folder + if (!currentSeasonNumber.HasValue) + { + var season = episode.Parent as Season; + if (season != null) + { + currentSeasonNumber = season.IndexNumber; + } + } + + if (enforceAirDate && !episode.PremiereDate.HasValue) + { + return false; + } + + return currentSeasonNumber.HasValue && currentSeasonNumber.Value == seasonNumber; + } + + return false; + }); + } + /// /// Determines whether the specified item has image. /// diff --git a/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs index cec9743bae..23334aa412 100644 --- a/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs @@ -1,8 +1,8 @@ -using System; -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Querying; +using System; namespace MediaBrowser.Server.Implementations.Sorting { @@ -16,11 +16,14 @@ namespace MediaBrowser.Server.Implementations.Sorting /// System.Int32. public int Compare(BaseItem x, BaseItem y) { - var val = DateTime.Compare(x.PremiereDate ?? DateTime.MinValue, y.PremiereDate ?? DateTime.MinValue); - - if (val != 0) + if (x.PremiereDate.HasValue && y.PremiereDate.HasValue) { - return val; + var val = DateTime.Compare(x.PremiereDate.Value, y.PremiereDate.Value); + + if (val != 0) + { + return val; + } } var episode1 = x as Episode; -- cgit v1.2.3 From e3cf3d73f105c1a5e3e1583adf2cd082cf9180b2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 23 Nov 2013 15:01:09 -0500 Subject: improve embedding of specials --- MediaBrowser.Api/Images/ImageService.cs | 2 +- MediaBrowser.Controller/Entities/TV/Episode.cs | 2 +- .../Sorting/AiredEpisodeOrderComparer.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Sorting') diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 632230be3d..4fd8fbfd19 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -484,7 +484,7 @@ namespace MediaBrowser.Api.Images Height = Convert.ToInt32(size.Height) }; } - catch (IOException ex) + catch (Exception ex) { Logger.ErrorException("Error getting image information for {0}", ex, path); diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 95ea10ea1e..f090ce2a27 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -55,7 +55,7 @@ namespace MediaBrowser.Controller.Entities.TV { get { - return AirsBeforeSeasonNumber ?? AirsAfterSeasonNumber ?? PhysicalSeasonNumber; + return AirsAfterSeasonNumber ?? AirsBeforeSeasonNumber ?? PhysicalSeasonNumber; } } diff --git a/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs index 23334aa412..bdc343dea6 100644 --- a/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs @@ -100,7 +100,7 @@ namespace MediaBrowser.Server.Implementations.Sorting { // First sort by season number // Since there are three sort orders, pad with 9 digits (3 for each, figure 1000 episode buffer should be enough) - var val = (item.AirsBeforeSeasonNumber ?? item.AirsAfterSeasonNumber ?? 0) * 1000000000; + var val = (item.AirsAfterSeasonNumber ?? item.AirsBeforeSeasonNumber ?? 0) * 1000000000; // Second sort order is if it airs after the season if (item.AirsAfterSeasonNumber.HasValue) -- cgit v1.2.3 From 1e9ffb83cf060bf2f755cd5a62782209eaaa6a4b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 27 Nov 2013 14:04:19 -0500 Subject: added live tv timers page --- MediaBrowser.Api/Images/ImageService.cs | 55 +++++++++++++++ MediaBrowser.Api/LiveTv/LiveTvService.cs | 23 +++++++ MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 8 +++ .../MediaBrowser.Model.Portable.csproj | 3 + .../MediaBrowser.Model.net35.csproj | 3 + MediaBrowser.Model/LiveTv/RecordingQuery.cs | 15 ++++ MediaBrowser.Model/LiveTv/TimerInfoDto.cs | 72 ++++++++++++++++++++ MediaBrowser.Model/MediaBrowser.Model.csproj | 1 + .../LiveTv/LiveTvManager.cs | 62 ++++++++++++++++- .../Sorting/AiredEpisodeOrderComparer.cs | 19 +++--- .../MediaBrowser.ServerApplication.csproj | 6 +- MediaBrowser.ServerApplication/packages.config | 2 +- MediaBrowser.WebDashboard/Api/DashboardService.cs | 3 +- MediaBrowser.WebDashboard/ApiClient.js | 79 ++++++++++++++++++++-- .../MediaBrowser.WebDashboard.csproj | 72 ++++++++++---------- MediaBrowser.WebDashboard/packages.config | 2 +- 16 files changed, 368 insertions(+), 57 deletions(-) create mode 100644 MediaBrowser.Model/LiveTv/TimerInfoDto.cs (limited to 'MediaBrowser.Server.Implementations/Sorting') diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 9112518b86..27881d12ba 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -269,6 +269,19 @@ namespace MediaBrowser.Api.Images public Guid Id { get; set; } } + [Route("/LiveTv/Channels/{Id}/Images/{Type}", "DELETE")] + [Route("/LiveTv/Channels/{Id}/Images/{Type}/{Index}", "DELETE")] + [Api(Description = "Deletes an item image")] + public class DeleteChannelImage : DeleteImageRequest, IReturnVoid + { + /// + /// Gets or sets the id. + /// + /// The id. + [ApiMember(Name = "Id", Description = "Channel Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] + public string Id { get; set; } + } + /// /// Class PostUserImage /// @@ -344,6 +357,25 @@ namespace MediaBrowser.Api.Images public Stream RequestStream { get; set; } } + [Route("/LiveTv/Channels/{Id}/Images/{Type}", "POST")] + [Route("/LiveTv/Channels/{Id}/Images/{Type}/{Index}", "POST")] + [Api(Description = "Posts an item image")] + public class PostChannelImage : DeleteImageRequest, IRequiresRequestStream, IReturnVoid + { + /// + /// Gets or sets the id. + /// + /// The id. + [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] + public string Id { get; set; } + + /// + /// The raw Http Request Input Stream + /// + /// The request stream. + public Stream RequestStream { get; set; } + } + /// /// Class ImageService /// @@ -622,6 +654,20 @@ namespace MediaBrowser.Api.Images Task.WaitAll(task); } + public void Post(PostChannelImage request) + { + var pathInfo = PathInfo.Parse(RequestContext.PathInfo); + var id = pathInfo.GetArgumentValue(2); + + request.Type = (ImageType)Enum.Parse(typeof(ImageType), pathInfo.GetArgumentValue(4), true); + + var item = _liveTv.GetChannel(id); + + var task = PostImage(item, request.RequestStream, request.Type, RequestContext.ContentType); + + Task.WaitAll(task); + } + /// /// Deletes the specified request. /// @@ -648,6 +694,15 @@ namespace MediaBrowser.Api.Images Task.WaitAll(task); } + public void Delete(DeleteChannelImage request) + { + var item = _liveTv.GetChannel(request.Id); + + var task = item.DeleteImage(request.Type, request.Index); + + Task.WaitAll(task); + } + /// /// Deletes the specified request. /// diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index db50f463d4..2961c920f8 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -57,6 +57,17 @@ namespace MediaBrowser.Api.LiveTv public string ChannelId { get; set; } } + [Route("/LiveTv/Timers", "GET")] + [Api(Description = "Gets live tv timers")] + public class GetTimers : IReturn> + { + [ApiMember(Name = "ServiceName", Description = "Optional filter by service.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public string ServiceName { get; set; } + + [ApiMember(Name = "ChannelId", Description = "Optional filter by channel id.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public string ChannelId { get; set; } + } + [Route("/LiveTv/Programs", "GET")] [Api(Description = "Gets available live tv epgs..")] public class GetPrograms : IReturn> @@ -153,5 +164,17 @@ namespace MediaBrowser.Api.LiveTv return ToOptimizedResult(result); } + + public object Get(GetTimers request) + { + var result = _liveTvManager.GetTimers(new TimerQuery + { + ChannelId = request.ChannelId, + ServiceName = request.ServiceName + + }, CancellationToken.None).Result; + + return ToOptimizedResult(result); + } } } \ No newline at end of file diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index 91634b4bfb..7938c38ec9 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -45,6 +45,14 @@ namespace MediaBrowser.Controller.LiveTv /// QueryResult{RecordingInfoDto}. Task> GetRecordings(RecordingQuery query, CancellationToken cancellationToken); + /// + /// Gets the timers. + /// + /// The query. + /// The cancellation token. + /// Task{QueryResult{TimerInfoDto}}. + Task> GetTimers(TimerQuery query, CancellationToken cancellationToken); + /// /// Gets the channel. /// diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj index 6962cb470b..67888aa46d 100644 --- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj +++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj @@ -251,6 +251,9 @@ LiveTv\RecordingStatus.cs + + LiveTv\TimerInfoDto.cs + Logging\ILogger.cs diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj index 0bf2684bfd..cfe4a5462f 100644 --- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj +++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj @@ -238,6 +238,9 @@ LiveTv\RecordingStatus.cs + + LiveTv\TimerInfoDto.cs + Logging\ILogger.cs diff --git a/MediaBrowser.Model/LiveTv/RecordingQuery.cs b/MediaBrowser.Model/LiveTv/RecordingQuery.cs index 8c83b0fcbd..0820c7785e 100644 --- a/MediaBrowser.Model/LiveTv/RecordingQuery.cs +++ b/MediaBrowser.Model/LiveTv/RecordingQuery.cs @@ -17,4 +17,19 @@ /// The name of the service. public string ServiceName { get; set; } } + + public class TimerQuery + { + /// + /// Gets or sets the channel identifier. + /// + /// The channel identifier. + public string ChannelId { get; set; } + + /// + /// Gets or sets the name of the service. + /// + /// The name of the service. + public string ServiceName { get; set; } + } } diff --git a/MediaBrowser.Model/LiveTv/TimerInfoDto.cs b/MediaBrowser.Model/LiveTv/TimerInfoDto.cs new file mode 100644 index 0000000000..6a8339031a --- /dev/null +++ b/MediaBrowser.Model/LiveTv/TimerInfoDto.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Model.LiveTv +{ + public class TimerInfoDto + { + /// + /// Id of the recording. + /// + public string Id { get; set; } + + /// + /// Gets or sets the external identifier. + /// + /// The external identifier. + public string ExternalId { get; set; } + + /// + /// ChannelId of the recording. + /// + public string ChannelId { get; set; } + + /// + /// ChannelName of the recording. + /// + public string ChannelName { get; set; } + + /// + /// Name of the recording. + /// + public string Name { get; set; } + + /// + /// Description of the recording. + /// + public string Description { get; set; } + + /// + /// The start date of the recording, in UTC. + /// + public DateTime StartDate { get; set; } + + /// + /// The end date of the recording, in UTC. + /// + public DateTime EndDate { get; set; } + + /// + /// Gets or sets the status. + /// + /// The status. + public RecordingStatus Status { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is recurring. + /// + /// true if this instance is recurring; otherwise, false. + public bool IsRecurring { get; set; } + + /// + /// Gets or sets the recurring days. + /// + /// The recurring days. + public List RecurringDays { get; set; } + + public TimerInfoDto() + { + RecurringDays = new List(); + } + } +} diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 1cbdc60efa..103e583aed 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -66,6 +66,7 @@ + diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 12241876a1..00ac83f15c 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -417,7 +417,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv .ToList(); } - var returnArray = list.ToArray(); + var returnArray = list.OrderByDescending(i => i.StartDate) + .ToArray(); return new QueryResult { @@ -451,5 +452,64 @@ namespace MediaBrowser.Server.Implementations.LiveTv { throw new NotImplementedException(); } + + public async Task> GetTimers(TimerQuery query, CancellationToken cancellationToken) + { + var list = new List(); + + foreach (var service in GetServices(query.ServiceName, query.ChannelId)) + { + var timers = await GetTimers(service, cancellationToken).ConfigureAwait(false); + + list.AddRange(timers); + } + + if (!string.IsNullOrEmpty(query.ChannelId)) + { + list = list.Where(i => string.Equals(i.ChannelId, query.ChannelId)) + .ToList(); + } + + var returnArray = list.OrderByDescending(i => i.StartDate) + .ToArray(); + + return new QueryResult + { + Items = returnArray, + TotalRecordCount = returnArray.Length + }; + } + + private async Task> GetTimers(ILiveTvService service, CancellationToken cancellationToken) + { + var timers = await service.GetTimersAsync(cancellationToken).ConfigureAwait(false); + + return timers.Select(i => GetTimerInfoDto(i, service)); + } + + private TimerInfoDto GetTimerInfoDto(TimerInfo info, ILiveTvService service) + { + var id = service.Name + info.ChannelId + info.Id; + id = id.GetMD5().ToString("N"); + + var dto = new TimerInfoDto + { + ChannelName = info.ChannelName, + Description = info.Description, + EndDate = info.EndDate, + Name = info.Name, + StartDate = info.StartDate, + Id = id, + ExternalId = info.Id, + ChannelId = GetInternalChannelId(service.Name, info.ChannelId).ToString("N"), + Status = info.Status, + IsRecurring = info.IsRecurring, + RecurringDays = info.RecurringDays + }; + + return dto; + } + + } } diff --git a/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs index bdc343dea6..76971342a0 100644 --- a/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs @@ -22,7 +22,7 @@ namespace MediaBrowser.Server.Implementations.Sorting if (val != 0) { - return val; + //return val; } } @@ -49,8 +49,8 @@ namespace MediaBrowser.Server.Implementations.Sorting private int Compare(Episode x, Episode y) { - var isXSpecial = (x.ParentIndexNumber ?? -1) == 0; - var isYSpecial = (y.ParentIndexNumber ?? -1) == 0; + var isXSpecial = (x.PhysicalSeasonNumber ?? -1) == 0; + var isYSpecial = (y.PhysicalSeasonNumber ?? -1) == 0; if (isXSpecial && isYSpecial) { @@ -67,12 +67,12 @@ namespace MediaBrowser.Server.Implementations.Sorting return CompareEpisodeToSpecial(x, y); } - return CompareEpisodeToSpecial(x, y) * -1; + return CompareEpisodeToSpecial(y, x) * -1; } private int CompareEpisodeToSpecial(Episode x, Episode y) { - var xSeason = x.ParentIndexNumber ?? -1; + var xSeason = x.PhysicalSeasonNumber ?? -1; var ySeason = y.AirsAfterSeasonNumber ?? y.AirsBeforeSeasonNumber ?? -1; if (xSeason != ySeason) @@ -85,8 +85,9 @@ namespace MediaBrowser.Server.Implementations.Sorting // Compare episode number // Add 1 to to non-specials to account for AirsBeforeEpisodeNumber - var xEpisode = (x.IndexNumber ?? 0) * 1000 + 1; - var yEpisode = (y.AirsBeforeEpisodeNumber ?? 0) * 1000; + var xEpisode = x.IndexNumber ?? -1; + xEpisode++; + var yEpisode = y.AirsBeforeEpisodeNumber ?? 10000; return xEpisode.CompareTo(yEpisode); } @@ -119,8 +120,8 @@ namespace MediaBrowser.Server.Implementations.Sorting private int CompareEpisodes(Episode x, Episode y) { - var xValue = ((x.ParentIndexNumber ?? -1) * 1000) + (x.IndexNumber ?? -1); - var yValue = ((y.ParentIndexNumber ?? -1) * 1000) + (y.IndexNumber ?? -1); + var xValue = ((x.PhysicalSeasonNumber ?? -1) * 1000) + (x.IndexNumber ?? -1); + var yValue = ((y.PhysicalSeasonNumber ?? -1) * 1000) + (y.IndexNumber ?? -1); return xValue.CompareTo(yValue); } diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index f24283e70d..cfacffe087 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -119,9 +119,9 @@ ..\packages\Hardcodet.Wpf.TaskbarNotification.1.0.4.0\lib\net40\Hardcodet.Wpf.TaskbarNotification.dll - + False - ..\packages\MediaBrowser.IsoMounting.3.0.61\lib\net45\MediaBrowser.IsoMounter.dll + ..\packages\MediaBrowser.IsoMounting.3.0.65\lib\net45\MediaBrowser.IsoMounter.dll False @@ -129,7 +129,7 @@ False - ..\packages\MediaBrowser.IsoMounting.3.0.61\lib\net45\pfmclrapi.dll + ..\packages\MediaBrowser.IsoMounting.3.0.65\lib\net45\pfmclrapi.dll False diff --git a/MediaBrowser.ServerApplication/packages.config b/MediaBrowser.ServerApplication/packages.config index 0893a1b38a..e01ca1f672 100644 --- a/MediaBrowser.ServerApplication/packages.config +++ b/MediaBrowser.ServerApplication/packages.config @@ -1,7 +1,7 @@  - + diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 2b74eebb0c..69f05631f3 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -430,7 +430,7 @@ namespace MediaBrowser.WebDashboard.Api "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js", "http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js", "scripts/all.js" + versionString, - "thirdparty/jstree1.0fix2/jquery.jstree.js" + "thirdparty/jstree1.0fix3/jquery.jstree.js" }; var tags = files.Select(s => string.Format("", s)).ToArray(); @@ -483,6 +483,7 @@ namespace MediaBrowser.WebDashboard.Api "livetvchannels.js", "livetvguide.js", "livetvrecordings.js", + "livetvtimers.js", "loginpage.js", "logpage.js", "medialibrarypage.js", diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js index e63eb4d2b1..69f3f020cf 100644 --- a/MediaBrowser.WebDashboard/ApiClient.js +++ b/MediaBrowser.WebDashboard/ApiClient.js @@ -380,7 +380,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi self.getLiveTvServices = function (options) { - var url = self.getUrl("/LiveTv/Services", options || {}); + var url = self.getUrl("LiveTv/Services", options || {}); return self.ajax({ type: "GET", @@ -395,7 +395,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi throw new Error("null id"); } - var url = self.getUrl("/LiveTv/Channels/" + id); + var url = self.getUrl("LiveTv/Channels/" + id); return self.ajax({ type: "GET", @@ -406,7 +406,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi self.getLiveTvChannels = function (options) { - var url = self.getUrl("/LiveTv/Channels", options || {}); + var url = self.getUrl("LiveTv/Channels", options || {}); return self.ajax({ type: "GET", @@ -417,7 +417,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi self.getLiveTvPrograms = function (options) { - var url = self.getUrl("/LiveTv/Programs", options || {}); + var url = self.getUrl("LiveTv/Programs", options || {}); return self.ajax({ type: "GET", @@ -428,7 +428,76 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi self.getLiveTvRecordings = function (options) { - var url = self.getUrl("/LiveTv/Recordings", options || {}); + var url = self.getUrl("LiveTv/Recordings", options || {}); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + + self.getLiveTvRecording = function (id) { + + if (!id) { + throw new Error("null id"); + } + + var url = self.getUrl("LiveTv/Recordings/" + id); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + + self.deleteLiveTvRecording = function (id) { + + if (!id) { + throw new Error("null id"); + } + + var url = self.getUrl("LiveTv/Recordings/" + id); + + return self.ajax({ + type: "DELETE", + url: url + }); + }; + + self.cancelLiveTvTimer = function (id) { + + if (!id) { + throw new Error("null id"); + } + + var url = self.getUrl("LiveTv/Timers/" + id); + + return self.ajax({ + type: "DELETE", + url: url + }); + }; + + self.getLiveTvTimers = function (options) { + + var url = self.getUrl("LiveTv/Timers", options || {}); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + + self.getLiveTvTimer = function (id) { + + if (!id) { + throw new Error("null id"); + } + + var url = self.getUrl("LiveTv/Timers/" + id); return self.ajax({ type: "GET", diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 54e70cb9ab..5585e0db5e 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -80,9 +80,18 @@ + + PreserveNewest + + + PreserveNewest + PreserveNewest + + PreserveNewest + PreserveNewest @@ -281,18 +290,6 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - PreserveNewest @@ -350,6 +347,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -595,76 +595,76 @@ PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index ab57a48b15..35511052f4 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file -- cgit v1.2.3 From 317f41107091a4334b9133a21e570d627a2d808a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 2 Dec 2013 11:16:03 -0500 Subject: Added IHasBudget --- MediaBrowser.Api/ItemUpdateService.cs | 8 ++++++-- MediaBrowser.Controller/Entities/BaseItem.cs | 12 ------------ MediaBrowser.Controller/Entities/IHasBudget.cs | 18 ++++++++++++++++++ MediaBrowser.Controller/Entities/Movies/Movie.cs | 14 +++++++++++++- MediaBrowser.Controller/Entities/MusicVideo.cs | 14 +++++++++++++- MediaBrowser.Controller/Entities/Trailer.cs | 14 +++++++++++++- .../MediaBrowser.Controller.csproj | 1 + .../Providers/BaseItemXmlParser.cs | 20 ++++++++++++++------ MediaBrowser.Providers/Movies/MovieDbProvider.cs | 8 ++++++-- MediaBrowser.Providers/Savers/XmlSaverHelpers.cs | 16 ++++++++++------ .../Dto/DtoService.cs | 16 ++++++++++------ .../Sorting/BudgetComparer.cs | 7 ++++++- .../Sorting/RevenueComparer.cs | 7 ++++++- 13 files changed, 116 insertions(+), 39 deletions(-) create mode 100644 MediaBrowser.Controller/Entities/IHasBudget.cs (limited to 'MediaBrowser.Server.Implementations/Sorting') diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index 48d292bbc2..90fe111292 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -248,8 +248,12 @@ namespace MediaBrowser.Api item.ForcedSortName = request.SortName; } - item.Budget = request.Budget; - item.Revenue = request.Revenue; + var hasBudget = item as IHasBudget; + if (hasBudget != null) + { + hasBudget.Budget = request.Budget; + hasBudget.Revenue = request.Revenue; + } var hasCriticRating = item as IHasCriticRating; if (hasCriticRating != null) diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 25da18fcac..f5cdaa9880 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -86,24 +86,12 @@ namespace MediaBrowser.Controller.Entities /// The id. public Guid Id { get; set; } - /// - /// Gets or sets the budget. - /// - /// The budget. - public double? Budget { get; set; } - /// /// Gets or sets the taglines. /// /// The taglines. public List Taglines { get; set; } - /// - /// Gets or sets the revenue. - /// - /// The revenue. - public double? Revenue { get; set; } - /// /// Gets or sets the trailer URL. /// diff --git a/MediaBrowser.Controller/Entities/IHasBudget.cs b/MediaBrowser.Controller/Entities/IHasBudget.cs new file mode 100644 index 0000000000..f697715c16 --- /dev/null +++ b/MediaBrowser.Controller/Entities/IHasBudget.cs @@ -0,0 +1,18 @@ + +namespace MediaBrowser.Controller.Entities +{ + public interface IHasBudget + { + /// + /// Gets or sets the budget. + /// + /// The budget. + double? Budget { get; set; } + + /// + /// Gets or sets the revenue. + /// + /// The revenue. + double? Revenue { get; set; } + } +} diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index eef348f61c..30babe2383 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.Entities.Movies /// /// Class Movie /// - public class Movie : Video, IHasCriticRating, IHasSoundtracks + public class Movie : Video, IHasCriticRating, IHasSoundtracks, IHasBudget { public List SpecialFeatureIds { get; set; } @@ -23,6 +23,18 @@ namespace MediaBrowser.Controller.Entities.Movies SoundtrackIds = new List(); } + /// + /// Gets or sets the budget. + /// + /// The budget. + public double? Budget { get; set; } + + /// + /// Gets or sets the revenue. + /// + /// The revenue. + public double? Revenue { get; set; } + /// /// Gets or sets the critic rating. /// diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs index 207f76efda..68ad4630a5 100644 --- a/MediaBrowser.Controller/Entities/MusicVideo.cs +++ b/MediaBrowser.Controller/Entities/MusicVideo.cs @@ -4,7 +4,7 @@ using System; namespace MediaBrowser.Controller.Entities { - public class MusicVideo : Video, IHasArtist, IHasMusicGenres + public class MusicVideo : Video, IHasArtist, IHasMusicGenres, IHasBudget { /// /// Gets or sets the artist. @@ -18,6 +18,18 @@ namespace MediaBrowser.Controller.Entities /// The album. public string Album { get; set; } + /// + /// Gets or sets the budget. + /// + /// The budget. + public double? Budget { get; set; } + + /// + /// Gets or sets the revenue. + /// + /// The revenue. + public double? Revenue { get; set; } + /// /// Determines whether the specified name has artist. /// diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index 26814ad40b..7c14c9865d 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -8,7 +8,7 @@ namespace MediaBrowser.Controller.Entities /// /// Class Trailer /// - public class Trailer : Video, IHasCriticRating, IHasSoundtracks + public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasBudget { public List SoundtrackIds { get; set; } @@ -19,6 +19,18 @@ namespace MediaBrowser.Controller.Entities SoundtrackIds = new List(); } + /// + /// Gets or sets the budget. + /// + /// The budget. + public double? Budget { get; set; } + + /// + /// Gets or sets the revenue. + /// + /// The revenue. + public double? Revenue { get; set; } + /// /// Gets or sets the critic rating. /// diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 9b89b12c50..e5fe6a04f7 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -90,6 +90,7 @@ + diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 14c83bed43..44138a5989 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -162,10 +162,14 @@ namespace MediaBrowser.Controller.Providers case "Budget": { var text = reader.ReadElementContentAsString(); - double value; - if (double.TryParse(text, NumberStyles.Any, _usCulture, out value)) + var hasBudget = item as IHasBudget; + if (hasBudget != null) { - item.Budget = value; + double value; + if (double.TryParse(text, NumberStyles.Any, _usCulture, out value)) + { + hasBudget.Budget = value; + } } break; @@ -174,10 +178,14 @@ namespace MediaBrowser.Controller.Providers case "Revenue": { var text = reader.ReadElementContentAsString(); - double value; - if (double.TryParse(text, NumberStyles.Any, _usCulture, out value)) + var hasBudget = item as IHasBudget; + if (hasBudget != null) { - item.Revenue = value; + double value; + if (double.TryParse(text, NumberStyles.Any, _usCulture, out value)) + { + hasBudget.Revenue = value; + } } break; diff --git a/MediaBrowser.Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Providers/Movies/MovieDbProvider.cs index e4fe2a914d..b812c93247 100644 --- a/MediaBrowser.Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbProvider.cs @@ -701,8 +701,12 @@ namespace MediaBrowser.Providers.Movies } movie.HomePageUrl = movieData.homepage; - movie.Budget = movieData.budget; - movie.Revenue = movieData.revenue; + var hasBudget = movie as IHasBudget; + if (hasBudget != null) + { + hasBudget.Budget = movieData.budget; + hasBudget.Revenue = movieData.revenue; + } if (!string.IsNullOrEmpty(movieData.tagline)) { diff --git a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs index 5a49e4f36b..4c032c8e78 100644 --- a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs +++ b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs @@ -280,14 +280,18 @@ namespace MediaBrowser.Providers.Savers builder.Append(""); } - if (item.Budget.HasValue) + var hasBudget = item as IHasBudget; + if (hasBudget != null) { - builder.Append("" + SecurityElement.Escape(item.Budget.Value.ToString(UsCulture)) + ""); - } + if (hasBudget.Budget.HasValue) + { + builder.Append("" + SecurityElement.Escape(hasBudget.Budget.Value.ToString(UsCulture)) + ""); + } - if (item.Revenue.HasValue) - { - builder.Append("" + SecurityElement.Escape(item.Revenue.Value.ToString(UsCulture)) + ""); + if (hasBudget.Revenue.HasValue) + { + builder.Append("" + SecurityElement.Escape(hasBudget.Revenue.Value.ToString(UsCulture)) + ""); + } } if (item.CommunityRating.HasValue) diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 5333518753..b43449858e 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -727,14 +727,18 @@ namespace MediaBrowser.Server.Implementations.Dto dto.EnableInternetProviders = !item.DontFetchMeta; } - if (fields.Contains(ItemFields.Budget)) + var hasBudget = item as IHasBudget; + if (hasBudget != null) { - dto.Budget = item.Budget; - } + if (fields.Contains(ItemFields.Budget)) + { + dto.Budget = hasBudget.Budget; + } - if (fields.Contains(ItemFields.Revenue)) - { - dto.Revenue = item.Revenue; + if (fields.Contains(ItemFields.Revenue)) + { + dto.Revenue = hasBudget.Revenue; + } } dto.EndDate = item.EndDate; diff --git a/MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs b/MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs index d2dac65499..87a7325c63 100644 --- a/MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs @@ -19,7 +19,12 @@ namespace MediaBrowser.Server.Implementations.Sorting private double GetValue(BaseItem x) { - return x.Budget ?? 0; + var hasBudget = x as IHasBudget; + if (hasBudget != null) + { + return hasBudget.Budget ?? 0; + } + return 0; } /// diff --git a/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs b/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs index e9d7912a16..6caa27ac39 100644 --- a/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs @@ -19,7 +19,12 @@ namespace MediaBrowser.Server.Implementations.Sorting private double GetValue(BaseItem x) { - return x.Revenue ?? 0; + var hasBudget = x as IHasBudget; + if (hasBudget != null) + { + return hasBudget.Revenue ?? 0; + } + return 0; } /// -- cgit v1.2.3 From 245e92c9cc6f97e139e04548c94184c65712d3f0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 2 Dec 2013 16:46:22 -0500 Subject: updated nuget --- .../Entities/Audio/MusicArtist.cs | 4 +-- .../Entities/Audio/MusicGenre.cs | 4 +-- MediaBrowser.Controller/Entities/GameGenre.cs | 4 +-- MediaBrowser.Controller/Entities/Genre.cs | 4 +-- MediaBrowser.Controller/Entities/IItemByName.cs | 25 ++++++++++------ MediaBrowser.Controller/Entities/Person.cs | 8 +++--- MediaBrowser.Controller/Entities/Studio.cs | 4 +-- MediaBrowser.Controller/Entities/Year.cs | 4 +-- MediaBrowser.Controller/LiveTv/Channel.cs | 4 +-- MediaBrowser.Controller/LiveTv/ILiveTvService.cs | 10 ++++++- .../LiveTv/ImageResponseInfo.cs | 19 +++++++++++++ MediaBrowser.Controller/LiveTv/ProgramInfo.cs | 12 ++++++++ MediaBrowser.Controller/LiveTv/RecordingInfo.cs | 29 +++++++++++++++++++ MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs | 6 ++++ .../MediaBrowser.Controller.csproj | 1 + MediaBrowser.Model/Dto/ItemByNameCounts.cs | 5 +++- MediaBrowser.Model/LiveTv/ProgramInfoDto.cs | 24 ++++------------ MediaBrowser.Model/LiveTv/RecordingInfoDto.cs | 33 ++++++++++++++++++++-- .../Dto/DtoService.cs | 8 ++---- .../Library/Validators/ArtistsValidator.cs | 2 +- .../Library/Validators/GameGenresValidator.cs | 2 +- .../Library/Validators/GenresValidator.cs | 2 +- .../Library/Validators/MusicGenresValidator.cs | 2 +- .../Library/Validators/PeoplePostScanTask.cs | 2 +- .../Library/Validators/StudiosValidator.cs | 2 +- .../LiveTv/ChannelImageProvider.cs | 2 +- .../LiveTv/LiveTvManager.cs | 25 ++++++---------- .../Sorting/AlbumCountComparer.cs | 2 +- .../Sorting/EpisodeCountComparer.cs | 2 +- .../Sorting/MovieCountComparer.cs | 2 +- .../Sorting/MusicVideoCountComparer.cs | 2 +- .../Sorting/SeriesCountComparer.cs | 2 +- .../Sorting/SongCountComparer.cs | 2 +- .../Sorting/TrailerCountComparer.cs | 2 +- Nuget/MediaBrowser.Common.Internal.nuspec | 4 +-- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 +-- 37 files changed, 180 insertions(+), 91 deletions(-) create mode 100644 MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs (limited to 'MediaBrowser.Server.Implementations/Sorting') diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs index 8ebfe17e41..d5572b9a5e 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs @@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entities.Audio public class MusicArtist : Folder, IItemByName, IHasMusicGenres, IHasDualAccess { [IgnoreDataMember] - public Dictionary UserItemCounts { get; set; } + public List UserItemCountList { get; set; } public bool IsAccessedByName { get; set; } @@ -69,7 +69,7 @@ namespace MediaBrowser.Controller.Entities.Audio public MusicArtist() { - UserItemCounts = new Dictionary(); + UserItemCountList = new List(); } /// diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs index ec2995fb2f..b54e14f2da 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities.Audio { public MusicGenre() { - UserItemCounts = new Dictionary(); + UserItemCountList = new List(); } /// @@ -25,6 +25,6 @@ namespace MediaBrowser.Controller.Entities.Audio } [IgnoreDataMember] - public Dictionary UserItemCounts { get; set; } + public List UserItemCountList { get; set; } } } diff --git a/MediaBrowser.Controller/Entities/GameGenre.cs b/MediaBrowser.Controller/Entities/GameGenre.cs index 0c877782e6..ffe62ba03f 100644 --- a/MediaBrowser.Controller/Entities/GameGenre.cs +++ b/MediaBrowser.Controller/Entities/GameGenre.cs @@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Entities { public GameGenre() { - UserItemCounts = new Dictionary(); + UserItemCountList = new List(); } /// @@ -22,6 +22,6 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public Dictionary UserItemCounts { get; set; } + public List UserItemCountList { get; set; } } } diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.cs index 6c49501826..0fa49639bf 100644 --- a/MediaBrowser.Controller/Entities/Genre.cs +++ b/MediaBrowser.Controller/Entities/Genre.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities { public Genre() { - UserItemCounts = new Dictionary(); + UserItemCountList = new List(); } /// @@ -25,6 +25,6 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public Dictionary UserItemCounts { get; set; } + public List UserItemCountList { get; set; } } } diff --git a/MediaBrowser.Controller/Entities/IItemByName.cs b/MediaBrowser.Controller/Entities/IItemByName.cs index 1cb375374d..1e83c7466e 100644 --- a/MediaBrowser.Controller/Entities/IItemByName.cs +++ b/MediaBrowser.Controller/Entities/IItemByName.cs @@ -1,6 +1,7 @@ using MediaBrowser.Model.Dto; using System; using System.Collections.Generic; +using System.Linq; namespace MediaBrowser.Controller.Entities { @@ -9,7 +10,7 @@ namespace MediaBrowser.Controller.Entities /// public interface IItemByName { - Dictionary UserItemCounts { get; set; } + List UserItemCountList { get; set; } } public interface IHasDualAccess : IItemByName @@ -17,23 +18,29 @@ namespace MediaBrowser.Controller.Entities bool IsAccessedByName { get; } } - public static class IItemByNameExtensions + public static class ItemByNameExtensions { - public static ItemByNameCounts GetItemByNameCounts(this IItemByName item, User user) + public static ItemByNameCounts GetItemByNameCounts(this IItemByName item, Guid userId) { - if (user == null) + if (userId == Guid.Empty) { - throw new ArgumentNullException("user"); + throw new ArgumentNullException("userId"); } - ItemByNameCounts counts; + return item.UserItemCountList.FirstOrDefault(i => i.UserId == userId); + } + + public static void SetItemByNameCounts(this IItemByName item, Guid userId, ItemByNameCounts counts) + { + var current = item.UserItemCountList.FirstOrDefault(i => i.UserId == userId); - if (item.UserItemCounts.TryGetValue(user.Id, out counts)) + if (current != null) { - return counts; + item.UserItemCountList.Remove(current); } - return null; + counts.UserId = userId; + item.UserItemCountList.Add(counts); } } } diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs index 17b9d77413..243861da76 100644 --- a/MediaBrowser.Controller/Entities/Person.cs +++ b/MediaBrowser.Controller/Entities/Person.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Dto; using System; using System.Collections.Generic; +using System.Runtime.Serialization; namespace MediaBrowser.Controller.Entities { @@ -12,11 +12,11 @@ namespace MediaBrowser.Controller.Entities { public Person() { - UserItemCounts = new Dictionary(); + UserItemCountList = new List(); } [IgnoreDataMember] - public Dictionary UserItemCounts { get; set; } + public List UserItemCountList { get; set; } /// /// Gets the user data key. diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs index bbe96a88b9..7bc17549f3 100644 --- a/MediaBrowser.Controller/Entities/Studio.cs +++ b/MediaBrowser.Controller/Entities/Studio.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities { public Studio() { - UserItemCounts = new Dictionary(); + UserItemCountList = new List(); } /// @@ -25,6 +25,6 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public Dictionary UserItemCounts { get; set; } + public List UserItemCountList { get; set; } } } diff --git a/MediaBrowser.Controller/Entities/Year.cs b/MediaBrowser.Controller/Entities/Year.cs index d0f4577183..cd50a1c60c 100644 --- a/MediaBrowser.Controller/Entities/Year.cs +++ b/MediaBrowser.Controller/Entities/Year.cs @@ -12,11 +12,11 @@ namespace MediaBrowser.Controller.Entities { public Year() { - UserItemCounts = new Dictionary(); + UserItemCountList = new List(); } [IgnoreDataMember] - public Dictionary UserItemCounts { get; set; } + public List UserItemCountList { get; set; } /// /// Gets the user data key. diff --git a/MediaBrowser.Controller/LiveTv/Channel.cs b/MediaBrowser.Controller/LiveTv/Channel.cs index 94d76971c3..8097cea1de 100644 --- a/MediaBrowser.Controller/LiveTv/Channel.cs +++ b/MediaBrowser.Controller/LiveTv/Channel.cs @@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.LiveTv { public Channel() { - UserItemCounts = new Dictionary(); + UserItemCountList = new List(); } /// @@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.LiveTv } [IgnoreDataMember] - public Dictionary UserItemCounts { get; set; } + public List UserItemCountList { get; set; } /// /// Gets or sets the number. diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index 1627ad400f..a6c60d468d 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -69,8 +69,16 @@ namespace MediaBrowser.Controller.LiveTv /// The channel identifier. /// The cancellation token. /// Task{Stream}. - Task GetChannelImageAsync(string channelId, CancellationToken cancellationToken); + Task GetChannelImageAsync(string channelId, CancellationToken cancellationToken); + /// + /// Gets the program image asynchronous. + /// + /// The program identifier. + /// The cancellation token. + /// Task{ImageResponseInfo}. + Task GetProgramImageAsync(string programId, CancellationToken cancellationToken); + /// /// Gets the recordings asynchronous. /// diff --git a/MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs b/MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs new file mode 100644 index 0000000000..d454a1ef8d --- /dev/null +++ b/MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs @@ -0,0 +1,19 @@ +using System.IO; + +namespace MediaBrowser.Controller.LiveTv +{ + public class ImageResponseInfo + { + /// + /// Gets or sets the stream. + /// + /// The stream. + public Stream Stream { get; set; } + + /// + /// Gets or sets the type of the MIME. + /// + /// The type of the MIME. + public string MimeType { get; set; } + } +} diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index 58a15be3e5..cf5cdb94c9 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -77,6 +77,18 @@ namespace MediaBrowser.Controller.LiveTv /// /// The community rating. public float? CommunityRating { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is repeat. + /// + /// true if this instance is repeat; otherwise, false. + public bool IsRepeat { get; set; } + + /// + /// Gets or sets the episode title. + /// + /// The episode title. + public string EpisodeTitle { get; set; } public ProgramInfo() { diff --git a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs index 88d093f645..65e977d75e 100644 --- a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs +++ b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs @@ -1,5 +1,6 @@ using MediaBrowser.Model.LiveTv; using System; +using System.Collections.Generic; namespace MediaBrowser.Controller.LiveTv { @@ -25,6 +26,12 @@ namespace MediaBrowser.Controller.LiveTv /// public string Name { get; set; } + /// + /// Gets or sets the path. + /// + /// The path. + public string Path { get; set; } + /// /// Description of the recording. /// @@ -51,5 +58,27 @@ namespace MediaBrowser.Controller.LiveTv /// /// The status. public RecordingStatus Status { get; set; } + + /// + /// Genre of the program. + /// + public List Genres { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is repeat. + /// + /// true if this instance is repeat; otherwise, false. + public bool IsRepeat { get; set; } + + /// + /// Gets or sets the episode title. + /// + /// The episode title. + public string EpisodeTitle { get; set; } + + public RecordingInfo() + { + Genres = new List(); + } } } diff --git a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs index 178fcff82e..44594882cd 100644 --- a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs @@ -71,6 +71,12 @@ namespace MediaBrowser.Controller.LiveTv /// The days. public List Days { get; set; } + /// + /// Gets or sets the priority. + /// + /// The priority. + public int Priority { get; set; } + public SeriesTimerInfo() { Days = new List(); diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 64d5c52260..2beb3588ed 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -110,6 +110,7 @@ + diff --git a/MediaBrowser.Model/Dto/ItemByNameCounts.cs b/MediaBrowser.Model/Dto/ItemByNameCounts.cs index ae801e1962..31b6d2da0e 100644 --- a/MediaBrowser.Model/Dto/ItemByNameCounts.cs +++ b/MediaBrowser.Model/Dto/ItemByNameCounts.cs @@ -1,4 +1,5 @@ - +using System; + namespace MediaBrowser.Model.Dto { /// @@ -6,6 +7,8 @@ namespace MediaBrowser.Model.Dto /// public class ItemByNameCounts { + public Guid UserId { get; set; } + /// /// Gets or sets the total count. /// diff --git a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs b/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs index 26cfd3cf00..6884d355d1 100644 --- a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs @@ -90,29 +90,17 @@ namespace MediaBrowser.Model.LiveTv public DateTime? OriginalAirDate { get; set; } /// - /// Gets or sets the recording identifier. + /// Gets or sets a value indicating whether this instance is repeat. /// - /// The recording identifier. - public string RecordingId { get; set; } + /// true if this instance is repeat; otherwise, false. + public bool IsRepeat { get; set; } /// - /// Gets or sets the recording status. + /// Gets or sets the episode title. /// - /// The recording status. - public RecordingStatus? RecordingStatus { get; set; } + /// The episode title. + public string EpisodeTitle { get; set; } - /// - /// Gets or sets the timer identifier. - /// - /// The timer identifier. - public string TimerId { get; set; } - - /// - /// Gets or sets the timer status. - /// - /// The timer status. - public RecordingStatus? TimerStatus { get; set; } - public ProgramInfoDto() { Genres = new List(); diff --git a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs index 926198b93f..9ad6233a67 100644 --- a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace MediaBrowser.Model.LiveTv { @@ -14,13 +15,13 @@ namespace MediaBrowser.Model.LiveTv /// /// The external identifier. public string ExternalId { get; set; } - + /// /// Gets or sets the program identifier. /// /// The program identifier. public string ProgramId { get; set; } - + /// /// ChannelId of the recording. /// @@ -36,6 +37,12 @@ namespace MediaBrowser.Model.LiveTv /// public string Name { get; set; } + /// + /// Gets or sets the path. + /// + /// The path. + public string Path { get; set; } + /// /// Description of the recording. /// @@ -56,5 +63,27 @@ namespace MediaBrowser.Model.LiveTv /// /// The status. public RecordingStatus Status { get; set; } + + /// + /// Genre of the program. + /// + public List Genres { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is repeat. + /// + /// true if this instance is repeat; otherwise, false. + public bool IsRepeat { get; set; } + + /// + /// Gets or sets the episode title. + /// + /// The episode title. + public string EpisodeTitle { get; set; } + + public RecordingInfoDto() + { + Genres = new List(); + } } } \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 90ca64058d..f6291cf36b 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -129,17 +129,13 @@ namespace MediaBrowser.Server.Implementations.Dto /// The user. private void AttachItemByNameCounts(BaseItemDto dto, IItemByName item, User user) { - ItemByNameCounts counts; - if (user == null) { //counts = item.ItemCounts; return; } - if (!item.UserItemCounts.TryGetValue(user.Id, out counts)) - { - counts = new ItemByNameCounts(); - } + + ItemByNameCounts counts = item.GetItemByNameCounts(user.Id) ?? new ItemByNameCounts(); dto.ChildCount = counts.TotalCount; diff --git a/MediaBrowser.Server.Implementations/Library/Validators/ArtistsValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/ArtistsValidator.cs index 1984a24209..40ef5304c6 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/ArtistsValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/ArtistsValidator.cs @@ -137,7 +137,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators if (userId.HasValue) { - artist.UserItemCounts[userId.Value] = counts; + artist.SetItemByNameCounts(userId.Value, counts); } } diff --git a/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs index d21a123c07..c7af7a238f 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs @@ -106,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators { var itemCounts = CountHelpers.GetCounts(counts[libraryId]); - itemByName.UserItemCounts[libraryId] = itemCounts; + itemByName.SetItemByNameCounts(libraryId, itemCounts); } await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false); diff --git a/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs index 0670e1a851..cb1253df07 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs @@ -107,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators { var itemCounts = CountHelpers.GetCounts(counts[libraryId]); - itemByName.UserItemCounts[libraryId] = itemCounts; + itemByName.SetItemByNameCounts(libraryId, itemCounts); } await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false); diff --git a/MediaBrowser.Server.Implementations/Library/Validators/MusicGenresValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/MusicGenresValidator.cs index 166f557cf0..57a6a612bc 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/MusicGenresValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/MusicGenresValidator.cs @@ -107,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators { var itemCounts = CountHelpers.GetCounts(counts[libraryId]); - itemByName.UserItemCounts[libraryId] = itemCounts; + itemByName.SetItemByNameCounts(libraryId, itemCounts); } await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false); diff --git a/MediaBrowser.Server.Implementations/Library/Validators/PeoplePostScanTask.cs b/MediaBrowser.Server.Implementations/Library/Validators/PeoplePostScanTask.cs index cfc7f4310d..0104b2b7ec 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/PeoplePostScanTask.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/PeoplePostScanTask.cs @@ -94,7 +94,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators { var itemCounts = CountHelpers.GetCounts(counts[libraryId]); - itemByName.UserItemCounts[libraryId] = itemCounts; + itemByName.SetItemByNameCounts(libraryId, itemCounts); } } catch (Exception ex) diff --git a/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs index 02c7a94b4b..0f4ff562ef 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs @@ -106,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators { var itemCounts = CountHelpers.GetCounts(counts[libraryId]); - itemByName.UserItemCounts[libraryId] = itemCounts; + itemByName.SetItemByNameCounts(libraryId, itemCounts); } await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false); diff --git a/MediaBrowser.Server.Implementations/LiveTv/ChannelImageProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/ChannelImageProvider.cs index e1a918fd2e..322948bade 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/ChannelImageProvider.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/ChannelImageProvider.cs @@ -75,7 +75,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv // Dummy up the original url var url = channel.ServiceName + channel.ChannelId; - await _providerManager.SaveImage(channel, response.Content, response.ContentType, ImageType.Primary, null, url, cancellationToken).ConfigureAwait(false); + await _providerManager.SaveImage(channel, response.Stream, response.MimeType, ImageType.Primary, null, url, cancellationToken).ConfigureAwait(false); } } diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 261c915cb2..704d1ea59c 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -209,7 +209,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv OriginalAirDate = program.OriginalAirDate, Audio = program.Audio, CommunityRating = program.CommunityRating, - AspectRatio = program.AspectRatio + AspectRatio = program.AspectRatio, + IsRepeat = program.IsRepeat, + EpisodeTitle = program.EpisodeTitle }; } @@ -297,21 +299,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv var returnArray = programs.ToArray(); - var recordings = await GetRecordings(new RecordingQuery - { - - - }, cancellationToken).ConfigureAwait(false); - - foreach (var program in returnArray) - { - var recording = recordings.Items - .FirstOrDefault(i => string.Equals(i.ProgramId, program.Id)); - - program.RecordingId = recording == null ? null : recording.Id; - program.RecordingStatus = recording == null ? (RecordingStatus?)null : recording.Status; - } - return new QueryResult { Items = returnArray, @@ -400,7 +387,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv Id = id, ExternalId = info.Id, ChannelId = GetInternalChannelId(service.Name, info.ChannelId, info.ChannelName).ToString("N"), - Status = info.Status + Status = info.Status, + Path = info.Path, + Genres = info.Genres, + IsRepeat = info.IsRepeat, + EpisodeTitle = info.EpisodeTitle }; if (!string.IsNullOrEmpty(info.ProgramId)) diff --git a/MediaBrowser.Server.Implementations/Sorting/AlbumCountComparer.cs b/MediaBrowser.Server.Implementations/Sorting/AlbumCountComparer.cs index 8e24bc52d6..e35ba00f2e 100644 --- a/MediaBrowser.Server.Implementations/Sorting/AlbumCountComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/AlbumCountComparer.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting if (itemByName != null) { - var counts = itemByName.GetItemByNameCounts(User); + var counts = itemByName.GetItemByNameCounts(User.Id); if (counts != null) { diff --git a/MediaBrowser.Server.Implementations/Sorting/EpisodeCountComparer.cs b/MediaBrowser.Server.Implementations/Sorting/EpisodeCountComparer.cs index 7731e59d2b..b3fd8a023d 100644 --- a/MediaBrowser.Server.Implementations/Sorting/EpisodeCountComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/EpisodeCountComparer.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting if (itemByName != null) { - var counts = itemByName.GetItemByNameCounts(User); + var counts = itemByName.GetItemByNameCounts(User.Id); if (counts != null) { diff --git a/MediaBrowser.Server.Implementations/Sorting/MovieCountComparer.cs b/MediaBrowser.Server.Implementations/Sorting/MovieCountComparer.cs index 51f39a02f2..605f4d1af4 100644 --- a/MediaBrowser.Server.Implementations/Sorting/MovieCountComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/MovieCountComparer.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting if (itemByName != null) { - var counts = itemByName.GetItemByNameCounts(User); + var counts = itemByName.GetItemByNameCounts(User.Id); if (counts != null) { diff --git a/MediaBrowser.Server.Implementations/Sorting/MusicVideoCountComparer.cs b/MediaBrowser.Server.Implementations/Sorting/MusicVideoCountComparer.cs index 889658459c..6c9c5534d6 100644 --- a/MediaBrowser.Server.Implementations/Sorting/MusicVideoCountComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/MusicVideoCountComparer.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting if (itemByName != null) { - var counts = itemByName.GetItemByNameCounts(User); + var counts = itemByName.GetItemByNameCounts(User.Id); if (counts != null) { diff --git a/MediaBrowser.Server.Implementations/Sorting/SeriesCountComparer.cs b/MediaBrowser.Server.Implementations/Sorting/SeriesCountComparer.cs index 13d2932cbc..8567e400cd 100644 --- a/MediaBrowser.Server.Implementations/Sorting/SeriesCountComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/SeriesCountComparer.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting if (itemByName != null) { - var counts = itemByName.GetItemByNameCounts(User); + var counts = itemByName.GetItemByNameCounts(User.Id); if (counts != null) { diff --git a/MediaBrowser.Server.Implementations/Sorting/SongCountComparer.cs b/MediaBrowser.Server.Implementations/Sorting/SongCountComparer.cs index b12e1322a0..85b849a217 100644 --- a/MediaBrowser.Server.Implementations/Sorting/SongCountComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/SongCountComparer.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting if (itemByName != null) { - var counts = itemByName.GetItemByNameCounts(User); + var counts = itemByName.GetItemByNameCounts(User.Id); if (counts != null) { diff --git a/MediaBrowser.Server.Implementations/Sorting/TrailerCountComparer.cs b/MediaBrowser.Server.Implementations/Sorting/TrailerCountComparer.cs index b6f67410a0..a13875674d 100644 --- a/MediaBrowser.Server.Implementations/Sorting/TrailerCountComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/TrailerCountComparer.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting if (itemByName != null) { - var counts = itemByName.GetItemByNameCounts(User); + var counts = itemByName.GetItemByNameCounts(User.Id); if (counts != null) { diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 946ec617bd..c3998aed7a 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.256 + 3.0.257 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption. Copyright © Media Browser 2013 - + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 04ac3559c0..aea3230fdb 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.256 + 3.0.257 MediaBrowser.Common Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index d813a00ace..2a80896c06 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.256 + 3.0.257 Media Browser.Server.Core Media Browser Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Media Browser Server. Copyright © Media Browser 2013 - + -- cgit v1.2.3