aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/ItemUpdateService.cs2
-rw-r--r--MediaBrowser.Api/LiveTv/LiveTvService.cs8
-rw-r--r--MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs9
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs14
-rw-r--r--MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj2
-rw-r--r--MediaBrowser.LocalMetadata/Providers/AlbumXmlProvider.cs30
-rw-r--r--MediaBrowser.LocalMetadata/Providers/ArtistXmlProvider.cs30
-rw-r--r--MediaBrowser.LocalMetadata/Savers/SeasonXmlSaver.cs2
-rw-r--r--MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj6
-rw-r--r--MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj6
-rw-r--r--MediaBrowser.Model/ApiClient/IApiClient.cs16
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs160
-rw-r--r--MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs6
-rw-r--r--MediaBrowser.Model/LiveTv/RecordingGroupDto.cs40
-rw-r--r--MediaBrowser.Model/LiveTv/RecordingInfoDto.cs313
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj2
-rw-r--r--MediaBrowser.Model/Net/MimeTypes.cs154
-rw-r--r--MediaBrowser.Providers/Movies/MovieDbSearch.cs11
-rw-r--r--MediaBrowser.Providers/Omdb/OmdbItemProvider.cs112
-rw-r--r--MediaBrowser.Server.Implementations/Dto/DtoService.cs11
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs118
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs170
-rw-r--r--MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json3
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationHost.cs5
24 files changed, 467 insertions, 763 deletions
diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs
index bab02de35..8f7edabbb 100644
--- a/MediaBrowser.Api/ItemUpdateService.cs
+++ b/MediaBrowser.Api/ItemUpdateService.cs
@@ -428,7 +428,7 @@ namespace MediaBrowser.Api
var series = item as Series;
if (series != null)
{
- series.Status = request.Status;
+ series.Status = request.SeriesStatus;
series.AirDays = request.AirDays;
series.AirTime = request.AirTime;
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs
index b8b74369c..86d8b9f99 100644
--- a/MediaBrowser.Api/LiveTv/LiveTvService.cs
+++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs
@@ -78,7 +78,7 @@ namespace MediaBrowser.Api.LiveTv
[Route("/LiveTv/Recordings", "GET", Summary = "Gets live tv recordings")]
[Authenticated]
- public class GetRecordings : IReturn<QueryResult<RecordingInfoDto>>
+ public class GetRecordings : IReturn<QueryResult<BaseItemDto>>
{
[ApiMember(Name = "ChannelId", Description = "Optional filter by channel id.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string ChannelId { get; set; }
@@ -107,7 +107,7 @@ namespace MediaBrowser.Api.LiveTv
[Route("/LiveTv/Recordings/Groups", "GET", Summary = "Gets live tv recording groups")]
[Authenticated]
- public class GetRecordingGroups : IReturn<QueryResult<RecordingGroupDto>>
+ public class GetRecordingGroups : IReturn<QueryResult<BaseItemDto>>
{
[ApiMember(Name = "UserId", Description = "Optional filter by user and attach user data.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string UserId { get; set; }
@@ -115,7 +115,7 @@ namespace MediaBrowser.Api.LiveTv
[Route("/LiveTv/Recordings/{Id}", "GET", Summary = "Gets a live tv recording")]
[Authenticated]
- public class GetRecording : IReturn<RecordingInfoDto>
+ public class GetRecording : IReturn<BaseItemDto>
{
[ApiMember(Name = "Id", Description = "Recording Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public string Id { get; set; }
@@ -310,7 +310,7 @@ namespace MediaBrowser.Api.LiveTv
[Route("/LiveTv/Recordings/Groups/{Id}", "GET", Summary = "Gets a recording group")]
[Authenticated]
- public class GetRecordingGroup : IReturn<RecordingGroupDto>
+ public class GetRecordingGroup : IReturn<BaseItemDto>
{
[ApiMember(Name = "Id", Description = "Recording group Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public string Id { get; set; }
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
index c060f53a6..8a77d7616 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
@@ -121,6 +121,15 @@ namespace MediaBrowser.Controller.Entities.Audio
.Select(i => i.GetLookupInfo())
.ToList();
+ var album = id.SongInfos
+ .Select(i => i.Album)
+ .FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
+
+ if (!string.IsNullOrWhiteSpace(album))
+ {
+ id.Name = album;
+ }
+
return id;
}
}
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index 53eb18e7a..e84fe902d 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -79,7 +79,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="user">The user.</param>
/// <returns>Task{RecordingInfoDto}.</returns>
- Task<RecordingInfoDto> GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null);
+ Task<BaseItemDto> GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null);
/// <summary>
/// Gets the channel.
@@ -113,7 +113,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="options">The options.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>QueryResult{RecordingInfoDto}.</returns>
- Task<QueryResult<RecordingInfoDto>> GetRecordings(RecordingQuery query, DtoOptions options, CancellationToken cancellationToken);
+ Task<QueryResult<BaseItemDto>> GetRecordings(RecordingQuery query, DtoOptions options, CancellationToken cancellationToken);
/// <summary>
/// Gets the timers.
@@ -218,7 +218,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{RecordingGroupDto}}.</returns>
- Task<QueryResult<RecordingGroupDto>> GetRecordingGroups(RecordingGroupQuery query, CancellationToken cancellationToken);
+ Task<QueryResult<BaseItemDto>> GetRecordingGroups(RecordingGroupQuery query, CancellationToken cancellationToken);
/// <summary>
/// Closes the live stream.
@@ -321,5 +321,13 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;IEnumerable&lt;MediaSourceInfo&gt;&gt;.</returns>
Task<IEnumerable<MediaSourceInfo>> GetChannelMediaSources(string id, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Adds the information to recording dto.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="dto">The dto.</param>
+ /// <param name="user">The user.</param>
+ void AddInfoToRecordingDto(BaseItem item, BaseItemDto dto, User user = null);
}
}
diff --git a/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj b/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj
index 894be8799..57174d63a 100644
--- a/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj
+++ b/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj
@@ -58,8 +58,6 @@
<Compile Include="Parsers\SeasonXmlParser.cs" />
<Compile Include="Parsers\SeriesXmlParser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Providers\AlbumXmlProvider.cs" />
- <Compile Include="Providers\ArtistXmlProvider.cs" />
<Compile Include="Providers\BoxSetXmlProvider.cs" />
<Compile Include="Providers\EpisodeXmlProvider.cs" />
<Compile Include="Providers\FolderXmlProvider.cs" />
diff --git a/MediaBrowser.LocalMetadata/Providers/AlbumXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/AlbumXmlProvider.cs
deleted file mode 100644
index 646922769..000000000
--- a/MediaBrowser.LocalMetadata/Providers/AlbumXmlProvider.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.IO;
-using System.Threading;
-using MediaBrowser.Common.IO;
-using MediaBrowser.Controller.Entities.Audio;
-using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.Logging;
-
-namespace MediaBrowser.LocalMetadata.Providers
-{
- public class AlbumXmlProvider : BaseXmlProvider<MusicAlbum>
- {
- private readonly ILogger _logger;
-
- public AlbumXmlProvider(IFileSystem fileSystem, ILogger logger)
- : base(fileSystem)
- {
- _logger = logger;
- }
-
- protected override void Fetch(LocalMetadataResult<MusicAlbum> result, string path, CancellationToken cancellationToken)
- {
- new BaseItemXmlParser<MusicAlbum>(_logger).Fetch(result.Item, path, cancellationToken);
- }
-
- protected override FileSystemInfo GetXmlFile(ItemInfo info, IDirectoryService directoryService)
- {
- return directoryService.GetFile(Path.Combine(info.Path, "album.xml"));
- }
- }
-}
diff --git a/MediaBrowser.LocalMetadata/Providers/ArtistXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/ArtistXmlProvider.cs
deleted file mode 100644
index 0b5ebfb11..000000000
--- a/MediaBrowser.LocalMetadata/Providers/ArtistXmlProvider.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.IO;
-using System.Threading;
-using MediaBrowser.Common.IO;
-using MediaBrowser.Controller.Entities.Audio;
-using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.Logging;
-
-namespace MediaBrowser.LocalMetadata.Providers
-{
- class ArtistXmlProvider : BaseXmlProvider<MusicArtist>
- {
- private readonly ILogger _logger;
-
- public ArtistXmlProvider(IFileSystem fileSystem, ILogger logger)
- : base(fileSystem)
- {
- _logger = logger;
- }
-
- protected override void Fetch(LocalMetadataResult<MusicArtist> result, string path, CancellationToken cancellationToken)
- {
- new BaseItemXmlParser<MusicArtist>(_logger).Fetch(result.Item, path, cancellationToken);
- }
-
- protected override FileSystemInfo GetXmlFile(ItemInfo info, IDirectoryService directoryService)
- {
- return directoryService.GetFile(Path.Combine(info.Path, "artist.xml"));
- }
- }
-}
diff --git a/MediaBrowser.LocalMetadata/Savers/SeasonXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/SeasonXmlSaver.cs
index a112f22fa..30f3e0ca1 100644
--- a/MediaBrowser.LocalMetadata/Savers/SeasonXmlSaver.cs
+++ b/MediaBrowser.LocalMetadata/Savers/SeasonXmlSaver.cs
@@ -11,7 +11,7 @@ using System.Threading;
namespace MediaBrowser.LocalMetadata.Savers
{
- public class SeasonXmlSaver : IMetadataFileSaver
+ public class SeasonXmlSaver
{
public string Name
{
diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj
index f70fe628e..a63b0a7c6 100644
--- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj
+++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj
@@ -752,15 +752,9 @@
<Compile Include="..\MediaBrowser.Model\LiveTv\RecommendedProgramQuery.cs">
<Link>LiveTv\RecommendedProgramQuery.cs</Link>
</Compile>
- <Compile Include="..\MediaBrowser.Model\LiveTv\RecordingGroupDto.cs">
- <Link>LiveTv\RecordingGroupDto.cs</Link>
- </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\RecordingGroupQuery.cs">
<Link>LiveTv\RecordingGroupQuery.cs</Link>
</Compile>
- <Compile Include="..\MediaBrowser.Model\LiveTv\RecordingInfoDto.cs">
- <Link>LiveTv\RecordingInfoDto.cs</Link>
- </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\RecordingQuery.cs">
<Link>LiveTv\RecordingQuery.cs</Link>
</Compile>
diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj
index bb8b09682..036064238 100644
--- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj
+++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj
@@ -708,15 +708,9 @@
<Compile Include="..\MediaBrowser.Model\LiveTv\RecommendedProgramQuery.cs">
<Link>LiveTv\RecommendedProgramQuery.cs</Link>
</Compile>
- <Compile Include="..\MediaBrowser.Model\LiveTv\RecordingGroupDto.cs">
- <Link>LiveTv\RecordingGroupDto.cs</Link>
- </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\RecordingGroupQuery.cs">
<Link>LiveTv\RecordingGroupQuery.cs</Link>
</Compile>
- <Compile Include="..\MediaBrowser.Model\LiveTv\RecordingInfoDto.cs">
- <Link>LiveTv\RecordingInfoDto.cs</Link>
- </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\RecordingQuery.cs">
<Link>LiveTv\RecordingQuery.cs</Link>
</Compile>
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs
index 026e65ec4..71ac0b14e 100644
--- a/MediaBrowser.Model/ApiClient/IApiClient.cs
+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs
@@ -935,14 +935,6 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="item">The item.</param>
/// <param name="options">The options.</param>
/// <returns>System.String.</returns>
- string GetImageUrl(RecordingInfoDto item, ImageOptions options);
-
- /// <summary>
- /// Gets the image URL.
- /// </summary>
- /// <param name="item">The item.</param>
- /// <param name="options">The options.</param>
- /// <returns>System.String.</returns>
string GetImageUrl(ProgramInfoDto item, ImageOptions options);
/// <summary>
@@ -1077,7 +1069,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{RecordingInfoDto}}.</returns>
- Task<QueryResult<RecordingInfoDto>> GetLiveTvRecordingsAsync(RecordingQuery query, CancellationToken cancellationToken = default(CancellationToken));
+ Task<QueryResult<BaseItemDto>> GetLiveTvRecordingsAsync(RecordingQuery query, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the live tv recording asynchronous.
@@ -1086,7 +1078,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="userId">The user identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{RecordingInfoDto}.</returns>
- Task<RecordingInfoDto> GetLiveTvRecordingAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken));
+ Task<BaseItemDto> GetLiveTvRecordingAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the live tv recording groups asynchronous.
@@ -1094,7 +1086,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{RecordingGroupDto}}.</returns>
- Task<QueryResult<RecordingGroupDto>> GetLiveTvRecordingGroupsAsync(RecordingGroupQuery query, CancellationToken cancellationToken = default(CancellationToken));
+ Task<QueryResult<BaseItemDto>> GetLiveTvRecordingGroupsAsync(RecordingGroupQuery query, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the live tv recording group asynchronous.
@@ -1103,7 +1095,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="userId">The user identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{RecordingGroupDto}.</returns>
- Task<RecordingGroupDto> GetLiveTvRecordingGroupAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken));
+ Task<BaseItemDto> GetLiveTvRecordingGroupAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the live tv timers asynchronous.
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index c772692a2..0f6ce4334 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -2,6 +2,7 @@
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Library;
+using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Sync;
using System;
@@ -442,7 +443,57 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the status.
/// </summary>
/// <value>The status.</value>
- public SeriesStatus? Status { get; set; }
+ public string Status { get; set; }
+
+ [IgnoreDataMember]
+ public SeriesStatus? SeriesStatus
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(Status))
+ {
+ return null;
+ }
+
+ return (SeriesStatus)Enum.Parse(typeof(SeriesStatus), Status, true);
+ }
+ set
+ {
+ if (value == null)
+ {
+ Status = null;
+ }
+ else
+ {
+ Status = value.Value.ToString();
+ }
+ }
+ }
+
+ [IgnoreDataMember]
+ public RecordingStatus? RecordingStatus
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(Status))
+ {
+ return null;
+ }
+
+ return (RecordingStatus)Enum.Parse(typeof(RecordingStatus), Status, true);
+ }
+ set
+ {
+ if (value == null)
+ {
+ Status = null;
+ }
+ else
+ {
+ Status = value.Value.ToString();
+ }
+ }
+ }
/// <summary>
/// Gets or sets the air time.
@@ -798,6 +849,17 @@ namespace MediaBrowser.Model.Dto
public int? IsoSpeedRating { get; set; }
/// <summary>
+ /// Used by RecordingGroup
+ /// </summary>
+ public int? RecordingCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the series timer identifier.
+ /// </summary>
+ /// <value>The series timer identifier.</value>
+ public string SeriesTimerId { get; set; }
+
+ /// <summary>
/// Gets a value indicating whether this instance can resume.
/// </summary>
/// <value><c>true</c> if this instance can resume; otherwise, <c>false</c>.</value>
@@ -1017,5 +1079,101 @@ namespace MediaBrowser.Model.Dto
/// Occurs when [property changed].
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
+
+ /// <summary>
+ /// Gets or sets the program identifier.
+ /// </summary>
+ /// <value>The program identifier.</value>
+ public string ProgramId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the channel primary image tag.
+ /// </summary>
+ /// <value>The channel primary image tag.</value>
+ public string ChannelPrimaryImageTag { get; set; }
+
+ /// <summary>
+ /// The start date of the recording, in UTC.
+ /// </summary>
+ public DateTime? StartDate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the original air date.
+ /// </summary>
+ /// <value>The original air date.</value>
+ public DateTime? OriginalAirDate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the completion percentage.
+ /// </summary>
+ /// <value>The completion percentage.</value>
+ public double? CompletionPercentage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is repeat.
+ /// </summary>
+ /// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
+ public bool? IsRepeat { get; set; }
+
+ /// <summary>
+ /// Gets or sets the episode title.
+ /// </summary>
+ /// <value>The episode title.</value>
+ public string EpisodeTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type of the channel.
+ /// </summary>
+ /// <value>The type of the channel.</value>
+ public ChannelType? ChannelType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the audio.
+ /// </summary>
+ /// <value>The audio.</value>
+ public ProgramAudio? Audio { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is movie.
+ /// </summary>
+ /// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
+ public bool? IsMovie { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is sports.
+ /// </summary>
+ /// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
+ public bool? IsSports { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is series.
+ /// </summary>
+ /// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
+ public bool? IsSeries { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is live.
+ /// </summary>
+ /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
+ public bool? IsLive { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is news.
+ /// </summary>
+ /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
+ public bool? IsNews { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is kids.
+ /// </summary>
+ /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
+ public bool? IsKids { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is premiere.
+ /// </summary>
+ /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
+ public bool? IsPremiere { get; set; }
+
}
}
diff --git a/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs
index 49e572418..296ead5c2 100644
--- a/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs
@@ -1,7 +1,7 @@
-using System;
-using System.ComponentModel;
-using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Extensions;
+using System;
+using System.ComponentModel;
namespace MediaBrowser.Model.LiveTv
{
diff --git a/MediaBrowser.Model/LiveTv/RecordingGroupDto.cs b/MediaBrowser.Model/LiveTv/RecordingGroupDto.cs
deleted file mode 100644
index 8a0b488cc..000000000
--- a/MediaBrowser.Model/LiveTv/RecordingGroupDto.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Extensions;
-using System.ComponentModel;
-using System.Diagnostics;
-
-namespace MediaBrowser.Model.LiveTv
-{
- /// <summary>
- /// Class RecordingGroupDto.
- /// </summary>
- [DebuggerDisplay("Name = {Name}, Count = {RecordingCount}")]
- public class RecordingGroupDto : IHasPropertyChangedEvent, IHasServerId
- {
- /// <summary>
- /// Gets or sets the server identifier.
- /// </summary>
- /// <value>The server identifier.</value>
- public string ServerId { get; set; }
-
- /// <summary>
- /// Gets or sets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the identifier.
- /// </summary>
- /// <value>The identifier.</value>
- public string Id { get; set; }
-
- /// <summary>
- /// Gets or sets the recording count.
- /// </summary>
- /// <value>The recording count.</value>
- public int RecordingCount { get; set; }
-
- public event PropertyChangedEventHandler PropertyChanged;
- }
-}
diff --git a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs
deleted file mode 100644
index 0988b11a6..000000000
--- a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs
+++ /dev/null
@@ -1,313 +0,0 @@
-using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Extensions;
-using MediaBrowser.Model.Library;
-using MediaBrowser.Model.Sync;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Runtime.Serialization;
-
-namespace MediaBrowser.Model.LiveTv
-{
- [DebuggerDisplay("Name = {Name}, ChannelName = {ChannelName}")]
- public class RecordingInfoDto : IHasPropertyChangedEvent, IItemDto, IHasServerId, IHasSyncInfo
- {
- /// <summary>
- /// Id of the recording.
- /// </summary>
- public string Id { get; set; }
-
- /// <summary>
- /// Gets or sets the primary image aspect ratio.
- /// </summary>
- /// <value>The primary image aspect ratio.</value>
- public double? PrimaryImageAspectRatio { get; set; }
-
- /// <summary>
- /// Gets or sets the server identifier.
- /// </summary>
- /// <value>The server identifier.</value>
- public string ServerId { get; set; }
-
- /// <summary>
- /// Gets or sets the original primary image aspect ratio.
- /// </summary>
- /// <value>The original primary image aspect ratio.</value>
- public double? OriginalPrimaryImageAspectRatio { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether [supports synchronize].
- /// </summary>
- /// <value><c>null</c> if [supports synchronize] contains no value, <c>true</c> if [supports synchronize]; otherwise, <c>false</c>.</value>
- public bool? SupportsSync { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether this instance has synchronize job.
- /// </summary>
- /// <value><c>null</c> if [has synchronize job] contains no value, <c>true</c> if [has synchronize job]; otherwise, <c>false</c>.</value>
- public bool? HasSyncJob { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether this instance is synced.
- /// </summary>
- /// <value><c>null</c> if [is synced] contains no value, <c>true</c> if [is synced]; otherwise, <c>false</c>.</value>
- public bool? IsSynced { get; set; }
- /// <summary>
- /// Gets or sets the synchronize status.
- /// </summary>
- /// <value>The synchronize status.</value>
- public SyncJobItemStatus? SyncStatus { get; set; }
-
- /// <summary>
- /// Gets or sets the series timer identifier.
- /// </summary>
- /// <value>The series timer identifier.</value>
- public string SeriesTimerId { get; set; }
-
- /// <summary>
- /// Gets or sets the external identifier.
- /// </summary>
- /// <value>The external identifier.</value>
- public string ExternalId { get; set; }
-
- /// <summary>
- /// Gets or sets the program identifier.
- /// </summary>
- /// <value>The program identifier.</value>
- public string ProgramId { get; set; }
-
- /// <summary>
- /// ChannelId of the recording.
- /// </summary>
- public string ChannelId { get; set; }
-
- /// <summary>
- /// Gets or sets the play access.
- /// </summary>
- /// <value>The play access.</value>
- public PlayAccess PlayAccess { get; set; }
-
- /// <summary>
- /// Gets or sets the channel primary image tag.
- /// </summary>
- /// <value>The channel primary image tag.</value>
- public string ChannelPrimaryImageTag { get; set; }
-
- /// <summary>
- /// ChannelName of the recording.
- /// </summary>
- public string ChannelName { get; set; }
-
- /// <summary>
- /// Gets or sets the name of the service.
- /// </summary>
- /// <value>The name of the service.</value>
- public string ServiceName { get; set; }
-
- /// <summary>
- /// Name of the recording.
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the media streams.
- /// </summary>
- /// <value>The media streams.</value>
- public List<MediaStream> MediaStreams { get; set; }
-
- /// <summary>
- /// Gets or sets the path.
- /// </summary>
- /// <value>The path.</value>
- public string Path { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance can delete.
- /// </summary>
- /// <value><c>null</c> if [can delete] contains no value, <c>true</c> if [can delete]; otherwise, <c>false</c>.</value>
- public bool? CanDelete { get; set; }
-
- /// <summary>
- /// Overview of the recording.
- /// </summary>
- public string Overview { get; set; }
-
- /// <summary>
- /// The start date of the recording, in UTC.
- /// </summary>
- public DateTime StartDate { get; set; }
-
- /// <summary>
- /// The end date of the recording, in UTC.
- /// </summary>
- public DateTime EndDate { get; set; }
-
- /// <summary>
- /// Gets or sets the original air date.
- /// </summary>
- /// <value>The original air date.</value>
- public DateTime? OriginalAirDate { get; set; }
-
- /// <summary>
- /// Gets or sets the status.
- /// </summary>
- /// <value>The status.</value>
- public RecordingStatus Status { get; set; }
-
- /// <summary>
- /// Gets or sets the name of the status.
- /// </summary>
- /// <value>The name of the status.</value>
- public string StatusName { get; set; }
-
- /// <summary>
- /// Gets or sets the completion percentage.
- /// </summary>
- /// <value>The completion percentage.</value>
- public double? CompletionPercentage { get; set; }
-
- /// <summary>
- /// Genre of the program.
- /// </summary>
- public List<string> Genres { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is repeat.
- /// </summary>
- /// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
- public bool IsRepeat { get; set; }
-
- /// <summary>
- /// Gets or sets the episode title.
- /// </summary>
- /// <value>The episode title.</value>
- public string EpisodeTitle { get; set; }
-
- /// <summary>
- /// Gets or sets the run time ticks.
- /// </summary>
- /// <value>The run time ticks.</value>
- public long? RunTimeTicks { get; set; }
-
- /// <summary>
- /// Gets or sets the type of the media.
- /// </summary>
- /// <value>The type of the media.</value>
- public string MediaType { get; set; }
-
- /// <summary>
- /// Gets or sets the type of the channel.
- /// </summary>
- /// <value>The type of the channel.</value>
- public ChannelType ChannelType { get; set; }
-
- /// <summary>
- /// Gets or sets the official rating.
- /// </summary>
- /// <value>The official rating.</value>
- public string OfficialRating { get; set; }
-
- /// <summary>
- /// Gets or sets the community rating.
- /// </summary>
- /// <value>The community rating.</value>
- public float? CommunityRating { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is hd.
- /// </summary>
- /// <value><c>true</c> if this instance is hd; otherwise, <c>false</c>.</value>
- public bool? IsHD { get; set; }
-
- /// <summary>
- /// Gets or sets the audio.
- /// </summary>
- /// <value>The audio.</value>
- public ProgramAudio? Audio { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is movie.
- /// </summary>
- /// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
- public bool IsMovie { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is sports.
- /// </summary>
- /// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
- public bool IsSports { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is series.
- /// </summary>
- /// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
- public bool IsSeries { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is live.
- /// </summary>
- /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
- public bool IsLive { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is news.
- /// </summary>
- /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
- public bool IsNews { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is kids.
- /// </summary>
- /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
- public bool IsKids { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is premiere.
- /// </summary>
- /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
- public bool IsPremiere { get; set; }
-
- /// <summary>
- /// Gets or sets the image tags.
- /// </summary>
- /// <value>The image tags.</value>
- public Dictionary<ImageType, string> ImageTags { get; set; }
-
- /// <summary>
- /// Gets or sets the user data.
- /// </summary>
- /// <value>The user data.</value>
- public UserItemDataDto UserData { get; set; }
-
- /// <summary>
- /// Gets a value indicating whether this instance has primary image.
- /// </summary>
- /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
- [IgnoreDataMember]
- public bool HasPrimaryImage
- {
- get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Primary); }
- }
-
- /// <summary>
- /// Gets or sets the type.
- /// </summary>
- /// <value>The type.</value>
- public string Type { get; set; }
-
- /// <summary>
- /// Gets or sets the media sources.
- /// </summary>
- /// <value>The media sources.</value>
- public List<MediaSourceInfo> MediaSources { get; set; }
-
- public RecordingInfoDto()
- {
- Genres = new List<string>();
- ImageTags = new Dictionary<ImageType, string>();
- MediaSources = new List<MediaSourceInfo>();
- }
-
- public event PropertyChangedEventHandler PropertyChanged;
- }
-} \ No newline at end of file
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 340bd9462..c567c1f6a 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -262,7 +262,6 @@
<Compile Include="LiveTv\ProgramInfoDto.cs" />
<Compile Include="LiveTv\ProgramQuery.cs" />
<Compile Include="LiveTv\RecommendedProgramQuery.cs" />
- <Compile Include="LiveTv\RecordingGroupDto.cs" />
<Compile Include="LiveTv\RecordingGroupQuery.cs" />
<Compile Include="LiveTv\RecordingQuery.cs" />
<Compile Include="LiveTv\RecordingStatus.cs" />
@@ -299,7 +298,6 @@
<Compile Include="IO\IIsoMounter.cs" />
<Compile Include="LiveTv\ChannelType.cs" />
<Compile Include="LiveTv\LiveTvServiceInfo.cs" />
- <Compile Include="LiveTv\RecordingInfoDto.cs" />
<Compile Include="Net\WebSocketMessage.cs" />
<Compile Include="Net\WebSocketMessageType.cs" />
<Compile Include="Net\WebSocketState.cs" />
diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs
index 56cfff733..efa5a5217 100644
--- a/MediaBrowser.Model/Net/MimeTypes.cs
+++ b/MediaBrowser.Model/Net/MimeTypes.cs
@@ -1,4 +1,5 @@
-using System;
+using MediaBrowser.Model.Extensions;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -45,33 +46,50 @@ namespace MediaBrowser.Model.Net
".rec"
};
- private static readonly Dictionary<string, string> VideoFileExtensionsDictionary = VideoFileExtensions.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
+ private static Dictionary<string, string> GetVideoFileExtensionsDictionary()
+ {
+ Dictionary<string, string> dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+
+ foreach (string ext in VideoFileExtensions)
+ {
+ dict[ext] = ext;
+ }
+
+ return dict;
+ }
+
+ private static readonly Dictionary<string, string> VideoFileExtensionsDictionary = GetVideoFileExtensionsDictionary();
// http://en.wikipedia.org/wiki/Internet_media_type
// Add more as needed
- private static readonly Dictionary<string, string> MimeTypeLookup =
- new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
- {
- {".jpg", "image/jpeg"},
- {".jpeg", "image/jpeg"},
- {".tbn", "image/jpeg"},
- {".png", "image/png"},
- {".gif", "image/gif"},
- {".webp", "image/webp"},
- {".ico", "image/vnd.microsoft.icon"},
- {".mpg", "video/mpeg"},
- {".mpeg", "video/mpeg"},
- {".ogv", "video/ogg"},
- {".mov", "video/quicktime"},
- {".webm", "video/webm"},
- {".mkv", "video/x-matroska"},
- {".wmv", "video/x-ms-wmv"},
- {".flv", "video/x-flv"},
- {".avi", "video/x-msvideo"},
- {".asf", "video/x-ms-asf"},
- {".m4v", "video/x-m4v"}
- };
+ private static Dictionary<string, string> GetMimeTypeLookup()
+ {
+ Dictionary<string, string> dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+
+ dict.Add(".jpg", "image/jpeg");
+ dict.Add(".jpeg", "image/jpeg");
+ dict.Add(".tbn", "image/jpeg");
+ dict.Add(".png", "image/png");
+ dict.Add(".gif", "image/gif");
+ dict.Add(".webp", "image/webp");
+ dict.Add(".ico", "image/vnd.microsoft.icon");
+ dict.Add(".mpg", "video/mpeg");
+ dict.Add(".mpeg", "video/mpeg");
+ dict.Add(".ogv", "video/ogg");
+ dict.Add(".mov", "video/quicktime");
+ dict.Add(".webm", "video/webm");
+ dict.Add(".mkv", "video/x-matroska");
+ dict.Add(".wmv", "video/x-ms-wmv");
+ dict.Add(".flv", "video/x-flv");
+ dict.Add(".avi", "video/x-msvideo");
+ dict.Add(".asf", "video/x-ms-asf");
+ dict.Add(".m4v", "video/x-m4v");
+
+ return dict;
+ }
+
+ private static readonly Dictionary<string, string> MimeTypeLookup = GetMimeTypeLookup();
private static readonly Dictionary<string, string> ExtensionLookup = CreateExtensionLookup();
@@ -109,19 +127,19 @@ namespace MediaBrowser.Model.Net
}
// Type video
- if (ext.Equals(".3gp", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".3gp"))
{
return "video/3gpp";
}
- if (ext.Equals(".3g2", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".3g2"))
{
return "video/3gpp2";
}
- if (ext.Equals(".ts", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".ts"))
{
return "video/mp2t";
}
- if (ext.Equals(".mpd", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".mpd"))
{
return "video/vnd.mpeg.dash.mpd";
}
@@ -133,134 +151,154 @@ namespace MediaBrowser.Model.Net
}
// Type text
- if (ext.Equals(".css", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".css"))
{
return "text/css";
}
- if (ext.Equals(".csv", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".csv"))
{
return "text/csv";
}
- if (ext.Equals(".html", StringComparison.OrdinalIgnoreCase) || ext.Equals(".htm", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".html"))
+ {
+ return "text/html; charset=UTF-8";
+ }
+ if (StringHelper.EqualsIgnoreCase(ext, ".htm"))
{
return "text/html; charset=UTF-8";
}
- if (ext.Equals(".txt", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".txt"))
{
return "text/plain";
}
- if (ext.Equals(".xml", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".xml"))
{
return "application/xml";
}
// Type document
- if (ext.Equals(".pdf", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".pdf"))
{
return "application/pdf";
}
- if (ext.Equals(".mobi", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".mobi"))
{
return "application/x-mobipocket-ebook";
}
- if (ext.Equals(".epub", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".epub"))
+ {
+ return "application/epub+zip";
+ }
+ if (StringHelper.EqualsIgnoreCase(ext, ".cbz"))
{
return "application/epub+zip";
}
- if (ext.Equals(".cbz", StringComparison.OrdinalIgnoreCase) || ext.Equals(".cbr", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".cbr"))
{
- return "application/x-cdisplay";
+ return "application/epub+zip";
}
// Type audio
- if (ext.Equals(".mp3", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".mp3"))
{
return "audio/mpeg";
}
- if (ext.Equals(".m4a", StringComparison.OrdinalIgnoreCase) || ext.Equals(".aac", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".m4a"))
{
return "audio/mp4";
}
- if (ext.Equals(".webma", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".aac"))
+ {
+ return "audio/mp4";
+ }
+ if (StringHelper.EqualsIgnoreCase(ext, ".webma"))
{
return "audio/webm";
}
- if (ext.Equals(".wav", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".wav"))
{
return "audio/wav";
}
- if (ext.Equals(".wma", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".wma"))
{
return "audio/x-ms-wma";
}
- if (ext.Equals(".flac", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".flac"))
{
return "audio/flac";
}
- if (ext.Equals(".aac", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".aac"))
{
return "audio/x-aac";
}
- if (ext.Equals(".ogg", StringComparison.OrdinalIgnoreCase) || ext.Equals(".oga", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".ogg"))
+ {
+ return "audio/ogg";
+ }
+ if (StringHelper.EqualsIgnoreCase(ext, ".oga"))
{
return "audio/ogg";
}
// Playlists
- if (ext.Equals(".m3u8", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".m3u8"))
{
return "application/x-mpegURL";
}
// Misc
- if (ext.Equals(".dll", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".dll"))
{
return "application/octet-stream";
}
// Web
- if (ext.Equals(".js", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".js"))
{
return "application/x-javascript";
}
- if (ext.Equals(".json", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".json"))
{
return "application/json";
}
- if (ext.Equals(".map", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".map"))
{
return "application/x-javascript";
}
- if (ext.Equals(".woff", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".woff"))
{
return "font/woff";
}
- if (ext.Equals(".ttf", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".ttf"))
{
return "font/ttf";
}
- if (ext.Equals(".eot", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".eot"))
{
return "application/vnd.ms-fontobject";
}
- if (ext.Equals(".svg", StringComparison.OrdinalIgnoreCase) || ext.Equals(".svgz", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".svg"))
+ {
+ return "image/svg+xml";
+ }
+ if (StringHelper.EqualsIgnoreCase(ext, ".svgz"))
{
return "image/svg+xml";
}
- if (ext.Equals(".srt", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".srt"))
{
return "text/plain";
}
- if (ext.Equals(".vtt", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".vtt"))
{
return "text/vtt";
}
- if (ext.Equals(".ttml", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(ext, ".ttml"))
{
return "application/ttml+xml";
}
diff --git a/MediaBrowser.Providers/Movies/MovieDbSearch.cs b/MediaBrowser.Providers/Movies/MovieDbSearch.cs
index 8a59d7a1b..6fb795411 100644
--- a/MediaBrowser.Providers/Movies/MovieDbSearch.cs
+++ b/MediaBrowser.Providers/Movies/MovieDbSearch.cs
@@ -58,10 +58,13 @@ namespace MediaBrowser.Providers.Movies
var tmdbImageUrl = tmdbSettings.images.base_url + "original";
- var parsedName = _libraryManager.ParseName(name);
- var yearInName = parsedName.Year;
- name = parsedName.Name;
- year = year ?? yearInName;
+ if (!string.IsNullOrWhiteSpace(name))
+ {
+ var parsedName = _libraryManager.ParseName(name);
+ var yearInName = parsedName.Year;
+ name = parsedName.Name;
+ year = year ?? yearInName;
+ }
_logger.Info("MovieDbProvider: Finding id for item: " + name);
var language = idInfo.MetadataLanguage.ToLower();
diff --git a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
index 1ee2d86de..c79d04b4f 100644
--- a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
+++ b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Common.Net;
+using System.Linq;
+using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
@@ -52,28 +53,34 @@ namespace MediaBrowser.Providers.Omdb
var list = new List<RemoteSearchResult>();
var imdbId = searchInfo.GetProviderId(MetadataProviders.Imdb);
- if (!string.IsNullOrWhiteSpace(imdbId))
- {
- return list;
- }
var url = "http://www.omdbapi.com/?plot=short&r=json";
var name = searchInfo.Name;
var year = searchInfo.Year;
- var parsedName = _libraryManager.ParseName(name);
- var yearInName = parsedName.Year;
- name = parsedName.Name;
- year = year ?? yearInName;
-
- if (year.HasValue)
+ if (!string.IsNullOrWhiteSpace(name))
{
- url += "&y=" + year.Value.ToString(CultureInfo.InvariantCulture);
+ var parsedName = _libraryManager.ParseName(name);
+ var yearInName = parsedName.Year;
+ name = parsedName.Name;
+ year = year ?? yearInName;
}
+
+ if (string.IsNullOrWhiteSpace(imdbId))
+ {
+ if (year.HasValue)
+ {
+ url += "&y=" + year.Value.ToString(CultureInfo.InvariantCulture);
+ }
- url += "&t=" + WebUtility.UrlEncode(name);
- url += "&type=" + type;
+ url += "&t=" + WebUtility.UrlEncode(name);
+ url += "&type=" + type;
+ }
+ else
+ {
+ url += "&i=" + imdbId;
+ }
using (var stream = await _httpClient.Get(new HttpRequestOptions
{
@@ -81,7 +88,7 @@ namespace MediaBrowser.Providers.Omdb
ResourcePool = OmdbProvider.ResourcePool,
CancellationToken = cancellationToken,
CacheMode = CacheMode.Unconditional,
- CacheLength = TimeSpan.FromDays(7)
+ CacheLength = TimeSpan.FromDays(2)
}).ConfigureAwait(false))
{
@@ -145,33 +152,18 @@ namespace MediaBrowser.Providers.Omdb
Item = new Series()
};
- var searchResult = await GetSeriesImdbId(info, cancellationToken).ConfigureAwait(false);
- result.Item.Name = searchResult.Item4;
-
- if (!string.IsNullOrEmpty(searchResult.Item1))
- {
- result.Item.SetProviderId(MetadataProviders.Imdb, searchResult.Item1);
- }
-
- if (!string.IsNullOrEmpty(searchResult.Item2))
- {
- result.Item.SetProviderId(MetadataProviders.Tmdb, searchResult.Item2);
- }
-
- if (!string.IsNullOrEmpty(searchResult.Item3))
+ var imdbId = info.GetProviderId(MetadataProviders.Imdb);
+ if (string.IsNullOrWhiteSpace(imdbId))
{
- result.Item.SetProviderId(MetadataProviders.Tvdb, searchResult.Item3);
+ imdbId = await GetSeriesImdbId(info, cancellationToken).ConfigureAwait(false);
}
- var imdbId = result.Item.GetProviderId(MetadataProviders.Imdb);
-
if (!string.IsNullOrEmpty(imdbId))
{
result.Item.SetProviderId(MetadataProviders.Imdb, imdbId);
result.HasMetadata = true;
- await new OmdbProvider(_jsonSerializer, _httpClient).Fetch(result.Item, imdbId, cancellationToken)
- .ConfigureAwait(false);
+ await new OmdbProvider(_jsonSerializer, _httpClient).Fetch(result.Item, imdbId, cancellationToken).ConfigureAwait(false);
}
return result;
@@ -191,64 +183,34 @@ namespace MediaBrowser.Providers.Omdb
};
var imdbId = info.GetProviderId(MetadataProviders.Imdb);
-
- var searchResult = await GetMovieImdbId(info, cancellationToken).ConfigureAwait(false);
- result.Item.Name = searchResult.Item3;
-
if (string.IsNullOrWhiteSpace(imdbId))
{
- imdbId = searchResult.Item1;
-
- if (!string.IsNullOrEmpty(searchResult.Item2))
- {
- result.Item.SetProviderId(MetadataProviders.Tmdb, searchResult.Item2);
- }
+ imdbId = await GetMovieImdbId(info, cancellationToken).ConfigureAwait(false);
}
- if (!string.IsNullOrWhiteSpace(imdbId))
+ if (!string.IsNullOrEmpty(imdbId))
{
result.Item.SetProviderId(MetadataProviders.Imdb, imdbId);
result.HasMetadata = true;
- await new OmdbProvider(_jsonSerializer, _httpClient).Fetch(result.Item, imdbId, cancellationToken)
- .ConfigureAwait(false);
+ await new OmdbProvider(_jsonSerializer, _httpClient).Fetch(result.Item, imdbId, cancellationToken).ConfigureAwait(false);
}
return result;
}
- private async Task<Tuple<string, string, string>> GetMovieImdbId(ItemLookupInfo info, CancellationToken cancellationToken)
+ private async Task<string> GetMovieImdbId(ItemLookupInfo info, CancellationToken cancellationToken)
{
- var result = await new GenericMovieDbInfo<Movie>(_logger, _jsonSerializer, _libraryManager).GetMetadata(info, cancellationToken)
- .ConfigureAwait(false);
-
- var imdb = result.HasMetadata ? result.Item.GetProviderId(MetadataProviders.Imdb) : null;
- var tmdb = result.HasMetadata ? result.Item.GetProviderId(MetadataProviders.Tmdb) : null;
- var name = result.HasMetadata ? result.Item.Name : null;
-
- return new Tuple<string, string, string>(imdb, tmdb, name);
+ var results = await GetSearchResults(info, "movie", cancellationToken).ConfigureAwait(false);
+ var first = results.FirstOrDefault();
+ return first == null ? null : first.GetProviderId(MetadataProviders.Imdb);
}
- private async Task<Tuple<string, string, string, string>> GetSeriesImdbId(SeriesInfo info, CancellationToken cancellationToken)
+ private async Task<string> GetSeriesImdbId(SeriesInfo info, CancellationToken cancellationToken)
{
- //var result = await TvdbSeriesProvider.Current.GetMetadata(info, cancellationToken)
- // .ConfigureAwait(false);
-
- //var imdb = result.HasMetadata ? result.Item.GetProviderId(MetadataProviders.Imdb) : null;
- //var tvdb = result.HasMetadata ? result.Item.GetProviderId(MetadataProviders.Tvdb) : null;
- //var name = result.HasMetadata ? result.Item.Name : null;
-
- //return new Tuple<string, string, string>(imdb, tvdb, name);
-
- var result = await MovieDbSeriesProvider.Current.GetMetadata(info, cancellationToken)
- .ConfigureAwait(false);
-
- var imdb = result.HasMetadata ? result.Item.GetProviderId(MetadataProviders.Imdb) : null;
- var tmdb = result.HasMetadata ? result.Item.GetProviderId(MetadataProviders.Tmdb) : null;
- var tvdb = result.HasMetadata ? result.Item.GetProviderId(MetadataProviders.Tvdb) : null;
- var name = result.HasMetadata ? result.Item.Name : null;
-
- return new Tuple<string, string, string, string>(imdb, tmdb, tvdb, name);
+ var results = await GetSearchResults(info, cancellationToken).ConfigureAwait(false);
+ var first = results.FirstOrDefault();
+ return first == null ? null : first.GetProviderId(MetadataProviders.Imdb);
}
public Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken)
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
index 1b55f47d5..cf56fc9ce 100644
--- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs
+++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
@@ -46,8 +46,9 @@ namespace MediaBrowser.Server.Implementations.Dto
private readonly IApplicationHost _appHost;
private readonly Func<IDeviceManager> _deviceManager;
private readonly Func<IMediaSourceManager> _mediaSourceManager;
+ private readonly Func<ILiveTvManager> _livetvManager;
- public DtoService(ILogger logger, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IImageProcessor imageProcessor, IServerConfigurationManager config, IFileSystem fileSystem, IProviderManager providerManager, Func<IChannelManager> channelManagerFactory, ISyncManager syncManager, IApplicationHost appHost, Func<IDeviceManager> deviceManager, Func<IMediaSourceManager> mediaSourceManager)
+ public DtoService(ILogger logger, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IImageProcessor imageProcessor, IServerConfigurationManager config, IFileSystem fileSystem, IProviderManager providerManager, Func<IChannelManager> channelManagerFactory, ISyncManager syncManager, IApplicationHost appHost, Func<IDeviceManager> deviceManager, Func<IMediaSourceManager> mediaSourceManager, Func<ILiveTvManager> livetvManager)
{
_logger = logger;
_libraryManager = libraryManager;
@@ -62,6 +63,7 @@ namespace MediaBrowser.Server.Implementations.Dto
_appHost = appHost;
_deviceManager = deviceManager;
_mediaSourceManager = mediaSourceManager;
+ _livetvManager = livetvManager;
}
/// <summary>
@@ -350,6 +352,11 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.Etag = item.GetEtag(user);
}
+ if (item is ILiveTvRecording)
+ {
+ _livetvManager().AddInfoToRecordingDto(item, dto, user);
+ }
+
return dto;
}
@@ -1384,7 +1391,7 @@ namespace MediaBrowser.Server.Implementations.Dto
{
dto.AirDays = series.AirDays;
dto.AirTime = series.AirTime;
- dto.Status = series.Status;
+ dto.SeriesStatus = series.Status;
dto.SeasonCount = series.SeasonCount;
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs
index 00c15fdfc..939d057cb 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs
@@ -167,122 +167,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
return val.Value;
}
- public string GetStatusName(RecordingStatus status)
- {
- if (status == RecordingStatus.InProgress)
- {
- return "In Progress";
- }
-
- if (status == RecordingStatus.ConflictedNotOk)
- {
- return "Conflicted";
- }
-
- if (status == RecordingStatus.ConflictedOk)
- {
- return "Scheduled";
- }
-
- return status.ToString();
- }
-
- public RecordingInfoDto GetRecordingInfoDto(ILiveTvRecording recording, LiveTvChannel channel, ILiveTvService service, User user = null)
- {
- var info = recording.RecordingInfo;
-
- var dto = new RecordingInfoDto
- {
- Id = GetInternalRecordingId(service.Name, info.Id).ToString("N"),
- SeriesTimerId = string.IsNullOrEmpty(info.SeriesTimerId) ? null : GetInternalSeriesTimerId(service.Name, info.SeriesTimerId).ToString("N"),
- Type = recording.GetClientTypeName(),
- Overview = info.Overview,
- EndDate = info.EndDate,
- Name = info.Name,
- StartDate = info.StartDate,
- ExternalId = info.Id,
- ChannelId = GetInternalChannelId(service.Name, info.ChannelId).ToString("N"),
- Status = info.Status,
- StatusName = GetStatusName(info.Status),
- Path = info.Path,
- Genres = info.Genres,
- IsRepeat = info.IsRepeat,
- EpisodeTitle = info.EpisodeTitle,
- ChannelType = info.ChannelType,
- MediaType = info.ChannelType == ChannelType.Radio ? MediaType.Audio : MediaType.Video,
- CommunityRating = GetClientCommunityRating(info.CommunityRating),
- OfficialRating = info.OfficialRating,
- Audio = info.Audio,
- IsHD = info.IsHD,
- ServiceName = service.Name,
- IsMovie = info.IsMovie,
- IsSeries = info.IsSeries,
- IsSports = info.IsSports,
- IsLive = info.IsLive,
- IsNews = info.IsNews,
- IsKids = info.IsKids,
- IsPremiere = info.IsPremiere,
- RunTimeTicks = (info.EndDate - info.StartDate).Ticks,
- OriginalAirDate = info.OriginalAirDate,
-
- MediaSources = recording.GetMediaSources(true).ToList(),
- ServerId = _appHost.SystemId
- };
-
- dto.CanDelete = user == null
- ? recording.CanDelete()
- : recording.CanDelete(user);
-
- dto.MediaStreams = dto.MediaSources.SelectMany(i => i.MediaStreams).ToList();
-
- if (info.Status == RecordingStatus.InProgress)
- {
- var now = DateTime.UtcNow.Ticks;
- var start = info.StartDate.Ticks;
- var end = info.EndDate.Ticks;
-
- var pct = now - start;
- pct /= end;
- pct *= 100;
- dto.CompletionPercentage = pct;
- }
-
- var imageTag = GetImageTag(recording);
-
- if (imageTag != null)
- {
- dto.ImageTags[ImageType.Primary] = imageTag;
- _dtoService.AttachPrimaryImageAspectRatio(dto, recording, new List<ItemFields>
- {
- ItemFields.PrimaryImageAspectRatio
- });
- }
-
- if (user != null)
- {
- dto.UserData = _userDataManager.GetUserDataDto(recording, user);
-
- dto.PlayAccess = recording.GetPlayAccess(user);
- }
-
- if (!string.IsNullOrEmpty(info.ProgramId))
- {
- dto.ProgramId = GetInternalProgramId(service.Name, info.ProgramId).ToString("N");
- }
-
- if (channel != null)
- {
- dto.ChannelName = channel.Name;
-
- if (!string.IsNullOrEmpty(channel.PrimaryImagePath))
- {
- dto.ChannelPrimaryImageTag = GetImageTag(channel);
- }
- }
-
- return dto;
- }
-
public LiveTvTunerInfoDto GetTunerInfoDto(string serviceName, LiveTvTunerInfo info, string channelName)
{
var dto = new LiveTvTunerInfoDto
@@ -430,7 +314,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
return dto;
}
- private string GetImageTag(IHasImages info)
+ internal string GetImageTag(IHasImages info)
{
try
{
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
index a82775de7..52c96bca6 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -119,11 +119,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{
var dict = new Dictionary<Guid, LiveTvProgram>();
- foreach (var item in _itemRepo.GetItemsOfType(typeof (LiveTvProgram))
+ foreach (var item in _itemRepo.GetItemsOfType(typeof(LiveTvProgram))
.Cast<LiveTvProgram>()
.ToList())
{
- dict[item.Id] = item;
+ dict[item.Id] = item;
}
_programs = dict;
@@ -658,7 +658,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var id = _tvDtoService.GetInternalRecordingId(serviceName, info.Id);
- var item = _itemRepo.RetrieveItem(id) as ILiveTvRecording;
+ var item = _itemRepo.RetrieveItem(id);
if (item == null)
{
@@ -687,8 +687,15 @@ namespace MediaBrowser.Server.Implementations.LiveTv
isNew = true;
}
- item.RecordingInfo = info;
- item.ServiceName = serviceName;
+ item.CommunityRating = info.CommunityRating;
+ item.OfficialRating = info.OfficialRating;
+ item.Overview = info.Overview;
+ item.EndDate = info.EndDate;
+
+ var recording = (ILiveTvRecording)item;
+
+ recording.RecordingInfo = info;
+ recording.ServiceName = serviceName;
var originalPath = item.Path;
@@ -709,9 +716,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv
}, cancellationToken);
- _libraryManager.RegisterItem((BaseItem)item);
+ _libraryManager.RegisterItem(item);
- return item;
+ return recording;
}
private LiveTvChannel GetChannel(LiveTvProgram program)
@@ -1355,20 +1362,89 @@ namespace MediaBrowser.Server.Implementations.LiveTv
};
}
- public async Task<QueryResult<RecordingInfoDto>> GetRecordings(RecordingQuery query, DtoOptions options, CancellationToken cancellationToken)
+ public void AddInfoToRecordingDto(BaseItem item, BaseItemDto dto, User user = null)
{
- var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
+ var recording = (ILiveTvRecording)item;
+ var service = GetService(recording);
- var internalResult = await GetInternalRecordings(query, cancellationToken).ConfigureAwait(false);
+ var channel = string.IsNullOrEmpty(recording.RecordingInfo.ChannelId) ? null : GetInternalChannel(_tvDtoService.GetInternalChannelId(service.Name, recording.RecordingInfo.ChannelId));
- var returnArray = internalResult.Items.Cast<ILiveTvRecording>()
- .Select(i =>
+ var info = recording.RecordingInfo;
+
+ dto.Id = _tvDtoService.GetInternalRecordingId(service.Name, info.Id).ToString("N");
+ dto.SeriesTimerId = string.IsNullOrEmpty(info.SeriesTimerId)
+ ? null
+ : _tvDtoService.GetInternalSeriesTimerId(service.Name, info.SeriesTimerId).ToString("N");
+
+ dto.ChannelId = _tvDtoService.GetInternalChannelId(service.Name, info.ChannelId).ToString("N");
+
+ dto.StartDate = info.StartDate;
+ dto.RecordingStatus = info.Status;
+ dto.IsRepeat = info.IsRepeat;
+ dto.EpisodeTitle = info.EpisodeTitle;
+ dto.ChannelType = info.ChannelType;
+ dto.Audio = info.Audio;
+ dto.IsHD = info.IsHD;
+ dto.IsMovie = info.IsMovie;
+ dto.IsSeries = info.IsSeries;
+ dto.IsSports = info.IsSports;
+ dto.IsLive = info.IsLive;
+ dto.IsNews = info.IsNews;
+ dto.IsKids = info.IsKids;
+ dto.IsPremiere = info.IsPremiere;
+ dto.RunTimeTicks = (info.EndDate - info.StartDate).Ticks;
+ dto.OriginalAirDate = info.OriginalAirDate;
+
+ dto.CanDelete = user == null
+ ? recording.CanDelete()
+ : recording.CanDelete(user);
+
+ if (dto.MediaSources == null)
+ {
+ dto.MediaSources = recording.GetMediaSources(true).ToList();
+ }
+
+ if (dto.MediaStreams == null)
+ {
+ dto.MediaStreams = dto.MediaSources.SelectMany(i => i.MediaStreams).ToList();
+ }
+
+ if (info.Status == RecordingStatus.InProgress)
+ {
+ var now = DateTime.UtcNow.Ticks;
+ var start = info.StartDate.Ticks;
+ var end = info.EndDate.Ticks;
+
+ var pct = now - start;
+ pct /= end;
+ pct *= 100;
+ dto.CompletionPercentage = pct;
+ }
+
+ if (!string.IsNullOrEmpty(info.ProgramId))
+ {
+ dto.ProgramId = _tvDtoService.GetInternalProgramId(service.Name, info.ProgramId).ToString("N");
+ }
+
+ if (channel != null)
+ {
+ dto.ChannelName = channel.Name;
+
+ if (!string.IsNullOrEmpty(channel.PrimaryImagePath))
{
- var service = GetService(i);
+ dto.ChannelPrimaryImageTag = _tvDtoService.GetImageTag(channel);
+ }
+ }
+ }
- var channel = string.IsNullOrEmpty(i.RecordingInfo.ChannelId) ? null : GetInternalChannel(_tvDtoService.GetInternalChannelId(service.Name, i.RecordingInfo.ChannelId));
- return _tvDtoService.GetRecordingInfoDto(i, channel, service, user);
- })
+ public async Task<QueryResult<BaseItemDto>> GetRecordings(RecordingQuery query, DtoOptions options, CancellationToken cancellationToken)
+ {
+ var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
+
+ var internalResult = await GetInternalRecordings(query, cancellationToken).ConfigureAwait(false);
+
+ var returnArray = internalResult.Items
+ .Select(i => _dtoService.GetBaseItemDto(i, options, user))
.ToArray();
if (user != null)
@@ -1376,7 +1452,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
_dtoService.FillSyncInfo(returnArray, new DtoOptions(), user);
}
- return new QueryResult<RecordingInfoDto>
+ return new QueryResult<BaseItemDto>
{
Items = returnArray,
TotalRecordCount = internalResult.TotalRecordCount
@@ -1448,10 +1524,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
public async Task DeleteRecording(string recordingId)
{
- var dtoOptions = new DtoOptions();
- dtoOptions.Fields.Remove(ItemFields.SyncInfo);
-
- var recording = await GetRecording(recordingId, dtoOptions, CancellationToken.None).ConfigureAwait(false);
+ var recording = await GetInternalRecording(recordingId, CancellationToken.None).ConfigureAwait(false);
if (recording == null)
{
@@ -1460,7 +1533,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var service = GetService(recording.ServiceName);
- await service.DeleteRecordingAsync(recording.ExternalId, CancellationToken.None).ConfigureAwait(false);
+ await service.DeleteRecordingAsync(recording.RecordingInfo.Id, CancellationToken.None).ConfigureAwait(false);
}
public async Task CancelTimer(string id)
@@ -1491,16 +1564,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
await service.CancelSeriesTimerAsync(timer.ExternalId, CancellationToken.None).ConfigureAwait(false);
}
- public async Task<RecordingInfoDto> GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null)
+ public async Task<BaseItemDto> GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null)
{
- var results = await GetRecordings(new RecordingQuery
- {
- UserId = user == null ? null : user.Id.ToString("N"),
- Id = id
+ var item = await GetInternalRecording(id, cancellationToken).ConfigureAwait(false);
- }, options, cancellationToken).ConfigureAwait(false);
+ if (item == null)
+ {
+ return null;
+ }
- return results.Items.FirstOrDefault();
+ return _dtoService.GetBaseItemDto((BaseItem)item, options, user);
}
public async Task<TimerInfoDto> GetTimer(string id, CancellationToken cancellationToken)
@@ -1776,60 +1849,57 @@ namespace MediaBrowser.Server.Implementations.LiveTv
.ToList();
}
- public async Task<QueryResult<RecordingGroupDto>> GetRecordingGroups(RecordingGroupQuery query, CancellationToken cancellationToken)
+ public async Task<QueryResult<BaseItemDto>> GetRecordingGroups(RecordingGroupQuery query, CancellationToken cancellationToken)
{
- var dtoOptions = new DtoOptions();
- dtoOptions.Fields.Remove(ItemFields.SyncInfo);
-
- var recordingResult = await GetRecordings(new RecordingQuery
+ var recordingResult = await GetInternalRecordings(new RecordingQuery
{
UserId = query.UserId
- }, dtoOptions, cancellationToken).ConfigureAwait(false);
+ }, cancellationToken).ConfigureAwait(false);
- var recordings = recordingResult.Items;
+ var recordings = recordingResult.Items.Cast<ILiveTvRecording>().ToList();
- var groups = new List<RecordingGroupDto>();
+ var groups = new List<BaseItemDto>();
var series = recordings
- .Where(i => i.IsSeries)
+ .Where(i => i.RecordingInfo.IsSeries)
.ToLookup(i => i.Name, StringComparer.OrdinalIgnoreCase)
.ToList();
- groups.AddRange(series.OrderByString(i => i.Key).Select(i => new RecordingGroupDto
+ groups.AddRange(series.OrderByString(i => i.Key).Select(i => new BaseItemDto
{
Name = i.Key,
RecordingCount = i.Count()
}));
- groups.Add(new RecordingGroupDto
+ groups.Add(new BaseItemDto
{
Name = "Kids",
- RecordingCount = recordings.Count(i => i.IsKids)
+ RecordingCount = recordings.Count(i => i.RecordingInfo.IsKids)
});
- groups.Add(new RecordingGroupDto
+ groups.Add(new BaseItemDto
{
Name = "Movies",
- RecordingCount = recordings.Count(i => i.IsMovie)
+ RecordingCount = recordings.Count(i => i.RecordingInfo.IsMovie)
});
- groups.Add(new RecordingGroupDto
+ groups.Add(new BaseItemDto
{
Name = "News",
- RecordingCount = recordings.Count(i => i.IsNews)
+ RecordingCount = recordings.Count(i => i.RecordingInfo.IsNews)
});
- groups.Add(new RecordingGroupDto
+ groups.Add(new BaseItemDto
{
Name = "Sports",
- RecordingCount = recordings.Count(i => i.IsSports)
+ RecordingCount = recordings.Count(i => i.RecordingInfo.IsSports)
});
- groups.Add(new RecordingGroupDto
+ groups.Add(new BaseItemDto
{
Name = "Others",
- RecordingCount = recordings.Count(i => !i.IsSports && !i.IsNews && !i.IsMovie && !i.IsKids && !i.IsSeries)
+ RecordingCount = recordings.Count(i => !i.RecordingInfo.IsSports && !i.RecordingInfo.IsNews && !i.RecordingInfo.IsMovie && !i.RecordingInfo.IsKids && !i.RecordingInfo.IsSeries)
});
groups = groups
@@ -1841,7 +1911,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
group.Id = group.Name.ToLower().GetMD5().ToString("N");
}
- return new QueryResult<RecordingGroupDto>
+ return new QueryResult<BaseItemDto>
{
Items = groups.ToArray(),
TotalRecordCount = groups.Count
diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
index c48de8797..286c7cd04 100644
--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
@@ -790,5 +790,6 @@
"OptionEnableFullscreen": "Enable Fullscreen",
"ButtonServer": "Server",
"HeaderAdmin": "Admin",
- "HeaderLibrary": "Library"
+ "HeaderLibrary": "Library",
+ "HeaderMedia": "Media"
}
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index 0c1452027..5625ef3be 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -50,6 +50,7 @@ using MediaBrowser.Dlna.Main;
using MediaBrowser.Dlna.MediaReceiverRegistrar;
using MediaBrowser.Dlna.Ssdp;
using MediaBrowser.LocalMetadata.Providers;
+using MediaBrowser.LocalMetadata.Savers;
using MediaBrowser.MediaEncoding.BdInfo;
using MediaBrowser.MediaEncoding.Encoder;
using MediaBrowser.MediaEncoding.Subtitles;
@@ -449,7 +450,7 @@ namespace MediaBrowser.Server.Startup.Common
SyncManager = new SyncManager(LibraryManager, SyncRepository, ImageProcessor, LogManager.GetLogger("SyncManager"), UserManager, () => DtoService, this, TVSeriesManager, () => MediaEncoder, FileSystemManager, () => SubtitleEncoder, ServerConfigurationManager, UserDataManager, () => MediaSourceManager, JsonSerializer);
RegisterSingleInstance(SyncManager);
- DtoService = new DtoService(LogManager.GetLogger("DtoService"), LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, SyncManager, this, () => DeviceManager, () => MediaSourceManager);
+ DtoService = new DtoService(LogManager.GetLogger("DtoService"), LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, SyncManager, this, () => DeviceManager, () => MediaSourceManager, () => LiveTvManager);
RegisterSingleInstance(DtoService);
var encryptionManager = new EncryptionManager();
@@ -989,7 +990,7 @@ namespace MediaBrowser.Server.Startup.Common
list.Add(typeof(DlnaEntryPoint).Assembly);
// Local metadata
- list.Add(typeof(AlbumXmlProvider).Assembly);
+ list.Add(typeof(BoxSetXmlSaver).Assembly);
// Xbmc
list.Add(typeof(ArtistNfoProvider).Assembly);