aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/ApiClient/ConnectSignupResponse.cs10
-rw-r--r--MediaBrowser.Model/ApiClient/IApiClient.cs30
-rw-r--r--MediaBrowser.Model/ApiClient/IConnectionManager.cs10
-rw-r--r--MediaBrowser.Model/Configuration/AutoOnOff.cs10
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs14
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs171
-rw-r--r--MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs6
-rw-r--r--MediaBrowser.Model/LiveTv/ChannelInfoDto.cs2
-rw-r--r--MediaBrowser.Model/LiveTv/ProgramInfoDto.cs250
-rw-r--r--MediaBrowser.Model/LiveTv/RecordingGroupDto.cs40
-rw-r--r--MediaBrowser.Model/LiveTv/RecordingInfoDto.cs313
-rw-r--r--MediaBrowser.Model/LiveTv/TimerInfoDto.cs6
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj5
-rw-r--r--MediaBrowser.Model/Net/MimeTypes.cs154
14 files changed, 323 insertions, 698 deletions
diff --git a/MediaBrowser.Model/ApiClient/ConnectSignupResponse.cs b/MediaBrowser.Model/ApiClient/ConnectSignupResponse.cs
new file mode 100644
index 000000000..a34165b23
--- /dev/null
+++ b/MediaBrowser.Model/ApiClient/ConnectSignupResponse.cs
@@ -0,0 +1,10 @@
+namespace MediaBrowser.Model.ApiClient
+{
+ public enum ConnectSignupResponse
+ {
+ Failure,
+ Success,
+ EmailInUse,
+ UsernameInUser
+ }
+}
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs
index 026e65ec4..e52e7535b 100644
--- a/MediaBrowser.Model/ApiClient/IApiClient.cs
+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs
@@ -930,22 +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(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>
/// Gets the subtitle URL.
/// </summary>
/// <param name="options">The options.</param>
@@ -1077,7 +1061,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 +1070,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 +1078,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 +1087,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.
@@ -1119,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.
@@ -1128,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.
@@ -1136,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/ApiClient/IConnectionManager.cs b/MediaBrowser.Model/ApiClient/IConnectionManager.cs
index f8837f15d..083f230bc 100644
--- a/MediaBrowser.Model/ApiClient/IConnectionManager.cs
+++ b/MediaBrowser.Model/ApiClient/IConnectionManager.cs
@@ -178,5 +178,15 @@ namespace MediaBrowser.Model.ApiClient
/// </summary>
/// <returns>Task&lt;List&lt;UserDto&gt;&gt;.</returns>
Task<List<UserDto>> GetOfflineUsers();
+
+ /// <summary>
+ /// Signups for connect.
+ /// </summary>
+ /// <param name="email">The email.</param>
+ /// <param name="username">The username.</param>
+ /// <param name="password">The password.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task.</returns>
+ Task<ConnectSignupResponse> SignupForConnect(string email, string username, string password, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/MediaBrowser.Model/Configuration/AutoOnOff.cs b/MediaBrowser.Model/Configuration/AutoOnOff.cs
new file mode 100644
index 000000000..e911a0ff1
--- /dev/null
+++ b/MediaBrowser.Model/Configuration/AutoOnOff.cs
@@ -0,0 +1,10 @@
+
+namespace MediaBrowser.Model.Configuration
+{
+ public enum AutoOnOff
+ {
+ Auto,
+ Enabled,
+ Disabled
+ }
+}
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index a0a7fc90d..e7490b3fa 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -187,7 +187,6 @@ namespace MediaBrowser.Model.Configuration
public bool EnableAutomaticRestart { get; set; }
- public bool EnableRealtimeMonitor { get; set; }
public PathSubstitution[] PathSubstitutions { get; set; }
public string ServerName { get; set; }
@@ -208,6 +207,10 @@ namespace MediaBrowser.Model.Configuration
public bool EnableVideoArchiveFiles { get; set; }
public int RemoteClientBitrateLimit { get; set; }
+ public bool DenyIFrameEmbedding { get; set; }
+
+ public AutoOnOff EnableLibraryMonitor { get; set; }
+
/// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
/// </summary>
@@ -224,6 +227,7 @@ namespace MediaBrowser.Model.Configuration
EnableDashboardResourceMinification = true;
EnableAutomaticRestart = true;
+ DenyIFrameEmbedding = true;
EnableUPnP = true;
@@ -233,6 +237,7 @@ namespace MediaBrowser.Model.Configuration
// 5 minutes
MinResumeDurationSeconds = 300;
+ EnableLibraryMonitor = AutoOnOff.Auto;
RealtimeLibraryMonitorDelay = 40;
EnableInternetProviders = true;
@@ -250,8 +255,6 @@ namespace MediaBrowser.Model.Configuration
SeasonZeroDisplayName = "Specials";
- EnableRealtimeMonitor = true;
-
UICulture = "en-us";
PeopleMetadataOptions = new PeopleMetadataOptions();
@@ -426,7 +429,10 @@ namespace MediaBrowser.Model.Configuration
}
},
- new MetadataOptions(0, 1280) {ItemType = "Season"}
+ new MetadataOptions(0, 1280)
+ {
+ ItemType = "Season"
+ }
};
}
}
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index c772692a2..7c5d9e9a1 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;
@@ -99,6 +100,11 @@ namespace MediaBrowser.Model.Dto
/// </summary>
/// <value>The synchronize status.</value>
public SyncJobItemStatus? SyncStatus { get; set; }
+ /// <summary>
+ /// Gets or sets the synchronize percent.
+ /// </summary>
+ /// <value>The synchronize percent.</value>
+ public double? SyncPercent { get; set; }
/// <summary>
/// Gets or sets the DVD season number.
@@ -442,7 +448,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 +854,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 +1084,107 @@ 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; }
+
+ /// <summary>
+ /// Gets or sets the timer identifier.
+ /// </summary>
+ /// <value>The timer identifier.</value>
+ public string TimerId { 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/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/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/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 340bd9462..3daacdd73 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -64,6 +64,7 @@
<Compile Include="ApiClient\ConnectionMode.cs" />
<Compile Include="ApiClient\ConnectionResult.cs" />
<Compile Include="ApiClient\ConnectionState.cs" />
+ <Compile Include="ApiClient\ConnectSignupResponse.cs" />
<Compile Include="ApiClient\HttpResponseEventArgs.cs" />
<Compile Include="ApiClient\IApiClient.cs" />
<Compile Include="ApiClient\ApiClientExtensions.cs" />
@@ -95,6 +96,7 @@
<Compile Include="Chapters\RemoteChapterResult.cs" />
<Compile Include="Collections\CollectionCreationResult.cs" />
<Compile Include="Configuration\AccessSchedule.cs" />
+ <Compile Include="Configuration\AutoOnOff.cs" />
<Compile Include="Configuration\ChannelOptions.cs" />
<Compile Include="Configuration\ChapterOptions.cs" />
<Compile Include="Configuration\CinemaModeConfiguration.cs" />
@@ -259,10 +261,8 @@
<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\RecordingGroupDto.cs" />
<Compile Include="LiveTv\RecordingGroupQuery.cs" />
<Compile Include="LiveTv\RecordingQuery.cs" />
<Compile Include="LiveTv\RecordingStatus.cs" />
@@ -299,7 +299,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";
}