aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-31 15:12:58 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-31 15:12:58 -0400
commitef8a1ccecbacab4ef535bb3e74bcb285a9f583fd (patch)
tree62af02281c2f17ec392f4b9706bdcc62538a5603 /MediaBrowser.Model
parent25736b259a56ff11ca3b7298be023b87eb3fda99 (diff)
normalize program object
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/ApiClient/IApiClient.cs14
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs6
-rw-r--r--MediaBrowser.Model/LiveTv/ChannelInfoDto.cs2
-rw-r--r--MediaBrowser.Model/LiveTv/ProgramInfoDto.cs250
-rw-r--r--MediaBrowser.Model/LiveTv/TimerInfoDto.cs6
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj1
6 files changed, 14 insertions, 265 deletions
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs
index 71ac0b14e..e52e7535b 100644
--- a/MediaBrowser.Model/ApiClient/IApiClient.cs
+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs
@@ -930,14 +930,6 @@ namespace MediaBrowser.Model.ApiClient
string GetImageUrl(ChannelInfoDto 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>
/// Gets the subtitle URL.
/// </summary>
/// <param name="options">The options.</param>
@@ -1111,7 +1103,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{ProgramInfoDto}}.</returns>
- Task<QueryResult<ProgramInfoDto>> GetLiveTvProgramsAsync(ProgramQuery query, CancellationToken cancellationToken = default(CancellationToken));
+ Task<QueryResult<BaseItemDto>> GetLiveTvProgramsAsync(ProgramQuery query, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the live tv program asynchronous.
@@ -1120,7 +1112,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="userId">The user identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{ProgramInfoDto}.</returns>
- Task<ProgramInfoDto> GetLiveTvProgramAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken));
+ Task<BaseItemDto> GetLiveTvProgramAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the recommended live tv programs asynchronous.
@@ -1128,7 +1120,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{ProgramInfoDto}}.</returns>
- Task<QueryResult<ProgramInfoDto>> GetRecommendedLiveTvProgramsAsync(RecommendedProgramQuery query, CancellationToken cancellationToken = default(CancellationToken));
+ Task<QueryResult<BaseItemDto>> GetRecommendedLiveTvProgramsAsync(RecommendedProgramQuery query, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Creates the live tv timer asynchronous.
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index 0f6ce4334..fb157e9ae 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -1175,5 +1175,11 @@ namespace MediaBrowser.Model.Dto
/// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
public bool? IsPremiere { get; set; }
+ /// <summary>
+ /// Gets or sets the timer identifier.
+ /// </summary>
+ /// <value>The timer identifier.</value>
+ public string TimerId { get; set; }
+
}
}
diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
index 667ad4f14..fd901f29e 100644
--- a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
@@ -97,7 +97,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the now playing program.
/// </summary>
/// <value>The now playing program.</value>
- public ProgramInfoDto CurrentProgram { get; set; }
+ public BaseItemDto CurrentProgram { get; set; }
/// <summary>
/// Gets or sets the primary image aspect ratio, after image enhancements.
diff --git a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs b/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs
deleted file mode 100644
index 06136459f..000000000
--- a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Extensions;
-using MediaBrowser.Model.Library;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Runtime.Serialization;
-
-namespace MediaBrowser.Model.LiveTv
-{
- [DebuggerDisplay("Name = {Name}, StartTime = {StartDate}, EndTime = {EndDate}")]
- public class ProgramInfoDto : IHasPropertyChangedEvent, IItemDto, IHasServerId
- {
- /// <summary>
- /// Id of the program.
- /// </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 the type of the media.
- /// </summary>
- /// <value>The type of the media.</value>
- public string MediaType { get; set; }
-
- /// <summary>
- /// Gets or sets the timer identifier.
- /// </summary>
- /// <value>The timer identifier.</value>
- public string TimerId { 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 channel identifier.
- /// </summary>
- /// <value>The channel identifier.</value>
- public string ChannelId { 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>
- /// Gets or sets the play access.
- /// </summary>
- /// <value>The play access.</value>
- public PlayAccess PlayAccess { get; set; }
-
- /// <summary>
- /// Gets or sets the name of the channel.
- /// </summary>
- /// <value>The name of the channel.</value>
- public string ChannelName { get; set; }
-
- /// <summary>
- /// Gets or sets the community rating.
- /// </summary>
- /// <value>The community rating.</value>
- public float? CommunityRating { 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 production year.
- /// </summary>
- /// <value>The production year.</value>
- public int? ProductionYear { 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 program
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Overview of the recording.
- /// </summary>
- public string Overview { get; set; }
-
- /// <summary>
- /// The start date of the program, in UTC.
- /// </summary>
- public DateTime StartDate { get; set; }
-
- /// <summary>
- /// The end date of the program, in UTC.
- /// </summary>
- public DateTime EndDate { 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 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 the original air date.
- /// </summary>
- /// <value>The original air date.</value>
- public DateTime? OriginalAirDate { 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 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 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 the type.
- /// </summary>
- /// <value>The type.</value>
- public string Type { 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 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 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); }
- }
-
- public ProgramInfoDto()
- {
- Genres = new List<string>();
- ImageTags = new Dictionary<ImageType, string>();
- }
-
- public event PropertyChangedEventHandler PropertyChanged;
- }
-} \ No newline at end of file
diff --git a/MediaBrowser.Model/LiveTv/TimerInfoDto.cs b/MediaBrowser.Model/LiveTv/TimerInfoDto.cs
index 16cac945f..c33535a3d 100644
--- a/MediaBrowser.Model/LiveTv/TimerInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/TimerInfoDto.cs
@@ -1,4 +1,6 @@
-namespace MediaBrowser.Model.LiveTv
+using MediaBrowser.Model.Dto;
+
+namespace MediaBrowser.Model.LiveTv
{
public class TimerInfoDto : BaseTimerInfoDto
{
@@ -30,7 +32,7 @@
/// Gets or sets the program information.
/// </summary>
/// <value>The program information.</value>
- public ProgramInfoDto ProgramInfo { get; set; }
+ public BaseItemDto ProgramInfo { get; set; }
}
}
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index c567c1f6a..d134cb2e3 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -259,7 +259,6 @@
<Compile Include="LiveTv\LiveTvTunerInfoDto.cs" />
<Compile Include="LiveTv\LiveTvTunerStatus.cs" />
<Compile Include="LiveTv\ProgramAudio.cs" />
- <Compile Include="LiveTv\ProgramInfoDto.cs" />
<Compile Include="LiveTv\ProgramQuery.cs" />
<Compile Include="LiveTv\RecommendedProgramQuery.cs" />
<Compile Include="LiveTv\RecordingGroupQuery.cs" />