diff options
| author | 7illusions <z@7illusions.com> | 2014-05-12 16:55:07 +0200 |
|---|---|---|
| committer | 7illusions <z@7illusions.com> | 2014-05-12 16:55:07 +0200 |
| commit | baf5cf2544fcaad2246923f60caaf3fed4a94aaf (patch) | |
| tree | a808b700095f876e437b95c432c0220e241f9fda /MediaBrowser.Model | |
| parent | 8f3a6279e173dcbaaa05a56556afb410ee12dd4d (diff) | |
| parent | b9b568de13d81f9db1a8502d50940475c1d79c72 (diff) | |
Merge pull request #3 from MediaBrowser/master
Sync with Master
Diffstat (limited to 'MediaBrowser.Model')
175 files changed, 2983 insertions, 2434 deletions
diff --git a/MediaBrowser.Model/ApiClient/GeneralCommandEventArgs.cs b/MediaBrowser.Model/ApiClient/GeneralCommandEventArgs.cs new file mode 100644 index 000000000..ce518a7cc --- /dev/null +++ b/MediaBrowser.Model/ApiClient/GeneralCommandEventArgs.cs @@ -0,0 +1,23 @@ +using MediaBrowser.Model.Session; +using System; + +namespace MediaBrowser.Model.ApiClient +{ + /// <summary> + /// Class SystemCommandEventArgs + /// </summary> + public class GeneralCommandEventArgs : EventArgs + { + /// <summary> + /// Gets or sets the command. + /// </summary> + /// <value>The command.</value> + public GeneralCommand Command { get; set; } + + /// <summary> + /// Gets or sets the type of the known command. + /// </summary> + /// <value>The type of the known command.</value> + public GeneralCommandType? KnownCommandType { get; set; } + } +} diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index dd1603d01..e12a6cf2b 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -138,7 +138,7 @@ namespace MediaBrowser.Model.ApiClient /// <param name="notificationIdList">The notification id list.</param> /// <param name="isRead">if set to <c>true</c> [is read].</param> /// <returns>Task.</returns> - Task MarkNotificationsRead(string userId, IEnumerable<Guid> notificationIdList, bool isRead); + Task MarkNotificationsRead(string userId, IEnumerable<string> notificationIdList, bool isRead); /// <summary> /// Gets the notifications summary. @@ -447,7 +447,7 @@ namespace MediaBrowser.Model.ApiClient /// <param name="id">The id.</param> /// <returns>Task{TaskInfo}.</returns> /// <exception cref="ArgumentNullException">id</exception> - Task<TaskInfo> GetScheduledTaskAsync(Guid id); + Task<TaskInfo> GetScheduledTaskAsync(string id); /// <summary> /// Gets a user by id @@ -582,6 +582,38 @@ namespace MediaBrowser.Model.ApiClient Task SendCommandAsync(string sessionId, GeneralCommand command); /// <summary> + /// Sends the string. + /// </summary> + /// <param name="sessionId">The session identifier.</param> + /// <param name="text">The text.</param> + /// <returns>Task.</returns> + Task SendString(string sessionId, string text); + + /// <summary> + /// Sets the volume. + /// </summary> + /// <param name="sessionId">The session identifier.</param> + /// <param name="volume">The volume.</param> + /// <returns>Task.</returns> + Task SetVolume(string sessionId, int volume); + + /// <summary> + /// Sets the index of the audio stream. + /// </summary> + /// <param name="sessionId">The session identifier.</param> + /// <param name="index">The index.</param> + /// <returns>Task.</returns> + Task SetAudioStreamIndex(string sessionId, int index); + + /// <summary> + /// Sets the index of the subtitle stream. + /// </summary> + /// <param name="sessionId">The session identifier.</param> + /// <param name="index">The index.</param> + /// <returns>Task.</returns> + Task SetSubtitleStreamIndex(string sessionId, int? index); + + /// <summary> /// Instructs the client to display a message to the user /// </summary> /// <param name="sessionId">The session id.</param> @@ -632,7 +664,7 @@ namespace MediaBrowser.Model.ApiClient /// <param name="triggers">The triggers.</param> /// <returns>Task{RequestResult}.</returns> /// <exception cref="ArgumentNullException">id</exception> - Task UpdateScheduledTaskTriggersAsync(Guid id, TaskTriggerInfo[] triggers); + Task UpdateScheduledTaskTriggersAsync(string id, TaskTriggerInfo[] triggers); /// <summary> /// Gets the display preferences. @@ -760,7 +792,7 @@ namespace MediaBrowser.Model.ApiClient /// </summary> /// <param name="options">The options.</param> /// <returns>System.String.</returns> - string GetSubtitleUrl(SubtitleOptions options); + string GetSubtitleUrl(SubtitleDownloadOptions options); /// <summary> /// Gets an image url that can be used to download an image from the api @@ -893,30 +925,6 @@ namespace MediaBrowser.Model.ApiClient string GetThumbImageUrl(BaseItemDto item, ImageOptions options); /// <summary> - /// Gets the url needed to stream an audio file - /// </summary> - /// <param name="options">The options.</param> - /// <returns>System.String.</returns> - /// <exception cref="ArgumentNullException">options</exception> - string GetAudioStreamUrl(StreamOptions options); - - /// <summary> - /// Gets the url needed to stream a video file - /// </summary> - /// <param name="options">The options.</param> - /// <returns>System.String.</returns> - /// <exception cref="ArgumentNullException">options</exception> - string GetVideoStreamUrl(VideoStreamOptions options); - - /// <summary> - /// Formulates a url for streaming video using the HLS protocol - /// </summary> - /// <param name="options">The options.</param> - /// <returns>System.String.</returns> - /// <exception cref="ArgumentNullException">options</exception> - string GetHlsVideoStreamUrl(VideoStreamOptions options); - - /// <summary> /// Gets the live tv information asynchronous. /// </summary> /// <param name="cancellationToken">The cancellation token.</param> diff --git a/MediaBrowser.Model/ApiClient/IServerEvents.cs b/MediaBrowser.Model/ApiClient/IServerEvents.cs index e13f3cc2c..62d8fdff3 100644 --- a/MediaBrowser.Model/ApiClient/IServerEvents.cs +++ b/MediaBrowser.Model/ApiClient/IServerEvents.cs @@ -1,4 +1,11 @@ -using System; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Events; +using MediaBrowser.Model.Plugins; +using MediaBrowser.Model.Session; +using MediaBrowser.Model.Tasks; +using MediaBrowser.Model.Updates; +using System; namespace MediaBrowser.Model.ApiClient { @@ -10,59 +17,55 @@ namespace MediaBrowser.Model.ApiClient /// <summary> /// Occurs when [user deleted]. /// </summary> - event EventHandler<UserDeletedEventArgs> UserDeleted; - /// <summary> - /// Occurs when [scheduled task started]. - /// </summary> - event EventHandler<ScheduledTaskStartedEventArgs> ScheduledTaskStarted; + event EventHandler<GenericEventArgs<string>> UserDeleted; /// <summary> /// Occurs when [scheduled task ended]. /// </summary> - event EventHandler<ScheduledTaskEndedEventArgs> ScheduledTaskEnded; + event EventHandler<GenericEventArgs<TaskResult>> ScheduledTaskEnded; /// <summary> /// Occurs when [package installing]. /// </summary> - event EventHandler<PackageInstallationEventArgs> PackageInstalling; + event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstalling; /// <summary> /// Occurs when [package installation failed]. /// </summary> - event EventHandler<PackageInstallationEventArgs> PackageInstallationFailed; + event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationFailed; /// <summary> /// Occurs when [package installation completed]. /// </summary> - event EventHandler<PackageInstallationEventArgs> PackageInstallationCompleted; + event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationCompleted; /// <summary> /// Occurs when [package installation cancelled]. /// </summary> - event EventHandler<PackageInstallationEventArgs> PackageInstallationCancelled; + event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationCancelled; /// <summary> /// Occurs when [user updated]. /// </summary> - event EventHandler<UserUpdatedEventArgs> UserUpdated; + event EventHandler<GenericEventArgs<UserDto>> UserUpdated; /// <summary> /// Occurs when [plugin uninstalled]. /// </summary> - event EventHandler<PluginUninstallEventArgs> PluginUninstalled; + event EventHandler<GenericEventArgs<PluginInfo>> PluginUninstalled; /// <summary> /// Occurs when [library changed]. /// </summary> - event EventHandler<LibraryChangedEventArgs> LibraryChanged; + event EventHandler<GenericEventArgs<LibraryUpdateInfo>> LibraryChanged; /// <summary> /// Occurs when [browse command]. /// </summary> - event EventHandler<BrowseRequestEventArgs> BrowseCommand; + event EventHandler<GenericEventArgs<BrowseRequest>> BrowseCommand; /// <summary> /// Occurs when [play command]. /// </summary> - event EventHandler<PlayRequestEventArgs> PlayCommand; + event EventHandler<GenericEventArgs<PlayRequest>> PlayCommand; /// <summary> /// Occurs when [playstate command]. /// </summary> - event EventHandler<PlaystateRequestEventArgs> PlaystateCommand; + event EventHandler<GenericEventArgs<PlaystateRequest>> PlaystateCommand; /// <summary> /// Occurs when [message command]. /// </summary> - event EventHandler<MessageCommandEventArgs> MessageCommand; + event EventHandler<GenericEventArgs<MessageCommand>> MessageCommand; /// <summary> /// Occurs when [system command]. /// </summary> @@ -88,6 +91,22 @@ namespace MediaBrowser.Model.ApiClient /// </summary> event EventHandler<EventArgs> ServerShuttingDown; /// <summary> + /// Occurs when [send text command]. + /// </summary> + event EventHandler<GenericEventArgs<string>> SendStringCommand; + /// <summary> + /// Occurs when [set volume command]. + /// </summary> + event EventHandler<GenericEventArgs<int>> SetVolumeCommand; + /// <summary> + /// Occurs when [set audio stream index command]. + /// </summary> + event EventHandler<GenericEventArgs<int>> SetAudioStreamIndexCommand; + /// <summary> + /// Occurs when [set video stream index command]. + /// </summary> + event EventHandler<GenericEventArgs<int>> SetSubtitleStreamIndexCommand; + /// <summary> /// Occurs when [sessions updated]. /// </summary> event EventHandler<SessionUpdatesEventArgs> SessionsUpdated; @@ -98,7 +117,7 @@ namespace MediaBrowser.Model.ApiClient /// <summary> /// Occurs when [user data changed]. /// </summary> - event EventHandler<UserDataChangedEventArgs> UserDataChanged; + event EventHandler<GenericEventArgs<UserDataChangeInfo>> UserDataChanged; /// <summary> /// Occurs when [connected]. /// </summary> diff --git a/MediaBrowser.Model/ApiClient/ServerEventArgs.cs b/MediaBrowser.Model/ApiClient/ServerEventArgs.cs deleted file mode 100644 index 6637edd74..000000000 --- a/MediaBrowser.Model/ApiClient/ServerEventArgs.cs +++ /dev/null @@ -1,177 +0,0 @@ -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Plugins; -using MediaBrowser.Model.Session; -using MediaBrowser.Model.Tasks; -using MediaBrowser.Model.Updates; -using System; - -namespace MediaBrowser.Model.ApiClient -{ - /// <summary> - /// Class UserDeletedEventArgs - /// </summary> - public class UserDeletedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the id. - /// </summary> - /// <value>The id.</value> - public string Id { get; set; } - } - - public class UserDataChangedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the user. - /// </summary> - /// <value>The user.</value> - public UserDataChangeInfo ChangeInfo { get; set; } - } - - /// <summary> - /// Class UserUpdatedEventArgs - /// </summary> - public class UserUpdatedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the user. - /// </summary> - /// <value>The user.</value> - public UserDto User { get; set; } - } - - /// <summary> - /// Class ScheduledTaskStartedEventArgs - /// </summary> - public class ScheduledTaskStartedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the name. - /// </summary> - /// <value>The name.</value> - public string Name { get; set; } - } - - /// <summary> - /// Class ScheduledTaskEndedEventArgs - /// </summary> - public class ScheduledTaskEndedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the result. - /// </summary> - /// <value>The result.</value> - public TaskResult Result { get; set; } - } - - /// <summary> - /// Class PackageInstallationEventArgs - /// </summary> - public class PackageInstallationEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the installation info. - /// </summary> - /// <value>The installation info.</value> - public InstallationInfo InstallationInfo { get; set; } - } - - /// <summary> - /// Class PluginUninstallEventArgs - /// </summary> - public class PluginUninstallEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the plugin info. - /// </summary> - /// <value>The plugin info.</value> - public PluginInfo PluginInfo { get; set; } - } - - /// <summary> - /// Class LibraryChangedEventArgs - /// </summary> - public class LibraryChangedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the update info. - /// </summary> - /// <value>The update info.</value> - public LibraryUpdateInfo UpdateInfo { get; set; } - } - - /// <summary> - /// Class BrowseRequestEventArgs - /// </summary> - public class BrowseRequestEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the request. - /// </summary> - /// <value>The request.</value> - public BrowseRequest Request { get; set; } - } - - /// <summary> - /// Class PlayRequestEventArgs - /// </summary> - public class PlayRequestEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the request. - /// </summary> - /// <value>The request.</value> - public PlayRequest Request { get; set; } - } - - /// <summary> - /// Class PlaystateRequestEventArgs - /// </summary> - public class PlaystateRequestEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the request. - /// </summary> - /// <value>The request.</value> - public PlaystateRequest Request { get; set; } - } - - /// <summary> - /// Class MessageCommandEventArgs - /// </summary> - public class MessageCommandEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the request. - /// </summary> - /// <value>The request.</value> - public MessageCommand Request { get; set; } - } - - /// <summary> - /// Class SystemCommandEventArgs - /// </summary> - public class GeneralCommandEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the command. - /// </summary> - /// <value>The command.</value> - public GeneralCommand Command { get; set; } - - /// <summary> - /// Gets or sets the type of the known command. - /// </summary> - /// <value>The type of the known command.</value> - public GeneralCommandType? KnownCommandType { get; set; } - } - - /// <summary> - /// Class SessionUpdatesEventArgs - /// </summary> - public class SessionUpdatesEventArgs : EventArgs - { - public SessionInfoDto[] Sessions { get; set; } - } -} diff --git a/MediaBrowser.Model/ApiClient/SessionUpdatesEventArgs.cs b/MediaBrowser.Model/ApiClient/SessionUpdatesEventArgs.cs new file mode 100644 index 000000000..483ee45d0 --- /dev/null +++ b/MediaBrowser.Model/ApiClient/SessionUpdatesEventArgs.cs @@ -0,0 +1,13 @@ +using System; +using MediaBrowser.Model.Session; + +namespace MediaBrowser.Model.ApiClient +{ + /// <summary> + /// Class SessionUpdatesEventArgs + /// </summary> + public class SessionUpdatesEventArgs : EventArgs + { + public SessionInfoDto[] Sessions { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Channels/ChannelItemQuery.cs b/MediaBrowser.Model/Channels/ChannelItemQuery.cs new file mode 100644 index 000000000..2da955e88 --- /dev/null +++ b/MediaBrowser.Model/Channels/ChannelItemQuery.cs @@ -0,0 +1,48 @@ +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Querying; + +namespace MediaBrowser.Model.Channels +{ + public class ChannelItemQuery + { + /// <summary> + /// Gets or sets the channel identifier. + /// </summary> + /// <value>The channel identifier.</value> + public string ChannelId { get; set; } + + /// <summary> + /// Gets or sets the category identifier. + /// </summary> + /// <value>The category identifier.</value> + public string CategoryId { get; set; } + + /// <summary> + /// Gets or sets the user identifier. + /// </summary> + /// <value>The user identifier.</value> + public string UserId { get; set; } + + /// <summary> + /// Skips over a given number of items within the results. Use for paging. + /// </summary> + /// <value>The start index.</value> + public int? StartIndex { get; set; } + + /// <summary> + /// The maximum number of items to return + /// </summary> + /// <value>The limit.</value> + public int? Limit { get; set; } + + public SortOrder? SortOrder { get; set; } + public string[] SortBy { get; set; } + public ItemFilter[] Filters { get; set; } + + public ChannelItemQuery() + { + Filters = new ItemFilter[] { }; + SortBy = new string[] { }; + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Channels/ChannelQuery.cs b/MediaBrowser.Model/Channels/ChannelQuery.cs index e09769b00..7c3f76fda 100644 --- a/MediaBrowser.Model/Channels/ChannelQuery.cs +++ b/MediaBrowser.Model/Channels/ChannelQuery.cs @@ -1,7 +1,4 @@ -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Querying; - -namespace MediaBrowser.Model.Channels +namespace MediaBrowser.Model.Channels { public class ChannelQuery { @@ -23,47 +20,4 @@ namespace MediaBrowser.Model.Channels /// <value>The limit.</value> public int? Limit { get; set; } } - - public class ChannelItemQuery - { - /// <summary> - /// Gets or sets the channel identifier. - /// </summary> - /// <value>The channel identifier.</value> - public string ChannelId { get; set; } - - /// <summary> - /// Gets or sets the category identifier. - /// </summary> - /// <value>The category identifier.</value> - public string CategoryId { get; set; } - - /// <summary> - /// Gets or sets the user identifier. - /// </summary> - /// <value>The user identifier.</value> - public string UserId { get; set; } - - /// <summary> - /// Skips over a given number of items within the results. Use for paging. - /// </summary> - /// <value>The start index.</value> - public int? StartIndex { get; set; } - - /// <summary> - /// The maximum number of items to return - /// </summary> - /// <value>The limit.</value> - public int? Limit { get; set; } - - public SortOrder? SortOrder { get; set; } - public string[] SortBy { get; set; } - public ItemFilter[] Filters { get; set; } - - public ChannelItemQuery() - { - Filters = new ItemFilter[] { }; - SortBy = new string[] { }; - } - } } diff --git a/MediaBrowser.Model/Chapters/RemoteChapterInfo.cs b/MediaBrowser.Model/Chapters/RemoteChapterInfo.cs new file mode 100644 index 000000000..f2674c842 --- /dev/null +++ b/MediaBrowser.Model/Chapters/RemoteChapterInfo.cs @@ -0,0 +1,18 @@ + +namespace MediaBrowser.Model.Chapters +{ + public class RemoteChapterInfo + { + /// <summary> + /// Gets or sets the start position ticks. + /// </summary> + /// <value>The start position ticks.</value> + public long StartPositionTicks { get; set; } + + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value>The name.</value> + public string Name { get; set; } + } +} diff --git a/MediaBrowser.Model/Chapters/RemoteChapterResult.cs b/MediaBrowser.Model/Chapters/RemoteChapterResult.cs new file mode 100644 index 000000000..3f627c8df --- /dev/null +++ b/MediaBrowser.Model/Chapters/RemoteChapterResult.cs @@ -0,0 +1,42 @@ + +namespace MediaBrowser.Model.Chapters +{ + public class RemoteChapterResult + { + /// <summary> + /// Gets or sets the identifier. + /// </summary> + /// <value>The identifier.</value> + public string Id { 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 name. + /// </summary> + /// <value>The name.</value> + public string Name { 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 chapter count. + /// </summary> + /// <value>The chapter count.</value> + public int? ChapterCount { get; set; } + + /// <summary> + /// Gets or sets the name of the three letter iso language. + /// </summary> + /// <value>The name of the three letter iso language.</value> + public string ThreeLetterISOLanguageName { get; set; } + } +} diff --git a/MediaBrowser.Model/Configuration/EncodingQuality.cs b/MediaBrowser.Model/Configuration/EncodingQuality.cs new file mode 100644 index 000000000..ba5a1f279 --- /dev/null +++ b/MediaBrowser.Model/Configuration/EncodingQuality.cs @@ -0,0 +1,10 @@ +namespace MediaBrowser.Model.Configuration +{ + public enum EncodingQuality + { + Auto, + HighSpeed, + HighQuality, + MaxQuality + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/ImageOption.cs b/MediaBrowser.Model/Configuration/ImageOption.cs new file mode 100644 index 000000000..ade0af83e --- /dev/null +++ b/MediaBrowser.Model/Configuration/ImageOption.cs @@ -0,0 +1,29 @@ +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Model.Configuration +{ + public class ImageOption + { + /// <summary> + /// Gets or sets the type. + /// </summary> + /// <value>The type.</value> + public ImageType Type { get; set; } + /// <summary> + /// Gets or sets the limit. + /// </summary> + /// <value>The limit.</value> + public int Limit { get; set; } + + /// <summary> + /// Gets or sets the minimum width. + /// </summary> + /// <value>The minimum width.</value> + public int MinWidth { get; set; } + + public ImageOption() + { + Limit = 1; + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/ImageSavingConvention.cs b/MediaBrowser.Model/Configuration/ImageSavingConvention.cs new file mode 100644 index 000000000..611678e67 --- /dev/null +++ b/MediaBrowser.Model/Configuration/ImageSavingConvention.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Configuration +{ + public enum ImageSavingConvention + { + Legacy, + Compatible + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/LiveTvOptions.cs b/MediaBrowser.Model/Configuration/LiveTvOptions.cs new file mode 100644 index 000000000..ae8aeb200 --- /dev/null +++ b/MediaBrowser.Model/Configuration/LiveTvOptions.cs @@ -0,0 +1,7 @@ +namespace MediaBrowser.Model.Configuration +{ + public class LiveTvOptions + { + public int? GuideDays { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/MetadataOptions.cs b/MediaBrowser.Model/Configuration/MetadataOptions.cs index d666f6cce..fdfbbf4f4 100644 --- a/MediaBrowser.Model/Configuration/MetadataOptions.cs +++ b/MediaBrowser.Model/Configuration/MetadataOptions.cs @@ -30,7 +30,7 @@ namespace MediaBrowser.Model.Configuration public MetadataOptions(int backdropLimit, int minBackdropWidth) { - var imageOptions = new List<ImageOption> + List<ImageOption> imageOptions = new List<ImageOption> { new ImageOption { @@ -52,14 +52,30 @@ namespace MediaBrowser.Model.Configuration public int GetLimit(ImageType type) { - var option = ImageOptions.FirstOrDefault(i => i.Type == type); + ImageOption option = null; + foreach (ImageOption i in ImageOptions) + { + if (i.Type == type) + { + option = i; + break; + } + } return option == null ? 1 : option.Limit; } public int GetMinWidth(ImageType type) { - var option = ImageOptions.FirstOrDefault(i => i.Type == type); + ImageOption option = null; + foreach (ImageOption i in ImageOptions) + { + if (i.Type == type) + { + option = i; + break; + } + } return option == null ? 0 : option.MinWidth; } @@ -74,29 +90,4 @@ namespace MediaBrowser.Model.Configuration return !DisabledMetadataSavers.Contains(name, StringComparer.OrdinalIgnoreCase); } } - - public class ImageOption - { - /// <summary> - /// Gets or sets the type. - /// </summary> - /// <value>The type.</value> - public ImageType Type { get; set; } - /// <summary> - /// Gets or sets the limit. - /// </summary> - /// <value>The limit.</value> - public int Limit { get; set; } - - /// <summary> - /// Gets or sets the minimum width. - /// </summary> - /// <value>The minimum width.</value> - public int MinWidth { get; set; } - - public ImageOption() - { - Limit = 1; - } - } } diff --git a/MediaBrowser.Model/Configuration/MetadataPlugin.cs b/MediaBrowser.Model/Configuration/MetadataPlugin.cs index b019cf71a..f3e0ce106 100644 --- a/MediaBrowser.Model/Configuration/MetadataPlugin.cs +++ b/MediaBrowser.Model/Configuration/MetadataPlugin.cs @@ -1,7 +1,4 @@ -using MediaBrowser.Model.Entities; -using System.Collections.Generic; - -namespace MediaBrowser.Model.Configuration +namespace MediaBrowser.Model.Configuration { public class MetadataPlugin { @@ -17,44 +14,4 @@ namespace MediaBrowser.Model.Configuration /// <value>The type.</value> public MetadataPluginType Type { get; set; } } - - public class MetadataPluginSummary - { - /// <summary> - /// Gets or sets the type of the item. - /// </summary> - /// <value>The type of the item.</value> - public string ItemType { get; set; } - - /// <summary> - /// Gets or sets the plugins. - /// </summary> - /// <value>The plugins.</value> - public List<MetadataPlugin> Plugins { get; set; } - - /// <summary> - /// Gets or sets the supported image types. - /// </summary> - /// <value>The supported image types.</value> - public List<ImageType> SupportedImageTypes { get; set; } - - public MetadataPluginSummary() - { - SupportedImageTypes = new List<ImageType>(); - Plugins = new List<MetadataPlugin>(); - } - } - - /// <summary> - /// Enum MetadataPluginType - /// </summary> - public enum MetadataPluginType - { - LocalImageProvider, - ImageFetcher, - ImageSaver, - LocalMetadataProvider, - MetadataFetcher, - MetadataSaver - } } diff --git a/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs new file mode 100644 index 000000000..90b3933eb --- /dev/null +++ b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Model.Configuration +{ + public class MetadataPluginSummary + { + /// <summary> + /// Gets or sets the type of the item. + /// </summary> + /// <value>The type of the item.</value> + public string ItemType { get; set; } + + /// <summary> + /// Gets or sets the plugins. + /// </summary> + /// <value>The plugins.</value> + public List<MetadataPlugin> Plugins { get; set; } + + /// <summary> + /// Gets or sets the supported image types. + /// </summary> + /// <value>The supported image types.</value> + public List<ImageType> SupportedImageTypes { get; set; } + + public MetadataPluginSummary() + { + SupportedImageTypes = new List<ImageType>(); + Plugins = new List<MetadataPlugin>(); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/MetadataPluginType.cs b/MediaBrowser.Model/Configuration/MetadataPluginType.cs new file mode 100644 index 000000000..95ca3b2e6 --- /dev/null +++ b/MediaBrowser.Model/Configuration/MetadataPluginType.cs @@ -0,0 +1,15 @@ +namespace MediaBrowser.Model.Configuration +{ + /// <summary> + /// Enum MetadataPluginType + /// </summary> + public enum MetadataPluginType + { + LocalImageProvider, + ImageFetcher, + ImageSaver, + LocalMetadataProvider, + MetadataFetcher, + MetadataSaver + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/NotificationOption.cs b/MediaBrowser.Model/Configuration/NotificationOption.cs new file mode 100644 index 000000000..5fcf3550c --- /dev/null +++ b/MediaBrowser.Model/Configuration/NotificationOption.cs @@ -0,0 +1,54 @@ +namespace MediaBrowser.Model.Configuration +{ + public class NotificationOption + { + public string Type { get; set; } + + /// <summary> + /// User Ids to not monitor (it's opt out) + /// </summary> + public string[] DisabledMonitorUsers { get; set; } + + /// <summary> + /// User Ids to send to (if SendToUserMode == Custom) + /// </summary> + public string[] SendToUsers { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this <see cref="NotificationOption"/> is enabled. + /// </summary> + /// <value><c>true</c> if enabled; otherwise, <c>false</c>.</value> + public bool Enabled { get; set; } + + /// <summary> + /// Gets or sets the title format string. + /// </summary> + /// <value>The title format string.</value> + public string Title { get; set; } + + /// <summary> + /// Gets or sets the description. + /// </summary> + /// <value>The description.</value> + public string Description { get; set; } + + /// <summary> + /// Gets or sets the disabled services. + /// </summary> + /// <value>The disabled services.</value> + public string[] DisabledServices { get; set; } + + /// <summary> + /// Gets or sets the send to user mode. + /// </summary> + /// <value>The send to user mode.</value> + public SendToUserType SendToUserMode { get; set; } + + public NotificationOption() + { + DisabledServices = new string[] { }; + DisabledMonitorUsers = new string[] { }; + SendToUsers = new string[] { }; + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/NotificationOptions.cs b/MediaBrowser.Model/Configuration/NotificationOptions.cs index fedc1c2f8..d6517e895 100644 --- a/MediaBrowser.Model/Configuration/NotificationOptions.cs +++ b/MediaBrowser.Model/Configuration/NotificationOptions.cs @@ -70,19 +70,23 @@ namespace MediaBrowser.Model.Configuration public NotificationOption GetOptions(string type) { - return Options.FirstOrDefault(i => string.Equals(type, i.Type, StringComparison.OrdinalIgnoreCase)); + foreach (NotificationOption i in Options) + { + if (string.Equals(type, i.Type, StringComparison.OrdinalIgnoreCase)) return i; + } + return null; } public bool IsEnabled(string type) { - var opt = GetOptions(type); + NotificationOption opt = GetOptions(type); return opt != null && opt.Enabled; } public bool IsServiceEnabled(string service, string notificationType) { - var opt = GetOptions(notificationType); + NotificationOption opt = GetOptions(notificationType); return opt == null || !opt.DisabledServices.Contains(service, StringComparer.OrdinalIgnoreCase); @@ -90,7 +94,7 @@ namespace MediaBrowser.Model.Configuration public bool IsEnabledToMonitorUser(string type, string userId) { - var opt = GetOptions(type); + NotificationOption opt = GetOptions(type); return opt != null && opt.Enabled && !opt.DisabledMonitorUsers.Contains(userId, StringComparer.OrdinalIgnoreCase); @@ -98,7 +102,7 @@ namespace MediaBrowser.Model.Configuration public bool IsEnabledToSendToUser(string type, string userId, UserConfiguration userConfig) { - var opt = GetOptions(type); + NotificationOption opt = GetOptions(type); if (opt != null && opt.Enabled) { @@ -118,80 +122,4 @@ namespace MediaBrowser.Model.Configuration return false; } } - - public class NotificationOption - { - public string Type { get; set; } - - /// <summary> - /// User Ids to not monitor (it's opt out) - /// </summary> - public string[] DisabledMonitorUsers { get; set; } - - /// <summary> - /// User Ids to send to (if SendToUserMode == Custom) - /// </summary> - public string[] SendToUsers { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this <see cref="NotificationOption"/> is enabled. - /// </summary> - /// <value><c>true</c> if enabled; otherwise, <c>false</c>.</value> - public bool Enabled { get; set; } - - /// <summary> - /// Gets or sets the title format string. - /// </summary> - /// <value>The title format string.</value> - public string Title { get; set; } - - /// <summary> - /// Gets or sets the description. - /// </summary> - /// <value>The description.</value> - public string Description { get; set; } - - /// <summary> - /// Gets or sets the disabled services. - /// </summary> - /// <value>The disabled services.</value> - public string[] DisabledServices { get; set; } - - /// <summary> - /// Gets or sets the send to user mode. - /// </summary> - /// <value>The send to user mode.</value> - public SendToUserType SendToUserMode { get; set; } - - public NotificationOption() - { - DisabledServices = new string[] { }; - DisabledMonitorUsers = new string[] { }; - SendToUsers = new string[] { }; - } - } - - public enum NotificationType - { - ApplicationUpdateAvailable, - ApplicationUpdateInstalled, - AudioPlayback, - GamePlayback, - InstallationFailed, - PluginError, - PluginInstalled, - PluginUpdateInstalled, - PluginUninstalled, - NewLibraryContent, - ServerRestartRequired, - TaskFailed, - VideoPlayback - } - - public enum SendToUserType - { - All = 0, - Admins = 1, - Custom = 2 - } } diff --git a/MediaBrowser.Model/Configuration/NotificationType.cs b/MediaBrowser.Model/Configuration/NotificationType.cs new file mode 100644 index 000000000..0ddcf4251 --- /dev/null +++ b/MediaBrowser.Model/Configuration/NotificationType.cs @@ -0,0 +1,20 @@ +namespace MediaBrowser.Model.Configuration +{ + public enum NotificationType + { + ApplicationUpdateAvailable, + ApplicationUpdateInstalled, + AudioPlayback, + GamePlayback, + InstallationFailed, + PluginError, + PluginInstalled, + PluginUpdateInstalled, + PluginUninstalled, + NewLibraryContent, + NewLibraryContentMultiple, + ServerRestartRequired, + TaskFailed, + VideoPlayback + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/PathSubstitution.cs b/MediaBrowser.Model/Configuration/PathSubstitution.cs new file mode 100644 index 000000000..576dd2d5a --- /dev/null +++ b/MediaBrowser.Model/Configuration/PathSubstitution.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Configuration +{ + public class PathSubstitution + { + public string From { get; set; } + public string To { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/SendToUserType.cs b/MediaBrowser.Model/Configuration/SendToUserType.cs new file mode 100644 index 000000000..a2eac4c2d --- /dev/null +++ b/MediaBrowser.Model/Configuration/SendToUserType.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.Configuration +{ + public enum SendToUserType + { + All = 0, + Admins = 1, + Custom = 2 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 0fb9db6c0..c19039439 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -221,6 +221,8 @@ namespace MediaBrowser.Model.Configuration public NotificationOptions NotificationOptions { get; set; } + public SubtitleOptions SubtitleOptions { get; set; } + /// <summary> /// Initializes a new instance of the <see cref="ServerConfiguration" /> class. /// </summary> @@ -269,7 +271,7 @@ namespace MediaBrowser.Model.Configuration EnableRealtimeMonitor = true; - var options = new List<MetadataOptions> + List<MetadataOptions> options = new List<MetadataOptions> { new MetadataOptions(1, 1280) {ItemType = "Book"}, new MetadataOptions(1, 1280) {ItemType = "MusicAlbum"}, @@ -284,31 +286,8 @@ namespace MediaBrowser.Model.Configuration UICulture = "en-us"; NotificationOptions = new NotificationOptions(); - } - } - - public enum ImageSavingConvention - { - Legacy, - Compatible - } - - public enum EncodingQuality - { - Auto, - HighSpeed, - HighQuality, - MaxQuality - } - public class LiveTvOptions - { - public int? GuideDays { get; set; } - } - - public class PathSubstitution - { - public string From { get; set; } - public string To { get; set; } + SubtitleOptions = new SubtitleOptions(); + } } } diff --git a/MediaBrowser.Model/Configuration/SubtitleOptions.cs b/MediaBrowser.Model/Configuration/SubtitleOptions.cs new file mode 100644 index 000000000..96e04e511 --- /dev/null +++ b/MediaBrowser.Model/Configuration/SubtitleOptions.cs @@ -0,0 +1,21 @@ +namespace MediaBrowser.Model.Configuration +{ + public class SubtitleOptions + { + public bool SkipIfGraphicalSubtitlesPresent { get; set; } + public bool SkipIfAudioTrackMatches { get; set; } + public string[] DownloadLanguages { get; set; } + public bool DownloadMovieSubtitles { get; set; } + public bool DownloadEpisodeSubtitles { get; set; } + + public string OpenSubtitlesUsername { get; set; } + public string OpenSubtitlesPasswordHash { get; set; } + + public SubtitleOptions() + { + DownloadLanguages = new string[] { }; + + SkipIfAudioTrackMatches = true; + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/AutoOrganize.cs b/MediaBrowser.Model/Configuration/TvFileOrganizationOptions.cs index fe32d4a80..fe32d4a80 100644 --- a/MediaBrowser.Model/Configuration/AutoOrganize.cs +++ b/MediaBrowser.Model/Configuration/TvFileOrganizationOptions.cs diff --git a/MediaBrowser.Model/Configuration/UnratedItem.cs b/MediaBrowser.Model/Configuration/UnratedItem.cs new file mode 100644 index 000000000..1082d684b --- /dev/null +++ b/MediaBrowser.Model/Configuration/UnratedItem.cs @@ -0,0 +1,16 @@ +namespace MediaBrowser.Model.Configuration +{ + public enum UnratedItem + { + Movie, + Trailer, + Series, + Music, + Game, + Book, + LiveTvChannel, + LiveTvProgram, + ChannelContent, + Other + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/UserConfiguration.cs b/MediaBrowser.Model/Configuration/UserConfiguration.cs index f8df19436..2658e8973 100644 --- a/MediaBrowser.Model/Configuration/UserConfiguration.cs +++ b/MediaBrowser.Model/Configuration/UserConfiguration.cs @@ -79,18 +79,4 @@ namespace MediaBrowser.Model.Configuration BlockUnratedItems = new UnratedItem[] { }; } } - - public enum UnratedItem - { - Movie, - Trailer, - Series, - Music, - Game, - Book, - LiveTvChannel, - LiveTvProgram, - ChannelContent, - Other - } } diff --git a/MediaBrowser.Model/Dlna/AudioOptions.cs b/MediaBrowser.Model/Dlna/AudioOptions.cs new file mode 100644 index 000000000..d04133a3d --- /dev/null +++ b/MediaBrowser.Model/Dlna/AudioOptions.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using MediaBrowser.Model.Dto; + +namespace MediaBrowser.Model.Dlna +{ + /// <summary> + /// Class AudioOptions. + /// </summary> + public class AudioOptions + { + public string ItemId { get; set; } + public List<MediaSourceInfo> MediaSources { get; set; } + public DeviceProfile Profile { get; set; } + + /// <summary> + /// Optional. Only needed if a specific AudioStreamIndex or SubtitleStreamIndex are requested. + /// </summary> + public string MediaSourceId { get; set; } + + public string DeviceId { get; set; } + + /// <summary> + /// Allows an override of supported number of audio channels + /// Example: DeviceProfile supports five channel, but user only has stereo speakers + /// </summary> + public int? MaxAudioChannels { get; set; } + + /// <summary> + /// The application's configured quality setting + /// </summary> + public int? MaxBitrate { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs index 2b04b7fdb..3e67b49f9 100644 --- a/MediaBrowser.Model/Dlna/CodecProfile.cs +++ b/MediaBrowser.Model/Dlna/CodecProfile.cs @@ -22,66 +22,19 @@ namespace MediaBrowser.Model.Dlna public List<string> GetCodecs() { - return (Codec ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (Codec ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; } public bool ContainsCodec(string codec) { - var codecs = GetCodecs(); + List<string> codecs = GetCodecs(); return codecs.Count == 0 || codecs.Contains(codec, StringComparer.OrdinalIgnoreCase); } } - - public enum CodecType - { - Video = 0, - VideoAudio = 1, - Audio = 2 - } - - public class ProfileCondition - { - [XmlAttribute("condition")] - public ProfileConditionType Condition { get; set; } - - [XmlAttribute("property")] - public ProfileConditionValue Property { get; set; } - - [XmlAttribute("value")] - public string Value { get; set; } - - [XmlAttribute("isRequired")] - public bool IsRequired { get; set; } - - public ProfileCondition() - { - IsRequired = true; - } - } - - public enum ProfileConditionType - { - Equals = 0, - NotEquals = 1, - LessThanEqual = 2, - GreaterThanEqual = 3 - } - - public enum ProfileConditionValue - { - AudioChannels, - AudioBitrate, - AudioProfile, - Width, - Height, - Has64BitOffsets, - PacketLength, - VideoBitDepth, - VideoBitrate, - VideoFramerate, - VideoLevel, - VideoProfile, - VideoTimestamp - } } diff --git a/MediaBrowser.Model/Dlna/CodecType.cs b/MediaBrowser.Model/Dlna/CodecType.cs new file mode 100644 index 000000000..415cae7ac --- /dev/null +++ b/MediaBrowser.Model/Dlna/CodecType.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.Dlna +{ + public enum CodecType + { + Video = 0, + VideoAudio = 1, + Audio = 2 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index 27c4850e8..488d742f5 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -136,7 +136,7 @@ namespace MediaBrowser.Model.Dlna return !condition.IsRequired; } - var expected = condition.Value; + string expected = condition.Value; switch (condition.Condition) { @@ -186,7 +186,7 @@ namespace MediaBrowser.Model.Dlna return !condition.IsRequired; } - var expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true); + TransportStreamTimestamp expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true); switch (condition.Condition) { diff --git a/MediaBrowser.Model/Dlna/ContainerProfile.cs b/MediaBrowser.Model/Dlna/ContainerProfile.cs index 3a5fe3bd5..931194dd3 100644 --- a/MediaBrowser.Model/Dlna/ContainerProfile.cs +++ b/MediaBrowser.Model/Dlna/ContainerProfile.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; using System.Xml.Serialization; namespace MediaBrowser.Model.Dlna @@ -20,7 +19,12 @@ namespace MediaBrowser.Model.Dlna public List<string> GetContainers() { - return (Container ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (Container ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; } } } diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs index 7e21e1ef2..c97c06d34 100644 --- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs +++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs @@ -1,8 +1,5 @@ -using System; +using MediaBrowser.Model.MediaInfo; using System.Collections.Generic; -using System.Linq; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Model.Dlna { @@ -19,30 +16,30 @@ namespace MediaBrowser.Model.Dlna int? width, int? height) { - var orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetImageOrgOpValue(); + string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetImageOrgOpValue(); // 0 = native, 1 = transcoded const string orgCi = ";DLNA.ORG_CI=0"; - var flagValue = DlnaFlags.StreamingTransferMode | + DlnaFlags flagValue = DlnaFlags.StreamingTransferMode | DlnaFlags.BackgroundTransferMode | DlnaFlags.DlnaV15; - var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", - FlagsToString(flagValue)); + string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", + DlnaMaps.FlagsToString(flagValue)); - var mediaProfile = _profile.GetImageMediaProfile(container, + ResponseProfile mediaProfile = _profile.GetImageMediaProfile(container, width, height); - var orgPn = mediaProfile == null ? null : mediaProfile.OrgPn; + string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn; if (string.IsNullOrEmpty(orgPn)) { orgPn = GetImageOrgPnValue(container, width, height); } - var contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn; + string contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn; return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';'); } @@ -57,12 +54,12 @@ namespace MediaBrowser.Model.Dlna TranscodeSeekInfo transcodeSeekInfo) { // first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none - var orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo); + string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo); // 0 = native, 1 = transcoded - var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1"; + string orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1"; - var flagValue = DlnaFlags.StreamingTransferMode | + DlnaFlags flagValue = DlnaFlags.StreamingTransferMode | DlnaFlags.BackgroundTransferMode | DlnaFlags.DlnaV15; @@ -75,32 +72,26 @@ namespace MediaBrowser.Model.Dlna //flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK; } - var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", - FlagsToString(flagValue)); + string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", + DlnaMaps.FlagsToString(flagValue)); - var mediaProfile = _profile.GetAudioMediaProfile(container, + ResponseProfile mediaProfile = _profile.GetAudioMediaProfile(container, audioCodec, audioChannels, audioBitrate); - var orgPn = mediaProfile == null ? null : mediaProfile.OrgPn; + string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn; if (string.IsNullOrEmpty(orgPn)) { orgPn = GetAudioOrgPnValue(container, audioBitrate, audioSampleRate, audioChannels); } - var contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn; + string contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn; return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';'); } - private static string FlagsToString(DlnaFlags flags) - { - //return Enum.Format(typeof(DlnaFlags), flags, "x"); - return string.Format("{0:X8}{1:D24}", (ulong)flags, 0); - } - public string BuildVideoHeader(string container, string videoCodec, string audioCodec, @@ -120,12 +111,12 @@ namespace MediaBrowser.Model.Dlna TranscodeSeekInfo transcodeSeekInfo) { // first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none - var orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo); + string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo); // 0 = native, 1 = transcoded - var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1"; + string orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1"; - var flagValue = DlnaFlags.StreamingTransferMode | + DlnaFlags flagValue = DlnaFlags.StreamingTransferMode | DlnaFlags.BackgroundTransferMode | DlnaFlags.DlnaV15; @@ -138,10 +129,10 @@ namespace MediaBrowser.Model.Dlna //flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK; } - var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", - FlagsToString(flagValue)); + string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", + DlnaMaps.FlagsToString(flagValue)); - var mediaProfile = _profile.GetVideoMediaProfile(container, + ResponseProfile mediaProfile = _profile.GetVideoMediaProfile(container, audioCodec, videoCodec, audioBitrate, @@ -156,25 +147,35 @@ namespace MediaBrowser.Model.Dlna packetLength, timestamp); - var orgPn = mediaProfile == null ? null : mediaProfile.OrgPn; + string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn; if (string.IsNullOrEmpty(orgPn)) { - orgPn = GetVideoOrgPnValue(container, videoCodec, audioCodec, width, height, timestamp) - .FirstOrDefault(); + foreach (string s in GetVideoOrgPnValue(container, videoCodec, audioCodec, width, height, timestamp)) + { + orgPn = s; + break; + } + } + if (string.IsNullOrEmpty(orgPn)) + { // TODO: Support multiple values and return multiple headers? - orgPn = (orgPn ?? string.Empty).Split(',').FirstOrDefault(); + foreach (string s in (orgPn ?? string.Empty).Split(',')) + { + orgPn = s; + break; + } } - var contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn; + string contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn; return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';'); } private string GetImageOrgPnValue(string container, int? width, int? height) { - var format = new MediaFormatProfileResolver() + MediaFormatProfile? format = new MediaFormatProfileResolver() .ResolveImageFormat(container, width, height); @@ -184,7 +185,7 @@ namespace MediaBrowser.Model.Dlna private string GetAudioOrgPnValue(string container, int? audioBitrate, int? audioSampleRate, int? audioChannels) { - var format = new MediaFormatProfileResolver() + MediaFormatProfile? format = new MediaFormatProfileResolver() .ResolveAudioFormat(container, audioBitrate, audioSampleRate, @@ -193,16 +194,12 @@ namespace MediaBrowser.Model.Dlna return format.HasValue ? format.Value.ToString() : null; } - private IEnumerable<string> GetVideoOrgPnValue(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestamp) + private List<string> GetVideoOrgPnValue(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestamp) { - return new MediaFormatProfileResolver() - .ResolveVideoFormat(container, - videoCodec, - audioCodec, - width, - height, - timestamp) - .Select(i => i.ToString()); + List<string> list = new List<string>(); + foreach (MediaFormatProfile i in new MediaFormatProfileResolver().ResolveVideoFormat(container, videoCodec, audioCodec, width, height, timestamp)) + list.Add(i.ToString()); + return list; } } } diff --git a/MediaBrowser.Model/Dlna/DeviceIdentification.cs b/MediaBrowser.Model/Dlna/DeviceIdentification.cs index 87cf000b1..97f4409da 100644 --- a/MediaBrowser.Model/Dlna/DeviceIdentification.cs +++ b/MediaBrowser.Model/Dlna/DeviceIdentification.cs @@ -1,6 +1,4 @@ -using System.Xml.Serialization; - -namespace MediaBrowser.Model.Dlna +namespace MediaBrowser.Model.Dlna { public class DeviceIdentification { @@ -60,23 +58,4 @@ namespace MediaBrowser.Model.Dlna Headers = new HttpHeaderInfo[] {}; } } - - public class HttpHeaderInfo - { - [XmlAttribute("name")] - public string Name { get; set; } - - [XmlAttribute("value")] - public string Value { get; set; } - - [XmlAttribute("match")] - public HeaderMatchType Match { get; set; } - } - - public enum HeaderMatchType - { - Equals = 0, - Regex = 1, - Substring = 2 - } } diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs index b23ad876c..42ba5840c 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs @@ -105,116 +105,154 @@ namespace MediaBrowser.Model.Dlna public List<string> GetSupportedMediaTypes() { - return (SupportedMediaTypes ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (SupportedMediaTypes ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) + list.Add(i); + } + return list; } public TranscodingProfile GetAudioTranscodingProfile(string container, string audioCodec) { container = (container ?? string.Empty).TrimStart('.'); - return TranscodingProfiles.FirstOrDefault(i => + foreach (var i in TranscodingProfiles) { if (i.Type != DlnaProfileType.Audio) { - return false; + continue; } if (!string.Equals(container, i.Container, StringComparison.OrdinalIgnoreCase)) { - return false; + continue; } - if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty)) + if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase)) { - return false; + continue; } - return true; - }); + return i; + } + return null; } public TranscodingProfile GetVideoTranscodingProfile(string container, string audioCodec, string videoCodec) { container = (container ?? string.Empty).TrimStart('.'); - return TranscodingProfiles.FirstOrDefault(i => + foreach (var i in TranscodingProfiles) { if (i.Type != DlnaProfileType.Video) { - return false; + continue; } if (!string.Equals(container, i.Container, StringComparison.OrdinalIgnoreCase)) { - return false; + continue; } if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty)) { - return false; + continue; } if (!string.Equals(videoCodec, i.VideoCodec, StringComparison.OrdinalIgnoreCase)) { - return false; + continue; } - return true; - }); + return i; + } + return null; } public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate) { container = (container ?? string.Empty).TrimStart('.'); - return ResponseProfiles.FirstOrDefault(i => + foreach (var i in ResponseProfiles) { if (i.Type != DlnaProfileType.Audio) { - return false; + continue; + } + + List<string> containers = i.GetContainers(); + if (containers.Count > 0 && !containers.Contains(container, StringComparer.OrdinalIgnoreCase)) + { + continue; } - var containers = i.GetContainers().ToList(); - if (containers.Count > 0 && !containers.Contains(container)) + List<string> audioCodecs = i.GetAudioCodecs(); + if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase)) { - return false; + continue; } - var audioCodecs = i.GetAudioCodecs().ToList(); - if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty)) + ConditionProcessor conditionProcessor = new ConditionProcessor(); + + var anyOff = false; + foreach (ProfileCondition c in i.Conditions) { - return false; + if (!conditionProcessor.IsAudioConditionSatisfied(c, audioChannels, audioBitrate)) + { + anyOff = true; + break; + } } - var conditionProcessor = new ConditionProcessor(); - return i.Conditions.All(c => conditionProcessor.IsAudioConditionSatisfied(c, - audioChannels, - audioBitrate)); - }); + if (anyOff) + { + continue; + } + + return i; + } + return null; } public ResponseProfile GetImageMediaProfile(string container, int? width, int? height) { container = (container ?? string.Empty).TrimStart('.'); - return ResponseProfiles.FirstOrDefault(i => + foreach (var i in ResponseProfiles) { if (i.Type != DlnaProfileType.Photo) { - return false; + continue; + } + + List<string> containers = i.GetContainers(); + if (containers.Count > 0 && !containers.Contains(container, StringComparer.OrdinalIgnoreCase)) + { + continue; + } + + ConditionProcessor conditionProcessor = new ConditionProcessor(); + + var anyOff = false; + foreach (ProfileCondition c in i.Conditions) + { + if (!conditionProcessor.IsImageConditionSatisfied(c, width, height)) + { + anyOff = true; + break; + } } - var containers = i.GetContainers().ToList(); - if (containers.Count > 0 && !containers.Contains(container)) + if (anyOff) { - return false; + continue; } - var conditionProcessor = new ConditionProcessor(); - return i.Conditions.All(c => conditionProcessor.IsImageConditionSatisfied(c, - width, - height)); - }); + return i; + } + return null; } public ResponseProfile GetVideoMediaProfile(string container, @@ -234,69 +272,90 @@ namespace MediaBrowser.Model.Dlna { container = (container ?? string.Empty).TrimStart('.'); - return ResponseProfiles.FirstOrDefault(i => + foreach (var i in ResponseProfiles) { if (i.Type != DlnaProfileType.Video) { - return false; + continue; + } + + List<string> containers = i.GetContainers(); + if (containers.Count > 0 && !containers.Contains(container, StringComparer.OrdinalIgnoreCase)) + { + continue; } - var containers = i.GetContainers().ToList(); - if (containers.Count > 0 && !containers.Contains(container)) + List<string> audioCodecs = i.GetAudioCodecs(); + if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase)) { - return false; + continue; } - var audioCodecs = i.GetAudioCodecs().ToList(); - if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty)) + List<string> videoCodecs = i.GetVideoCodecs(); + if (videoCodecs.Count > 0 && !videoCodecs.Contains(videoCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase)) + { + continue; + } + + ConditionProcessor conditionProcessor = new ConditionProcessor(); + + var anyOff = false; + foreach (ProfileCondition c in i.Conditions) { - return false; + if (!conditionProcessor.IsVideoConditionSatisfied(c, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp)) + { + anyOff = true; + break; + } } - var videoCodecs = i.GetVideoCodecs().ToList(); - if (videoCodecs.Count > 0 && !videoCodecs.Contains(videoCodec ?? string.Empty)) + if (anyOff) { - return false; + continue; } - var conditionProcessor = new ConditionProcessor(); - return i.Conditions.All(c => conditionProcessor.IsVideoConditionSatisfied(c, - audioBitrate, - audioChannels, - width, - height, - bitDepth, - videoBitrate, - videoProfile, - videoLevel, - videoFramerate, - packetLength, - timestamp)); - }); + return i; + } + return null; } public ResponseProfile GetPhotoMediaProfile(string container, int? width, int? height) { container = (container ?? string.Empty).TrimStart('.'); - return ResponseProfiles.FirstOrDefault(i => + foreach (var i in ResponseProfiles) { if (i.Type != DlnaProfileType.Photo) { - return false; + continue; + } + + List<string> containers = i.GetContainers().ToList(); + if (containers.Count > 0 && !containers.Contains(container, StringComparer.OrdinalIgnoreCase)) + { + continue; + } + + ConditionProcessor conditionProcessor = new ConditionProcessor(); + + var anyOff = false; + foreach (ProfileCondition c in i.Conditions) + { + if (!conditionProcessor.IsImageConditionSatisfied(c, width, height)) + { + anyOff = true; + break; + } } - var containers = i.GetContainers().ToList(); - if (containers.Count > 0 && !containers.Contains(container)) + if (anyOff) { - return false; + continue; } - var conditionProcessor = new ConditionProcessor(); - return i.Conditions.All(c => conditionProcessor.IsImageConditionSatisfied(c, - width, - height)); - }); + return i; + } + return null; } } } diff --git a/MediaBrowser.Model/Dlna/DeviceProfileInfo.cs b/MediaBrowser.Model/Dlna/DeviceProfileInfo.cs index ceb27386c..b2afdf292 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfileInfo.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfileInfo.cs @@ -21,10 +21,4 @@ namespace MediaBrowser.Model.Dlna /// <value>The type.</value> public DeviceProfileType Type { get; set; } } - - public enum DeviceProfileType - { - System = 0, - User = 1 - } } diff --git a/MediaBrowser.Model/Dlna/DeviceProfileType.cs b/MediaBrowser.Model/Dlna/DeviceProfileType.cs new file mode 100644 index 000000000..f881a4539 --- /dev/null +++ b/MediaBrowser.Model/Dlna/DeviceProfileType.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Dlna +{ + public enum DeviceProfileType + { + System = 0, + User = 1 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs index e195c9450..183299425 100644 --- a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs +++ b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; using System.Xml.Serialization; namespace MediaBrowser.Model.Dlna @@ -20,33 +19,32 @@ namespace MediaBrowser.Model.Dlna public List<string> GetContainers() { - return (Container ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (Container ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; } public List<string> GetAudioCodecs() { - return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (AudioCodec ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; } public List<string> GetVideoCodecs() { - return (VideoCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (VideoCodec ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; } } - - public class XmlAttribute - { - [XmlAttribute("name")] - public string Name { get; set; } - - [XmlAttribute("value")] - public string Value { get; set; } - } - - public enum DlnaProfileType - { - Audio = 0, - Video = 1, - Photo = 2 - } } diff --git a/MediaBrowser.Model/Dlna/DlnaFlags.cs b/MediaBrowser.Model/Dlna/DlnaFlags.cs new file mode 100644 index 000000000..23859312d --- /dev/null +++ b/MediaBrowser.Model/Dlna/DlnaFlags.cs @@ -0,0 +1,21 @@ +using System; + +namespace MediaBrowser.Model.Dlna +{ + [Flags] + public enum DlnaFlags : ulong + { + BackgroundTransferMode = (1 << 22), + ByteBasedSeek = (1 << 29), + ConnectionStall = (1 << 21), + DlnaV15 = (1 << 20), + InteractiveTransferMode = (1 << 23), + PlayContainer = (1 << 28), + RtspPause = (1 << 25), + S0Increase = (1 << 27), + SenderPaced = (1L << 31), + SnIncrease = (1 << 26), + StreamingTransferMode = (1 << 24), + TimeBasedSeek = (1 << 30) + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/DlnaMaps.cs b/MediaBrowser.Model/Dlna/DlnaMaps.cs index d2871474a..036c1fc74 100644 --- a/MediaBrowser.Model/Dlna/DlnaMaps.cs +++ b/MediaBrowser.Model/Dlna/DlnaMaps.cs @@ -1,6 +1,4 @@ -using System; - -namespace MediaBrowser.Model.Dlna +namespace MediaBrowser.Model.Dlna { public class DlnaMaps { @@ -27,7 +25,7 @@ namespace MediaBrowser.Model.Dlna { if (hasKnownRuntime) { - var orgOp = string.Empty; + string orgOp = string.Empty; // Time-based seeking currently only possible when transcoding orgOp += isDirectStream ? "0" : "1"; @@ -44,7 +42,7 @@ namespace MediaBrowser.Model.Dlna public static string GetImageOrgOpValue() { - var orgOp = string.Empty; + string orgOp = string.Empty; // Time-based seeking currently only possible when transcoding orgOp += "0"; @@ -55,21 +53,4 @@ namespace MediaBrowser.Model.Dlna return orgOp; } } - - [Flags] - public enum DlnaFlags : ulong - { - BackgroundTransferMode = (1 << 22), - ByteBasedSeek = (1 << 29), - ConnectionStall = (1 << 21), - DlnaV15 = (1 << 20), - InteractiveTransferMode = (1 << 23), - PlayContainer = (1 << 28), - RtspPause = (1 << 25), - S0Increase = (1 << 27), - SenderPaced = (1L << 31), - SnIncrease = (1 << 26), - StreamingTransferMode = (1 << 24), - TimeBasedSeek = (1 << 30) - } } diff --git a/MediaBrowser.Model/Dlna/DlnaProfileType.cs b/MediaBrowser.Model/Dlna/DlnaProfileType.cs new file mode 100644 index 000000000..1bad14081 --- /dev/null +++ b/MediaBrowser.Model/Dlna/DlnaProfileType.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.Dlna +{ + public enum DlnaProfileType + { + Audio = 0, + Video = 1, + Photo = 2 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/Filter.cs b/MediaBrowser.Model/Dlna/Filter.cs index c8940734b..760adb585 100644 --- a/MediaBrowser.Model/Dlna/Filter.cs +++ b/MediaBrowser.Model/Dlna/Filter.cs @@ -19,9 +19,10 @@ namespace MediaBrowser.Model.Dlna { _all = string.Equals(filter, "*", StringComparison.OrdinalIgnoreCase); - _fields = (filter ?? string.Empty) - .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) - .ToList(); + List<string> list = new List<string>(); + foreach (string s in (filter ?? string.Empty).Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries)) + list.Add(s); + _fields = list; } public bool Contains(string field) diff --git a/MediaBrowser.Model/Dlna/HeaderMatchType.cs b/MediaBrowser.Model/Dlna/HeaderMatchType.cs new file mode 100644 index 000000000..7a0d5c24f --- /dev/null +++ b/MediaBrowser.Model/Dlna/HeaderMatchType.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.Dlna +{ + public enum HeaderMatchType + { + Equals = 0, + Regex = 1, + Substring = 2 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs b/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs new file mode 100644 index 000000000..926963ef6 --- /dev/null +++ b/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs @@ -0,0 +1,16 @@ +using System.Xml.Serialization; + +namespace MediaBrowser.Model.Dlna +{ + public class HttpHeaderInfo + { + [XmlAttribute("name")] + public string Name { get; set; } + + [XmlAttribute("value")] + public string Value { get; set; } + + [XmlAttribute("match")] + public HeaderMatchType Match { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs index a62508fb1..3c35ca0f6 100644 --- a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs +++ b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs @@ -1,7 +1,6 @@ -using System; +using MediaBrowser.Model.MediaInfo; +using System; using System.Collections.Generic; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Model.Dlna { @@ -11,13 +10,13 @@ namespace MediaBrowser.Model.Dlna { if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase)) { - var val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height); + MediaFormatProfile? val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height); return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>(); } if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase)) { - var val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height); + MediaFormatProfile? val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height); return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>(); } @@ -51,7 +50,7 @@ namespace MediaBrowser.Model.Dlna if (string.Equals(container, "3gp", StringComparison.OrdinalIgnoreCase)) { - var val = ResolveVideo3GPFormat(videoCodec, audioCodec); + MediaFormatProfile? val = ResolveVideo3GPFormat(videoCodec, audioCodec); return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>(); } @@ -63,7 +62,7 @@ namespace MediaBrowser.Model.Dlna private IEnumerable<MediaFormatProfile> ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType) { - var suffix = ""; + string suffix = ""; switch (timestampType) { @@ -75,7 +74,7 @@ namespace MediaBrowser.Model.Dlna break; } - var resolution = "S"; + string resolution = "S"; if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576)) { resolution = "H"; @@ -83,7 +82,7 @@ namespace MediaBrowser.Model.Dlna if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase)) { - var list = new List<MediaFormatProfile>(); + List<MediaFormatProfile> list = new List<MediaFormatProfile>(); list.Add(ValueOf("MPEG_TS_SD_NA" + suffix)); list.Add(ValueOf("MPEG_TS_SD_EU" + suffix)); diff --git a/MediaBrowser.Model/Dlna/ProfileCondition.cs b/MediaBrowser.Model/Dlna/ProfileCondition.cs new file mode 100644 index 000000000..24733426c --- /dev/null +++ b/MediaBrowser.Model/Dlna/ProfileCondition.cs @@ -0,0 +1,24 @@ +using System.Xml.Serialization; + +namespace MediaBrowser.Model.Dlna +{ + public class ProfileCondition + { + [XmlAttribute("condition")] + public ProfileConditionType Condition { get; set; } + + [XmlAttribute("property")] + public ProfileConditionValue Property { get; set; } + + [XmlAttribute("value")] + public string Value { get; set; } + + [XmlAttribute("isRequired")] + public bool IsRequired { get; set; } + + public ProfileCondition() + { + IsRequired = true; + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/ProfileConditionType.cs b/MediaBrowser.Model/Dlna/ProfileConditionType.cs new file mode 100644 index 000000000..22156c47d --- /dev/null +++ b/MediaBrowser.Model/Dlna/ProfileConditionType.cs @@ -0,0 +1,10 @@ +namespace MediaBrowser.Model.Dlna +{ + public enum ProfileConditionType + { + Equals = 0, + NotEquals = 1, + LessThanEqual = 2, + GreaterThanEqual = 3 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/ProfileConditionValue.cs b/MediaBrowser.Model/Dlna/ProfileConditionValue.cs new file mode 100644 index 000000000..56a322f5a --- /dev/null +++ b/MediaBrowser.Model/Dlna/ProfileConditionValue.cs @@ -0,0 +1,19 @@ +namespace MediaBrowser.Model.Dlna +{ + public enum ProfileConditionValue + { + AudioChannels, + AudioBitrate, + AudioProfile, + Width, + Height, + Has64BitOffsets, + PacketLength, + VideoBitDepth, + VideoBitrate, + VideoFramerate, + VideoLevel, + VideoProfile, + VideoTimestamp + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/ResponseProfile.cs b/MediaBrowser.Model/Dlna/ResponseProfile.cs index e84095ffe..c1735f3b7 100644 --- a/MediaBrowser.Model/Dlna/ResponseProfile.cs +++ b/MediaBrowser.Model/Dlna/ResponseProfile.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; using System.Xml.Serialization; namespace MediaBrowser.Model.Dlna @@ -33,17 +32,32 @@ namespace MediaBrowser.Model.Dlna public List<string> GetContainers() { - return (Container ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (Container ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; } - + public List<string> GetAudioCodecs() { - return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (AudioCodec ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; } public List<string> GetVideoCodecs() { - return (VideoCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (VideoCodec ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; } } } diff --git a/MediaBrowser.Model/Dlna/SearchCriteria.cs b/MediaBrowser.Model/Dlna/SearchCriteria.cs index d3f8b8332..bb4221b51 100644 --- a/MediaBrowser.Model/Dlna/SearchCriteria.cs +++ b/MediaBrowser.Model/Dlna/SearchCriteria.cs @@ -37,13 +37,4 @@ namespace MediaBrowser.Model.Dlna } } } - - public enum SearchType - { - Unknown = 0, - Audio = 1, - Image = 2, - Video = 3, - Playlist = 4 - } } diff --git a/MediaBrowser.Model/Dlna/SearchType.cs b/MediaBrowser.Model/Dlna/SearchType.cs new file mode 100644 index 000000000..68c047603 --- /dev/null +++ b/MediaBrowser.Model/Dlna/SearchType.cs @@ -0,0 +1,11 @@ +namespace MediaBrowser.Model.Dlna +{ + public enum SearchType + { + Unknown = 0, + Audio = 1, + Image = 2, + Video = 3, + Playlist = 4 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 21441d36a..48356ef92 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -16,22 +16,27 @@ namespace MediaBrowser.Model.Dlna { ValidateAudioInput(options); - var mediaSources = options.MediaSources; + List<MediaSourceInfo> mediaSources = options.MediaSources; // If the client wants a specific media soure, filter now if (!string.IsNullOrEmpty(options.MediaSourceId)) { // Avoid implicitly captured closure - var mediaSourceId = options.MediaSourceId; + string mediaSourceId = options.MediaSourceId; - mediaSources = mediaSources - .Where(i => string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase)) - .ToList(); + mediaSources = new List<MediaSourceInfo>(); + foreach (MediaSourceInfo i in mediaSources) + { + if (string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase)) + mediaSources.Add(i); + } } - var streams = mediaSources.Select(i => BuildAudioItem(i, options)).ToList(); + List<StreamInfo> streams = new List<StreamInfo>(); + foreach (MediaSourceInfo i in mediaSources) + streams.Add(BuildAudioItem(i, options)); - foreach (var stream in streams) + foreach (StreamInfo stream in streams) { stream.DeviceId = options.DeviceId; stream.DeviceProfileId = options.Profile.Id; @@ -44,22 +49,27 @@ namespace MediaBrowser.Model.Dlna { ValidateInput(options); - var mediaSources = options.MediaSources; + List<MediaSourceInfo> mediaSources = options.MediaSources; // If the client wants a specific media soure, filter now if (!string.IsNullOrEmpty(options.MediaSourceId)) { // Avoid implicitly captured closure - var mediaSourceId = options.MediaSourceId; + string mediaSourceId = options.MediaSourceId; - mediaSources = mediaSources - .Where(i => string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase)) - .ToList(); + mediaSources = new List<MediaSourceInfo>(); + foreach (MediaSourceInfo i in mediaSources) + { + if (string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase)) + mediaSources.Add(i); + } } - var streams = mediaSources.Select(i => BuildVideoItem(i, options)).ToList(); + List<StreamInfo> streams = new List<StreamInfo>(); + foreach (MediaSourceInfo i in mediaSources) + streams.Add(BuildVideoItem(i, options)); - foreach (var stream in streams) + foreach (StreamInfo stream in streams) { stream.DeviceId = options.DeviceId; stream.DeviceProfileId = options.Profile.Id; @@ -72,13 +82,24 @@ namespace MediaBrowser.Model.Dlna { // Grab the first one that can be direct streamed // If that doesn't produce anything, just take the first - return streams.FirstOrDefault(i => i.IsDirectStream) ?? - streams.FirstOrDefault(); + foreach (StreamInfo i in streams) + { + if (i.IsDirectStream) + { + return i; + } + } + + foreach (StreamInfo stream in streams) + { + return stream; + } + return null; } private StreamInfo BuildAudioItem(MediaSourceInfo item, AudioOptions options) { - var playlistItem = new StreamInfo + StreamInfo playlistItem = new StreamInfo { ItemId = options.ItemId, MediaType = DlnaProfileType.Audio, @@ -86,32 +107,53 @@ namespace MediaBrowser.Model.Dlna RunTimeTicks = item.RunTimeTicks }; - var maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate; + int? maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate; - var audioStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Audio); + MediaStream audioStream = item.DefaultAudioStream; // Honor the max bitrate setting if (IsAudioEligibleForDirectPlay(item, maxBitrateSetting)) { - var directPlay = options.Profile.DirectPlayProfiles - .FirstOrDefault(i => i.Type == playlistItem.MediaType && IsAudioDirectPlaySupported(i, item, audioStream)); + DirectPlayProfile directPlay = null; + foreach (DirectPlayProfile i in options.Profile.DirectPlayProfiles) + { + if (i.Type == playlistItem.MediaType && IsAudioDirectPlaySupported(i, item, audioStream)) + { + directPlay = i; + break; + } + } if (directPlay != null) { - var audioCodec = audioStream == null ? null : audioStream.Codec; + string audioCodec = audioStream == null ? null : audioStream.Codec; // Make sure audio codec profiles are satisfied if (!string.IsNullOrEmpty(audioCodec)) { - var conditionProcessor = new ConditionProcessor(); + ConditionProcessor conditionProcessor = new ConditionProcessor(); + + List<ProfileCondition> conditions = new List<ProfileCondition>(); + foreach (CodecProfile i in options.Profile.CodecProfiles) + { + if (i.Type == CodecType.Audio && i.ContainsCodec(audioCodec)) + conditions.AddRange(i.Conditions); + } - var conditions = options.Profile.CodecProfiles.Where(i => i.Type == CodecType.Audio && i.ContainsCodec(audioCodec)) - .SelectMany(i => i.Conditions); + int? audioChannels = audioStream.Channels; + int? audioBitrate = audioStream.BitRate; - var audioChannels = audioStream == null ? null : audioStream.Channels; - var audioBitrate = audioStream == null ? null : audioStream.BitRate; + bool all = true; + foreach (ProfileCondition c in conditions) + { + if (!conditionProcessor.IsAudioConditionSatisfied(c, audioChannels, audioBitrate)) + { + all = false; + break; + } + } - if (conditions.All(c => conditionProcessor.IsAudioConditionSatisfied(c, audioChannels, audioBitrate))) + if (all) { playlistItem.IsDirectStream = true; playlistItem.Container = item.Container; @@ -122,8 +164,15 @@ namespace MediaBrowser.Model.Dlna } } - var transcodingProfile = options.Profile.TranscodingProfiles - .FirstOrDefault(i => i.Type == playlistItem.MediaType); + TranscodingProfile transcodingProfile = null; + foreach (TranscodingProfile i in options.Profile.TranscodingProfiles) + { + if (i.Type == playlistItem.MediaType) + { + transcodingProfile = i; + break; + } + } if (transcodingProfile != null) { @@ -134,17 +183,27 @@ namespace MediaBrowser.Model.Dlna playlistItem.AudioCodec = transcodingProfile.AudioCodec; playlistItem.Protocol = transcodingProfile.Protocol; - var audioTranscodingConditions = options.Profile.CodecProfiles - .Where(i => i.Type == CodecType.Audio && i.ContainsCodec(transcodingProfile.AudioCodec)) - .Take(1) - .SelectMany(i => i.Conditions); + List<CodecProfile> audioCodecProfiles = new List<CodecProfile>(); + foreach (CodecProfile i in options.Profile.CodecProfiles) + { + if (i.Type == CodecType.Audio && i.ContainsCodec(transcodingProfile.AudioCodec)) + { + audioCodecProfiles.Add(i); + } + + if (audioCodecProfiles.Count >= 1) break; + } + + List<ProfileCondition> audioTranscodingConditions = new List<ProfileCondition>(); + foreach (CodecProfile i in audioCodecProfiles) + audioTranscodingConditions.AddRange(i.Conditions); ApplyTranscodingConditions(playlistItem, audioTranscodingConditions); // Honor requested max channels if (options.MaxAudioChannels.HasValue) { - var currentValue = playlistItem.MaxAudioChannels ?? options.MaxAudioChannels.Value; + int currentValue = playlistItem.MaxAudioChannels ?? options.MaxAudioChannels.Value; playlistItem.MaxAudioChannels = Math.Min(options.MaxAudioChannels.Value, currentValue); } @@ -152,7 +211,7 @@ namespace MediaBrowser.Model.Dlna // Honor requested max bitrate if (maxBitrateSetting.HasValue) { - var currentValue = playlistItem.AudioBitrate ?? maxBitrateSetting.Value; + int currentValue = playlistItem.AudioBitrate ?? maxBitrateSetting.Value; playlistItem.AudioBitrate = Math.Min(maxBitrateSetting.Value, currentValue); } @@ -163,7 +222,7 @@ namespace MediaBrowser.Model.Dlna private StreamInfo BuildVideoItem(MediaSourceInfo item, VideoOptions options) { - var playlistItem = new StreamInfo + StreamInfo playlistItem = new StreamInfo { ItemId = options.ItemId, MediaType = DlnaProfileType.Video, @@ -171,15 +230,15 @@ namespace MediaBrowser.Model.Dlna RunTimeTicks = item.RunTimeTicks }; - var audioStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Audio); - var videoStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video); + MediaStream audioStream = item.DefaultAudioStream; + MediaStream videoStream = item.VideoStream; - var maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate; + int? maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate; if (IsEligibleForDirectPlay(item, options, maxBitrateSetting)) { // See if it can be direct played - var directPlay = GetVideoDirectPlayProfile(options.Profile, item, videoStream, audioStream); + DirectPlayProfile directPlay = GetVideoDirectPlayProfile(options.Profile, item, videoStream, audioStream); if (directPlay != null) { @@ -191,8 +250,15 @@ namespace MediaBrowser.Model.Dlna } // Can't direct play, find the transcoding profile - var transcodingProfile = options.Profile.TranscodingProfiles - .FirstOrDefault(i => i.Type == playlistItem.MediaType); + TranscodingProfile transcodingProfile = null; + foreach (TranscodingProfile i in options.Profile.TranscodingProfiles) + { + if (i.Type == playlistItem.MediaType) + { + transcodingProfile = i; + break; + } + } if (transcodingProfile != null) { @@ -200,30 +266,38 @@ namespace MediaBrowser.Model.Dlna playlistItem.Container = transcodingProfile.Container; playlistItem.EstimateContentLength = transcodingProfile.EstimateContentLength; playlistItem.TranscodeSeekInfo = transcodingProfile.TranscodeSeekInfo; - playlistItem.AudioCodec = transcodingProfile.AudioCodec.Split(',').FirstOrDefault(); + playlistItem.AudioCodec = transcodingProfile.AudioCodec.Split(',')[0]; playlistItem.VideoCodec = transcodingProfile.VideoCodec; playlistItem.Protocol = transcodingProfile.Protocol; playlistItem.AudioStreamIndex = options.AudioStreamIndex; playlistItem.SubtitleStreamIndex = options.SubtitleStreamIndex; - var videoTranscodingConditions = options.Profile.CodecProfiles - .Where(i => i.Type == CodecType.Video && i.ContainsCodec(transcodingProfile.VideoCodec)) - .Take(1) - .SelectMany(i => i.Conditions); - + List<ProfileCondition> videoTranscodingConditions = new List<ProfileCondition>(); + foreach (CodecProfile i in options.Profile.CodecProfiles) + { + if (i.Type == CodecType.Video && i.ContainsCodec(transcodingProfile.VideoCodec)) + { + videoTranscodingConditions.AddRange(i.Conditions); + break; + } + } ApplyTranscodingConditions(playlistItem, videoTranscodingConditions); - var audioTranscodingConditions = options.Profile.CodecProfiles - .Where(i => i.Type == CodecType.VideoAudio && i.ContainsCodec(transcodingProfile.AudioCodec)) - .Take(1) - .SelectMany(i => i.Conditions); - + List<ProfileCondition> audioTranscodingConditions = new List<ProfileCondition>(); + foreach (CodecProfile i in options.Profile.CodecProfiles) + { + if (i.Type == CodecType.VideoAudio && i.ContainsCodec(transcodingProfile.AudioCodec)) + { + audioTranscodingConditions.AddRange(i.Conditions); + break; + } + } ApplyTranscodingConditions(playlistItem, audioTranscodingConditions); // Honor requested max channels if (options.MaxAudioChannels.HasValue) { - var currentValue = playlistItem.MaxAudioChannels ?? options.MaxAudioChannels.Value; + int currentValue = playlistItem.MaxAudioChannels ?? options.MaxAudioChannels.Value; playlistItem.MaxAudioChannels = Math.Min(options.MaxAudioChannels.Value, currentValue); } @@ -231,7 +305,7 @@ namespace MediaBrowser.Model.Dlna // Honor requested max bitrate if (options.MaxAudioTranscodingBitrate.HasValue) { - var currentValue = playlistItem.AudioBitrate ?? options.MaxAudioTranscodingBitrate.Value; + int currentValue = playlistItem.AudioBitrate ?? options.MaxAudioTranscodingBitrate.Value; playlistItem.AudioBitrate = Math.Min(options.MaxAudioTranscodingBitrate.Value, currentValue); } @@ -239,14 +313,14 @@ namespace MediaBrowser.Model.Dlna // Honor max rate if (maxBitrateSetting.HasValue) { - var videoBitrate = maxBitrateSetting.Value; + int videoBitrate = maxBitrateSetting.Value; if (playlistItem.AudioBitrate.HasValue) { videoBitrate -= playlistItem.AudioBitrate.Value; } - var currentValue = playlistItem.VideoBitrate ?? videoBitrate; + int currentValue = playlistItem.VideoBitrate ?? videoBitrate; playlistItem.VideoBitrate = Math.Min(videoBitrate, currentValue); } @@ -261,100 +335,103 @@ namespace MediaBrowser.Model.Dlna MediaStream audioStream) { // See if it can be direct played - var directPlay = profile.DirectPlayProfiles - .FirstOrDefault(i => i.Type == DlnaProfileType.Video && IsVideoDirectPlaySupported(i, mediaSource, videoStream, audioStream)); + DirectPlayProfile directPlay = null; + foreach (DirectPlayProfile i in profile.DirectPlayProfiles) + { + if (i.Type == DlnaProfileType.Video && IsVideoDirectPlaySupported(i, mediaSource, videoStream, audioStream)) + { + directPlay = i; + break; + } + } if (directPlay == null) { return null; } - var container = mediaSource.Container; + string container = mediaSource.Container; - var conditions = profile.ContainerProfiles - .Where(i => i.Type == DlnaProfileType.Video && i.GetContainers().Contains(container, StringComparer.OrdinalIgnoreCase)) - .SelectMany(i => i.Conditions); + List<ProfileCondition> conditions = new List<ProfileCondition>(); + foreach (ContainerProfile i in profile.ContainerProfiles) + { + if (i.Type == DlnaProfileType.Video && + i.GetContainers().Contains(container, StringComparer.OrdinalIgnoreCase)) + { + conditions.AddRange(i.Conditions); + } + } - var conditionProcessor = new ConditionProcessor(); + ConditionProcessor conditionProcessor = new ConditionProcessor(); - var width = videoStream == null ? null : videoStream.Width; - var height = videoStream == null ? null : videoStream.Height; - var bitDepth = videoStream == null ? null : videoStream.BitDepth; - var videoBitrate = videoStream == null ? null : videoStream.BitRate; - var videoLevel = videoStream == null ? null : videoStream.Level; - var videoProfile = videoStream == null ? null : videoStream.Profile; - var videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate; + int? width = videoStream == null ? null : videoStream.Width; + int? height = videoStream == null ? null : videoStream.Height; + int? bitDepth = videoStream == null ? null : videoStream.BitDepth; + int? videoBitrate = videoStream == null ? null : videoStream.BitRate; + double? videoLevel = videoStream == null ? null : videoStream.Level; + string videoProfile = videoStream == null ? null : videoStream.Profile; + float? videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate; - var audioBitrate = audioStream == null ? null : audioStream.BitRate; - var audioChannels = audioStream == null ? null : audioStream.Channels; - var audioProfile = audioStream == null ? null : audioStream.Profile; + int? audioBitrate = audioStream == null ? null : audioStream.BitRate; + int? audioChannels = audioStream == null ? null : audioStream.Channels; + string audioProfile = audioStream == null ? null : audioStream.Profile; - var timestamp = videoStream == null ? TransportStreamTimestamp.None : mediaSource.Timestamp; - var packetLength = videoStream == null ? null : videoStream.PacketLength; + TransportStreamTimestamp? timestamp = videoStream == null ? TransportStreamTimestamp.None : mediaSource.Timestamp; + int? packetLength = videoStream == null ? null : videoStream.PacketLength; // Check container conditions - if (!conditions.All(i => conditionProcessor.IsVideoConditionSatisfied(i, - audioBitrate, - audioChannels, - width, - height, - bitDepth, - videoBitrate, - videoProfile, - videoLevel, - videoFramerate, - packetLength, - timestamp))) + foreach (ProfileCondition i in conditions) { - return null; + if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp)) + { + return null; + } } - var videoCodec = videoStream == null ? null : videoStream.Codec; + string videoCodec = videoStream == null ? null : videoStream.Codec; if (string.IsNullOrEmpty(videoCodec)) { return null; } - conditions = profile.CodecProfiles - .Where(i => i.Type == CodecType.Video && i.ContainsCodec(videoCodec)) - .SelectMany(i => i.Conditions); + conditions = new List<ProfileCondition>(); + foreach (CodecProfile i in profile.CodecProfiles) + { + if (i.Type == CodecType.Video && i.ContainsCodec(videoCodec)) + conditions.AddRange(i.Conditions); + } - if (!conditions.All(i => conditionProcessor.IsVideoConditionSatisfied(i, - audioBitrate, - audioChannels, - width, - height, - bitDepth, - videoBitrate, - videoProfile, - videoLevel, - videoFramerate, - packetLength, - timestamp))) + foreach (ProfileCondition i in conditions) { - return null; + if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp)) + { + return null; + } } if (audioStream != null) { - var audioCodec = audioStream.Codec; + string audioCodec = audioStream.Codec; if (string.IsNullOrEmpty(audioCodec)) { return null; } - conditions = profile.CodecProfiles - .Where(i => i.Type == CodecType.VideoAudio && i.ContainsCodec(audioCodec)) - .SelectMany(i => i.Conditions); + conditions = new List<ProfileCondition>(); + foreach (CodecProfile i in profile.CodecProfiles) + { + if (i.Type == CodecType.VideoAudio && i.ContainsCodec(audioCodec)) + conditions.AddRange(i.Conditions); + } - if (!conditions.All(i => conditionProcessor.IsVideoAudioConditionSatisfied(i, - audioChannels, - audioBitrate, - audioProfile))) + foreach (ProfileCondition i in conditions) { - return null; + if (!conditionProcessor.IsVideoAudioConditionSatisfied(i, audioChannels, audioBitrate, audioProfile)) + { + return null; + } } } @@ -368,12 +445,6 @@ namespace MediaBrowser.Model.Dlna return false; } - if (options.AudioStreamIndex.HasValue && - item.MediaStreams.Count(i => i.Type == MediaStreamType.Audio) > 1) - { - return false; - } - return IsAudioEligibleForDirectPlay(item, maxBitrate); } @@ -420,10 +491,14 @@ namespace MediaBrowser.Model.Dlna private void ApplyTranscodingConditions(StreamInfo item, IEnumerable<ProfileCondition> conditions) { - foreach (var condition in conditions - .Where(i => !string.IsNullOrEmpty(i.Value))) + foreach (ProfileCondition condition in conditions) { - var value = condition.Value; + string value = condition.Value; + + if (string.IsNullOrEmpty(value)) + { + continue; + } switch (condition.Property) { @@ -515,8 +590,17 @@ namespace MediaBrowser.Model.Dlna if (profile.Container.Length > 0) { // Check container type - var mediaContainer = item.Container ?? string.Empty; - if (!profile.GetContainers().Any(i => string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase))) + string mediaContainer = item.Container ?? string.Empty; + bool any = false; + foreach (string i in profile.GetContainers()) + { + if (string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase)) + { + any = true; + break; + } + } + if (!any) { return false; } @@ -536,29 +620,38 @@ namespace MediaBrowser.Model.Dlna if (profile.Container.Length > 0) { // Check container type - var mediaContainer = item.Container ?? string.Empty; - if (!profile.GetContainers().Any(i => string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase))) + string mediaContainer = item.Container ?? string.Empty; + bool any = false; + foreach (string i in profile.GetContainers()) + { + if (string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase)) + { + any = true; + break; + } + } + if (!any) { return false; } } // Check video codec - var videoCodecs = profile.GetVideoCodecs(); + List<string> videoCodecs = profile.GetVideoCodecs(); if (videoCodecs.Count > 0) { - var videoCodec = videoStream == null ? null : videoStream.Codec; + string videoCodec = videoStream == null ? null : videoStream.Codec; if (string.IsNullOrEmpty(videoCodec) || !videoCodecs.Contains(videoCodec, StringComparer.OrdinalIgnoreCase)) { return false; } } - var audioCodecs = profile.GetAudioCodecs(); + List<string> audioCodecs = profile.GetAudioCodecs(); if (audioCodecs.Count > 0) { // Check audio codecs - var audioCodec = audioStream == null ? null : audioStream.Codec; + string audioCodec = audioStream == null ? null : audioStream.Codec; if (string.IsNullOrEmpty(audioCodec) || !audioCodecs.Contains(audioCodec, StringComparer.OrdinalIgnoreCase)) { return false; diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index fe49227e4..e4ec0d853 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -1,11 +1,10 @@ using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.MediaInfo; using System; using System.Collections.Generic; using System.Globalization; -using System.Linq; -using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Model.Dlna { @@ -79,9 +78,9 @@ namespace MediaBrowser.Model.Dlna throw new ArgumentNullException(baseUrl); } - var dlnaCommand = BuildDlnaParam(this); + string dlnaCommand = BuildDlnaParam(this); - var extension = string.IsNullOrEmpty(Container) ? string.Empty : "." + Container; + string extension = string.IsNullOrEmpty(Container) ? string.Empty : "." + Container; baseUrl = baseUrl.TrimEnd('/'); @@ -98,11 +97,11 @@ namespace MediaBrowser.Model.Dlna return string.Format("{0}/videos/{1}/stream{2}?{3}", baseUrl, ItemId, extension, dlnaCommand); } + private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); + private static string BuildDlnaParam(StreamInfo item) { - var usCulture = new CultureInfo("en-US"); - - var list = new List<string> + List<string> list = new List<string> { item.DeviceProfileId ?? string.Empty, item.DeviceId ?? string.Empty, @@ -110,16 +109,16 @@ namespace MediaBrowser.Model.Dlna (item.IsDirectStream).ToString().ToLower(), item.VideoCodec ?? string.Empty, item.AudioCodec ?? string.Empty, - item.AudioStreamIndex.HasValue ? item.AudioStreamIndex.Value.ToString(usCulture) : string.Empty, - item.SubtitleStreamIndex.HasValue ? item.SubtitleStreamIndex.Value.ToString(usCulture) : string.Empty, - item.VideoBitrate.HasValue ? item.VideoBitrate.Value.ToString(usCulture) : string.Empty, - item.AudioBitrate.HasValue ? item.AudioBitrate.Value.ToString(usCulture) : string.Empty, - item.MaxAudioChannels.HasValue ? item.MaxAudioChannels.Value.ToString(usCulture) : string.Empty, - item.MaxFramerate.HasValue ? item.MaxFramerate.Value.ToString(usCulture) : string.Empty, - item.MaxWidth.HasValue ? item.MaxWidth.Value.ToString(usCulture) : string.Empty, - item.MaxHeight.HasValue ? item.MaxHeight.Value.ToString(usCulture) : string.Empty, - item.StartPositionTicks.ToString(usCulture), - item.VideoLevel.HasValue ? item.VideoLevel.Value.ToString(usCulture) : string.Empty + item.AudioStreamIndex.HasValue ? item.AudioStreamIndex.Value.ToString(UsCulture) : string.Empty, + item.SubtitleStreamIndex.HasValue ? item.SubtitleStreamIndex.Value.ToString(UsCulture) : string.Empty, + item.VideoBitrate.HasValue ? item.VideoBitrate.Value.ToString(UsCulture) : string.Empty, + item.AudioBitrate.HasValue ? item.AudioBitrate.Value.ToString(UsCulture) : string.Empty, + item.MaxAudioChannels.HasValue ? item.MaxAudioChannels.Value.ToString(UsCulture) : string.Empty, + item.MaxFramerate.HasValue ? item.MaxFramerate.Value.ToString(UsCulture) : string.Empty, + item.MaxWidth.HasValue ? item.MaxWidth.Value.ToString(UsCulture) : string.Empty, + item.MaxHeight.HasValue ? item.MaxHeight.Value.ToString(UsCulture) : string.Empty, + item.StartPositionTicks.ToString(UsCulture), + item.VideoLevel.HasValue ? item.VideoLevel.Value.ToString(UsCulture) : string.Empty }; return string.Format("Params={0}", string.Join(";", list.ToArray())); @@ -134,14 +133,17 @@ namespace MediaBrowser.Model.Dlna { if (MediaSource != null) { - var audioStreams = MediaSource.MediaStreams.Where(i => i.Type == MediaStreamType.Audio); - if (AudioStreamIndex.HasValue) { - return audioStreams.FirstOrDefault(i => i.Index == AudioStreamIndex.Value); + foreach (MediaStream i in MediaSource.MediaStreams) + { + if (i.Index == AudioStreamIndex.Value && i.Type == MediaStreamType.Audio) + return i; + } + return null; } - return audioStreams.FirstOrDefault(); + return MediaSource.DefaultAudioStream; } return null; @@ -157,8 +159,7 @@ namespace MediaBrowser.Model.Dlna { if (MediaSource != null) { - return MediaSource.MediaStreams - .FirstOrDefault(i => i.Type == MediaStreamType.Video && (i.Codec ?? string.Empty).IndexOf("jpeg", StringComparison.OrdinalIgnoreCase) == -1); + return MediaSource.VideoStream; } return null; @@ -172,7 +173,7 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetAudioStream; + MediaStream stream = TargetAudioStream; return stream == null ? null : stream.SampleRate; } } @@ -184,7 +185,7 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetVideoStream; + MediaStream stream = TargetVideoStream; return stream == null || !IsDirectStream ? null : stream.BitDepth; } } @@ -196,7 +197,7 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetVideoStream; + MediaStream stream = TargetVideoStream; return MaxFramerate.HasValue && !IsDirectStream ? MaxFramerate : stream == null ? null : stream.AverageFrameRate ?? stream.RealFrameRate; @@ -210,7 +211,7 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetVideoStream; + MediaStream stream = TargetVideoStream; return VideoLevel.HasValue && !IsDirectStream ? VideoLevel : stream == null ? null : stream.Level; @@ -224,7 +225,7 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetVideoStream; + MediaStream stream = TargetVideoStream; return !IsDirectStream ? null : stream == null ? null : stream.PacketLength; @@ -238,7 +239,7 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetVideoStream; + MediaStream stream = TargetVideoStream; return !string.IsNullOrEmpty(VideoProfile) && !IsDirectStream ? VideoProfile : stream == null ? null : stream.Profile; @@ -252,7 +253,7 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetAudioStream; + MediaStream stream = TargetAudioStream; return AudioBitrate.HasValue && !IsDirectStream ? AudioBitrate : stream == null ? null : stream.BitRate; @@ -266,8 +267,8 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetAudioStream; - var streamChannels = stream == null ? null : stream.Channels; + MediaStream stream = TargetAudioStream; + int? streamChannels = stream == null ? null : stream.Channels; return MaxAudioChannels.HasValue && !IsDirectStream ? (streamChannels.HasValue ? Math.Min(MaxAudioChannels.Value, streamChannels.Value) : MaxAudioChannels.Value) @@ -282,7 +283,7 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetAudioStream; + MediaStream stream = TargetAudioStream; return IsDirectStream ? (stream == null ? null : stream.Codec) @@ -304,10 +305,10 @@ namespace MediaBrowser.Model.Dlna if (RunTimeTicks.HasValue) { - var totalBitrate = TargetTotalBitrate; + int? totalBitrate = TargetTotalBitrate; return totalBitrate.HasValue ? - Convert.ToInt64(totalBitrate * TimeSpan.FromTicks(RunTimeTicks.Value).TotalSeconds) : + Convert.ToInt64(totalBitrate.Value * TimeSpan.FromTicks(RunTimeTicks.Value).TotalSeconds) : (long?)null; } @@ -319,7 +320,7 @@ namespace MediaBrowser.Model.Dlna { get { - var stream = TargetVideoStream; + MediaStream stream = TargetVideoStream; return VideoBitrate.HasValue && !IsDirectStream ? VideoBitrate @@ -331,7 +332,7 @@ namespace MediaBrowser.Model.Dlna { get { - var defaultValue = string.Equals(Container, "m2ts", StringComparison.OrdinalIgnoreCase) + TransportStreamTimestamp defaultValue = string.Equals(Container, "m2ts", StringComparison.OrdinalIgnoreCase) ? TransportStreamTimestamp.Valid : TransportStreamTimestamp.None; @@ -353,17 +354,17 @@ namespace MediaBrowser.Model.Dlna { get { - var videoStream = TargetVideoStream; + MediaStream videoStream = TargetVideoStream; if (videoStream != null && videoStream.Width.HasValue && videoStream.Height.HasValue) { - var size = new ImageSize + ImageSize size = new ImageSize { Width = videoStream.Width.Value, Height = videoStream.Height.Value }; - var newSize = DrawingUtils.Resize(size, + ImageSize newSize = DrawingUtils.Resize(size, null, null, MaxWidth, @@ -380,17 +381,17 @@ namespace MediaBrowser.Model.Dlna { get { - var videoStream = TargetVideoStream; + MediaStream videoStream = TargetVideoStream; if (videoStream != null && videoStream.Width.HasValue && videoStream.Height.HasValue) { - var size = new ImageSize + ImageSize size = new ImageSize { Width = videoStream.Width.Value, Height = videoStream.Height.Value }; - var newSize = DrawingUtils.Resize(size, + ImageSize newSize = DrawingUtils.Resize(size, null, null, MaxWidth, @@ -403,47 +404,4 @@ namespace MediaBrowser.Model.Dlna } } } - - /// <summary> - /// Class AudioOptions. - /// </summary> - public class AudioOptions - { - public string ItemId { get; set; } - public List<MediaSourceInfo> MediaSources { get; set; } - public DeviceProfile Profile { get; set; } - - /// <summary> - /// Optional. Only needed if a specific AudioStreamIndex or SubtitleStreamIndex are requested. - /// </summary> - public string MediaSourceId { get; set; } - - public string DeviceId { get; set; } - - /// <summary> - /// Allows an override of supported number of audio channels - /// Example: DeviceProfile supports five channel, but user only has stereo speakers - /// </summary> - public int? MaxAudioChannels { get; set; } - - /// <summary> - /// The application's configured quality setting - /// </summary> - public int? MaxBitrate { get; set; } - } - - /// <summary> - /// Class VideoOptions. - /// </summary> - public class VideoOptions : AudioOptions - { - public int? AudioStreamIndex { get; set; } - public int? SubtitleStreamIndex { get; set; } - public int? MaxAudioTranscodingBitrate { get; set; } - - public VideoOptions() - { - MaxAudioTranscodingBitrate = 128000; - } - } } diff --git a/MediaBrowser.Model/Dlna/TranscodeSeekInfo.cs b/MediaBrowser.Model/Dlna/TranscodeSeekInfo.cs new file mode 100644 index 000000000..564ce5c60 --- /dev/null +++ b/MediaBrowser.Model/Dlna/TranscodeSeekInfo.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Dlna +{ + public enum TranscodeSeekInfo + { + Auto = 0, + Bytes = 1 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs index ba02e9be2..51f4bfe61 100644 --- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs +++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; using System.Xml.Serialization; namespace MediaBrowser.Model.Dlna @@ -35,13 +34,12 @@ namespace MediaBrowser.Model.Dlna public List<string> GetAudioCodecs() { - return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList(); + List<string> list = new List<string>(); + foreach (string i in (AudioCodec ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; } } - - public enum TranscodeSeekInfo - { - Auto = 0, - Bytes = 1 - } } diff --git a/MediaBrowser.Model/Dlna/VideoOptions.cs b/MediaBrowser.Model/Dlna/VideoOptions.cs new file mode 100644 index 000000000..39a5ab1b1 --- /dev/null +++ b/MediaBrowser.Model/Dlna/VideoOptions.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Dlna +{ + /// <summary> + /// Class VideoOptions. + /// </summary> + public class VideoOptions : AudioOptions + { + public int? AudioStreamIndex { get; set; } + public int? SubtitleStreamIndex { get; set; } + public int? MaxAudioTranscodingBitrate { get; set; } + + public VideoOptions() + { + MaxAudioTranscodingBitrate = 128000; + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/XmlAttribute.cs b/MediaBrowser.Model/Dlna/XmlAttribute.cs new file mode 100644 index 000000000..e8e13ba0d --- /dev/null +++ b/MediaBrowser.Model/Dlna/XmlAttribute.cs @@ -0,0 +1,13 @@ +using System.Xml.Serialization; + +namespace MediaBrowser.Model.Dlna +{ + public class XmlAttribute + { + [XmlAttribute("name")] + public string Name { get; set; } + + [XmlAttribute("value")] + public string Value { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Drawing/DrawingUtils.cs b/MediaBrowser.Model/Drawing/DrawingUtils.cs index e95b5e375..fcc5ddd16 100644 --- a/MediaBrowser.Model/Drawing/DrawingUtils.cs +++ b/MediaBrowser.Model/Drawing/DrawingUtils.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace MediaBrowser.Model.Drawing +namespace MediaBrowser.Model.Drawing { /// <summary> /// Class DrawingUtils @@ -16,7 +14,12 @@ namespace MediaBrowser.Model.Drawing /// <returns>ImageSize.</returns> public static ImageSize Scale(double currentWidth, double currentHeight, double scaleFactor) { - return Scale(new ImageSize { Width = currentWidth, Height = currentHeight }, scaleFactor); + return Scale(new ImageSize + { + Width = currentWidth, + Height = currentHeight + + }, scaleFactor); } /// <summary> @@ -27,9 +30,9 @@ namespace MediaBrowser.Model.Drawing /// <returns>ImageSize.</returns> public static ImageSize Scale(ImageSize size, double scaleFactor) { - var newWidth = size.Width * scaleFactor; + double newWidth = size.Width * scaleFactor; - return Resize(size.Width, size.Height, newWidth); + return Resize(size.Width, size.Height, newWidth, null, null, null); } /// <summary> @@ -42,9 +45,19 @@ namespace MediaBrowser.Model.Drawing /// <param name="maxWidth">A max fixed width, if desired</param> /// <param name="maxHeight">A max fixed height, if desired</param> /// <returns>ImageSize.</returns> - public static ImageSize Resize(double currentWidth, double currentHeight, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null) + public static ImageSize Resize(double currentWidth, + double currentHeight, + double? width, + double? height, + double? maxWidth, + double? maxHeight) { - return Resize(new ImageSize { Width = currentWidth, Height = currentHeight }, width, height, maxWidth, maxHeight); + return Resize(new ImageSize + { + Width = currentWidth, + Height = currentHeight + + }, width, height, maxWidth, maxHeight); } /// <summary> @@ -56,7 +69,11 @@ namespace MediaBrowser.Model.Drawing /// <param name="maxWidth">A max fixed width, if desired</param> /// <param name="maxHeight">A max fixed height, if desired</param> /// <returns>A new size object</returns> - public static ImageSize Resize(ImageSize size, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null) + public static ImageSize Resize(ImageSize size, + double? width, + double? height, + double? maxWidth, + double? maxHeight) { double newWidth = size.Width; double newHeight = size.Height; @@ -79,13 +96,13 @@ namespace MediaBrowser.Model.Drawing newWidth = width.Value; } - if (maxHeight.HasValue && maxHeight < newHeight) + if (maxHeight.HasValue && maxHeight.Value < newHeight) { newWidth = GetNewWidth(newHeight, newWidth, maxHeight.Value); newHeight = maxHeight.Value; } - if (maxWidth.HasValue && maxWidth < newWidth) + if (maxWidth.HasValue && maxWidth.Value < newWidth) { newHeight = GetNewHeight(newHeight, newWidth, maxWidth.Value); newWidth = maxWidth.Value; @@ -103,7 +120,7 @@ namespace MediaBrowser.Model.Drawing /// <returns>System.Double.</returns> private static double GetNewWidth(double currentHeight, double currentWidth, double newHeight) { - var scaleFactor = newHeight; + double scaleFactor = newHeight; scaleFactor /= currentHeight; scaleFactor *= currentWidth; @@ -119,90 +136,11 @@ namespace MediaBrowser.Model.Drawing /// <returns>System.Double.</returns> private static double GetNewHeight(double currentHeight, double currentWidth, double newWidth) { - var scaleFactor = newWidth; + double scaleFactor = newWidth; scaleFactor /= currentWidth; scaleFactor *= currentHeight; return scaleFactor; } } - - /// <summary> - /// Struct ImageSize - /// </summary> - public struct ImageSize - { - private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); - - private double _height; - private double _width; - - /// <summary> - /// Gets or sets the height. - /// </summary> - /// <value>The height.</value> - public double Height - { - get - { - return _height; - } - set - { - _height = value; - } - } - - /// <summary> - /// Gets or sets the width. - /// </summary> - /// <value>The width.</value> - public double Width - { - get { return _width; } - set { _width = value; } - } - - public bool Equals(ImageSize size) - { - return Width.Equals(size.Width) && Height.Equals(size.Height); - } - - public override string ToString() - { - return string.Format("{0}-{1}", Width, Height); - } - - public ImageSize(string value) - { - _width = 0; - - _height = 0; - - ParseValue(value); - } - - private void ParseValue(string value) - { - if (!string.IsNullOrEmpty(value)) - { - var parts = value.Split('-'); - - if (parts.Length == 2) - { - double val; - - if (double.TryParse(parts[0], NumberStyles.Any, UsCulture, out val)) - { - _width = val; - } - - if (double.TryParse(parts[1], NumberStyles.Any, UsCulture, out val)) - { - _height = val; - } - } - } - } - } } diff --git a/MediaBrowser.Model/Drawing/ImageSize.cs b/MediaBrowser.Model/Drawing/ImageSize.cs new file mode 100644 index 000000000..acc245938 --- /dev/null +++ b/MediaBrowser.Model/Drawing/ImageSize.cs @@ -0,0 +1,83 @@ +using System.Globalization; + +namespace MediaBrowser.Model.Drawing +{ + /// <summary> + /// Struct ImageSize + /// </summary> + public struct ImageSize + { + private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); + + private double _height; + private double _width; + + /// <summary> + /// Gets or sets the height. + /// </summary> + /// <value>The height.</value> + public double Height + { + get + { + return _height; + } + set + { + _height = value; + } + } + + /// <summary> + /// Gets or sets the width. + /// </summary> + /// <value>The width.</value> + public double Width + { + get { return _width; } + set { _width = value; } + } + + public bool Equals(ImageSize size) + { + return Width.Equals(size.Width) && Height.Equals(size.Height); + } + + public override string ToString() + { + return string.Format("{0}-{1}", Width, Height); + } + + public ImageSize(string value) + { + _width = 0; + + _height = 0; + + ParseValue(value); + } + + private void ParseValue(string value) + { + if (!string.IsNullOrEmpty(value)) + { + string[] parts = value.Split('-'); + + if (parts.Length == 2) + { + double val; + + if (double.TryParse(parts[0], NumberStyles.Any, UsCulture, out val)) + { + _width = val; + } + + if (double.TryParse(parts[1], NumberStyles.Any, UsCulture, out val)) + { + _height = val; + } + } + } + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index a4bb0646a..c469d97d6 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -311,7 +311,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the parent backdrop image tags. /// </summary> /// <value>The parent backdrop image tags.</value> - public List<Guid> ParentBackdropImageTags { get; set; } + public List<string> ParentBackdropImageTags { get; set; } /// <summary> /// Gets or sets the local trailer count. @@ -326,12 +326,6 @@ namespace MediaBrowser.Model.Dto public UserItemDataDto UserData { get; set; } /// <summary> - /// Gets or sets the recently added item count. - /// </summary> - /// <value>The recently added item count.</value> - public int? RecentlyAddedItemCount { get; set; } - - /// <summary> /// Gets or sets the played percentage. /// </summary> /// <value>The played percentage.</value> @@ -466,13 +460,13 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the album image tag. /// </summary> /// <value>The album image tag.</value> - public Guid? AlbumPrimaryImageTag { get; set; } + public string AlbumPrimaryImageTag { get; set; } /// <summary> /// Gets or sets the series primary image tag. /// </summary> /// <value>The series primary image tag.</value> - public Guid? SeriesPrimaryImageTag { get; set; } + public string SeriesPrimaryImageTag { get; set; } /// <summary> /// Gets or sets the album artist. @@ -529,25 +523,25 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the image tags. /// </summary> /// <value>The image tags.</value> - public Dictionary<ImageType, Guid> ImageTags { get; set; } + public Dictionary<ImageType, string> ImageTags { get; set; } /// <summary> /// Gets or sets the backdrop image tags. /// </summary> /// <value>The backdrop image tags.</value> - public List<Guid> BackdropImageTags { get; set; } + public List<string> BackdropImageTags { get; set; } /// <summary> /// Gets or sets the screenshot image tags. /// </summary> /// <value>The screenshot image tags.</value> - public List<Guid> ScreenshotImageTags { get; set; } + public List<string> ScreenshotImageTags { get; set; } /// <summary> /// Gets or sets the parent logo image tag. /// </summary> /// <value>The parent logo image tag.</value> - public Guid? ParentLogoImageTag { get; set; } + public string ParentLogoImageTag { get; set; } /// <summary> /// If the item does not have a art, this will hold the Id of the Parent that has one. @@ -559,13 +553,13 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the parent art image tag. /// </summary> /// <value>The parent art image tag.</value> - public Guid? ParentArtImageTag { get; set; } + public string ParentArtImageTag { get; set; } /// <summary> /// Gets or sets the series thumb image tag. /// </summary> /// <value>The series thumb image tag.</value> - public Guid? SeriesThumbImageTag { get; set; } + public string SeriesThumbImageTag { get; set; } /// <summary> /// Gets or sets the series studio. @@ -583,7 +577,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the parent thumb image tag. /// </summary> /// <value>The parent thumb image tag.</value> - public Guid? ParentThumbImageTag { get; set; } + public string ParentThumbImageTag { get; set; } /// <summary> /// Gets or sets the chapters. diff --git a/MediaBrowser.Model/Dto/BaseItemPerson.cs b/MediaBrowser.Model/Dto/BaseItemPerson.cs index 1cc3f722d..b8393f444 100644 --- a/MediaBrowser.Model/Dto/BaseItemPerson.cs +++ b/MediaBrowser.Model/Dto/BaseItemPerson.cs @@ -1,5 +1,4 @@ -using System; -using System.ComponentModel; +using System.ComponentModel; using System.Diagnostics; using System.Runtime.Serialization; @@ -18,6 +17,12 @@ namespace MediaBrowser.Model.Dto 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 role. /// </summary> /// <value>The role.</value> @@ -33,7 +38,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the primary image tag. /// </summary> /// <value>The primary image tag.</value> - public Guid? PrimaryImageTag { get; set; } + public string PrimaryImageTag { get; set; } /// <summary> /// Gets a value indicating whether this instance has primary image. @@ -44,7 +49,7 @@ namespace MediaBrowser.Model.Dto { get { - return PrimaryImageTag.HasValue; + return PrimaryImageTag != null; } } diff --git a/MediaBrowser.Model/Dto/ChapterInfoDto.cs b/MediaBrowser.Model/Dto/ChapterInfoDto.cs index 5a72110ce..09dd2d582 100644 --- a/MediaBrowser.Model/Dto/ChapterInfoDto.cs +++ b/MediaBrowser.Model/Dto/ChapterInfoDto.cs @@ -27,7 +27,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the image tag. /// </summary> /// <value>The image tag.</value> - public Guid? ImageTag { get; set; } + public string ImageTag { get; set; } /// <summary> /// Gets a value indicating whether this instance has image. @@ -36,7 +36,7 @@ namespace MediaBrowser.Model.Dto [IgnoreDataMember] public bool HasImage { - get { return ImageTag.HasValue; } + get { return ImageTag != null; } } public event PropertyChangedEventHandler PropertyChanged; diff --git a/MediaBrowser.Model/Dto/IItemDto.cs b/MediaBrowser.Model/Dto/IItemDto.cs index 3ec641918..af46d29b9 100644 --- a/MediaBrowser.Model/Dto/IItemDto.cs +++ b/MediaBrowser.Model/Dto/IItemDto.cs @@ -18,10 +18,4 @@ namespace MediaBrowser.Model.Dto /// <value>The original primary image aspect ratio.</value> double? OriginalPrimaryImageAspectRatio { get; set; } } - - public enum RatingType - { - Score, - Likes - } } diff --git a/MediaBrowser.Model/Dto/ImageInfo.cs b/MediaBrowser.Model/Dto/ImageInfo.cs index 0850ee0a4..fa3a38fcb 100644 --- a/MediaBrowser.Model/Dto/ImageInfo.cs +++ b/MediaBrowser.Model/Dto/ImageInfo.cs @@ -23,7 +23,7 @@ namespace MediaBrowser.Model.Dto /// <summary> /// The image tag /// </summary> - public Guid ImageTag; + public string ImageTag; /// <summary> /// Gets or sets the path. diff --git a/MediaBrowser.Model/Dto/ImageOptions.cs b/MediaBrowser.Model/Dto/ImageOptions.cs index 7fe162ff9..08ac7906a 100644 --- a/MediaBrowser.Model/Dto/ImageOptions.cs +++ b/MediaBrowser.Model/Dto/ImageOptions.cs @@ -56,7 +56,7 @@ namespace MediaBrowser.Model.Dto /// If set this will result in strong, unconditional response caching /// </summary> /// <value>The hash.</value> - public Guid? Tag { get; set; } + public string Tag { get; set; } /// <summary> /// Gets or sets a value indicating whether [crop whitespace]. diff --git a/MediaBrowser.Model/Dto/ItemByNameCounts.cs b/MediaBrowser.Model/Dto/ItemByNameCounts.cs index 31b6d2da0..7c51f07bd 100644 --- a/MediaBrowser.Model/Dto/ItemByNameCounts.cs +++ b/MediaBrowser.Model/Dto/ItemByNameCounts.cs @@ -7,7 +7,7 @@ namespace MediaBrowser.Model.Dto /// </summary> public class ItemByNameCounts { - public Guid UserId { get; set; } + public string UserId { get; set; } /// <summary> /// Gets or sets the total count. diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs new file mode 100644 index 000000000..4fe586333 --- /dev/null +++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs @@ -0,0 +1,86 @@ +using System; +using System.Runtime.Serialization; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.MediaInfo; +using System.Collections.Generic; + +namespace MediaBrowser.Model.Dto +{ + public class MediaSourceInfo + { + public string Id { get; set; } + + public string Path { get; set; } + + public string Container { get; set; } + public long? Size { get; set; } + + public LocationType LocationType { get; set; } + + public string Name { get; set; } + + public long? RunTimeTicks { get; set; } + + public VideoType? VideoType { get; set; } + + public IsoType? IsoType { get; set; } + + public Video3DFormat? Video3DFormat { get; set; } + + public List<MediaStream> MediaStreams { get; set; } + + public List<string> Formats { get; set; } + + public int? Bitrate { get; set; } + + public TransportStreamTimestamp? Timestamp { get; set; } + + public MediaSourceInfo() + { + Formats = new List<string>(); + MediaStreams = new List<MediaStream>(); + } + + [IgnoreDataMember] + public MediaStream DefaultAudioStream + { + get + { + foreach (MediaStream i in MediaStreams) + { + if (i.Type == MediaStreamType.Audio && i.IsDefault) + { + return i; + } + } + + foreach (MediaStream i in MediaStreams) + { + if (i.Type == MediaStreamType.Audio) + { + return i; + } + } + + return null; + } + } + + [IgnoreDataMember] + public MediaStream VideoStream + { + get + { + foreach (MediaStream i in MediaStreams) + { + if (i.Type == MediaStreamType.Video && (i.Codec ?? string.Empty).IndexOf("jpeg", StringComparison.OrdinalIgnoreCase) == -1) + { + return i; + } + } + + return null; + } + } + } +} diff --git a/MediaBrowser.Model/Dto/MediaVersionInfo.cs b/MediaBrowser.Model/Dto/MediaVersionInfo.cs deleted file mode 100644 index 2e94f4f0c..000000000 --- a/MediaBrowser.Model/Dto/MediaVersionInfo.cs +++ /dev/null @@ -1,42 +0,0 @@ -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.MediaInfo; -using System.Collections.Generic; - -namespace MediaBrowser.Model.Dto -{ - public class MediaSourceInfo - { - public string Id { get; set; } - - public string Path { get; set; } - - public string Container { get; set; } - public long? Size { get; set; } - - public LocationType LocationType { get; set; } - - public string Name { get; set; } - - public long? RunTimeTicks { get; set; } - - public VideoType? VideoType { get; set; } - - public IsoType? IsoType { get; set; } - - public Video3DFormat? Video3DFormat { get; set; } - - public List<MediaStream> MediaStreams { get; set; } - - public List<string> Formats { get; set; } - - public int? Bitrate { get; set; } - - public TransportStreamTimestamp? Timestamp { get; set; } - - public MediaSourceInfo() - { - Formats = new List<string>(); - MediaStreams = new List<MediaStream>(); - } - } -} diff --git a/MediaBrowser.Model/Dto/RatingType.cs b/MediaBrowser.Model/Dto/RatingType.cs new file mode 100644 index 000000000..f151adce9 --- /dev/null +++ b/MediaBrowser.Model/Dto/RatingType.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Dto +{ + public enum RatingType + { + Score, + Likes + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dto/RecommendationDto.cs b/MediaBrowser.Model/Dto/RecommendationDto.cs index 68b71e466..275f97c28 100644 --- a/MediaBrowser.Model/Dto/RecommendationDto.cs +++ b/MediaBrowser.Model/Dto/RecommendationDto.cs @@ -11,19 +11,4 @@ namespace MediaBrowser.Model.Dto public string CategoryId { get; set; } } - - public enum RecommendationType - { - SimilarToRecentlyPlayed = 0, - - SimilarToLikedItem = 1, - - HasDirectorFromRecentlyPlayed = 2, - - HasActorFromRecentlyPlayed = 3, - - HasLikedDirector = 4, - - HasLikedActor = 5 - } } diff --git a/MediaBrowser.Model/Dto/RecommendationType.cs b/MediaBrowser.Model/Dto/RecommendationType.cs new file mode 100644 index 000000000..1adf9b082 --- /dev/null +++ b/MediaBrowser.Model/Dto/RecommendationType.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Dto +{ + public enum RecommendationType + { + SimilarToRecentlyPlayed = 0, + + SimilarToLikedItem = 1, + + HasDirectorFromRecentlyPlayed = 2, + + HasActorFromRecentlyPlayed = 3, + + HasLikedDirector = 4, + + HasLikedActor = 5 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dto/StreamOptions.cs b/MediaBrowser.Model/Dto/StreamOptions.cs index b1ead2ca3..9cf301270 100644 --- a/MediaBrowser.Model/Dto/StreamOptions.cs +++ b/MediaBrowser.Model/Dto/StreamOptions.cs @@ -1,103 +1,6 @@ namespace MediaBrowser.Model.Dto { /// <summary> - /// Class VideoStreamOptions - /// </summary> - public class VideoStreamOptions : StreamOptions - { - /// <summary> - /// Gets or sets the video codec. - /// Omit to copy - /// </summary> - /// <value>The video codec.</value> - public string VideoCodec { get; set; } - - /// <summary> - /// Gets or sets the video bit rate. - /// </summary> - /// <value>The video bit rate.</value> - public int? VideoBitRate { get; set; } - - /// <summary> - /// Gets or sets the width. - /// </summary> - /// <value>The width.</value> - public int? Width { get; set; } - - /// <summary> - /// Gets or sets the height. - /// </summary> - /// <value>The height.</value> - public int? Height { get; set; } - - /// <summary> - /// Gets or sets the width of the max. - /// </summary> - /// <value>The width of the max.</value> - public int? MaxWidth { get; set; } - - /// <summary> - /// Gets or sets the height of the max. - /// </summary> - /// <value>The height of the max.</value> - public int? MaxHeight { get; set; } - - /// <summary> - /// Gets or sets the frame rate. - /// </summary> - /// <value>The frame rate.</value> - public double? FrameRate { get; set; } - - /// <summary> - /// Gets or sets the index of the audio stream. - /// </summary> - /// <value>The index of the audio stream.</value> - public int? AudioStreamIndex { get; set; } - - /// <summary> - /// Gets or sets the index of the video stream. - /// </summary> - /// <value>The index of the video stream.</value> - public int? VideoStreamIndex { get; set; } - - /// <summary> - /// Gets or sets the index of the subtitle stream. - /// </summary> - /// <value>The index of the subtitle stream.</value> - public int? SubtitleStreamIndex { get; set; } - - /// <summary> - /// Gets or sets the profile. - /// </summary> - /// <value>The profile.</value> - public string Profile { get; set; } - - /// <summary> - /// Gets or sets the level. - /// </summary> - /// <value>The level.</value> - public string Level { get; set; } - - /// <summary> - /// Gets or sets the baseline stream audio bit rate. - /// </summary> - /// <value>The baseline stream audio bit rate.</value> - public int? BaselineStreamAudioBitRate { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether [append baseline stream]. - /// </summary> - /// <value><c>true</c> if [append baseline stream]; otherwise, <c>false</c>.</value> - public bool AppendBaselineStream { get; set; } - - /// <summary> - /// Gets or sets the time stamp offset ms. Only used with HLS. - /// </summary> - /// <value>The time stamp offset ms.</value> - public int? TimeStampOffsetMs { get; set; } - } - - /// <summary> /// Class StreamOptions /// </summary> public class StreamOptions @@ -158,19 +61,4 @@ /// <value>The device id.</value> public string DeviceId { get; set; } } - - public class SubtitleOptions - { - /// <summary> - /// Gets or sets the item identifier. - /// </summary> - /// <value>The item identifier.</value> - public string ItemId { get; set; } - - /// <summary> - /// Gets or sets the index of the stream. - /// </summary> - /// <value>The index of the stream.</value> - public int StreamIndex { get; set; } - } } diff --git a/MediaBrowser.Model/Dto/StudioDto.cs b/MediaBrowser.Model/Dto/StudioDto.cs index 696213a40..4f21784fd 100644 --- a/MediaBrowser.Model/Dto/StudioDto.cs +++ b/MediaBrowser.Model/Dto/StudioDto.cs @@ -21,7 +21,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the primary image tag. /// </summary> /// <value>The primary image tag.</value> - public Guid? PrimaryImageTag { get; set; } + public string PrimaryImageTag { get; set; } /// <summary> /// Gets a value indicating whether this instance has primary image. @@ -32,7 +32,7 @@ namespace MediaBrowser.Model.Dto { get { - return PrimaryImageTag.HasValue; + return PrimaryImageTag != null; } } diff --git a/MediaBrowser.Model/Dto/SubtitleDownloadOptions.cs b/MediaBrowser.Model/Dto/SubtitleDownloadOptions.cs new file mode 100644 index 000000000..a0b49f42c --- /dev/null +++ b/MediaBrowser.Model/Dto/SubtitleDownloadOptions.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Dto +{ + public class SubtitleDownloadOptions + { + /// <summary> + /// Gets or sets the item identifier. + /// </summary> + /// <value>The item identifier.</value> + public string ItemId { get; set; } + + /// <summary> + /// Gets or sets the index of the stream. + /// </summary> + /// <value>The index of the stream.</value> + public int StreamIndex { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs index efbd64343..c4a43c512 100644 --- a/MediaBrowser.Model/Dto/UserDto.cs +++ b/MediaBrowser.Model/Dto/UserDto.cs @@ -28,7 +28,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the primary image tag. /// </summary> /// <value>The primary image tag.</value> - public Guid? PrimaryImageTag { get; set; } + public string PrimaryImageTag { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance has password. @@ -73,7 +73,7 @@ namespace MediaBrowser.Model.Dto [IgnoreDataMember] public bool HasPrimaryImage { - get { return PrimaryImageTag.HasValue; } + get { return PrimaryImageTag != null; } } /// <summary> diff --git a/MediaBrowser.Model/Dto/VideoStreamOptions.cs b/MediaBrowser.Model/Dto/VideoStreamOptions.cs new file mode 100644 index 000000000..73dc70018 --- /dev/null +++ b/MediaBrowser.Model/Dto/VideoStreamOptions.cs @@ -0,0 +1,99 @@ +namespace MediaBrowser.Model.Dto +{ + /// <summary> + /// Class VideoStreamOptions + /// </summary> + public class VideoStreamOptions : StreamOptions + { + /// <summary> + /// Gets or sets the video codec. + /// Omit to copy + /// </summary> + /// <value>The video codec.</value> + public string VideoCodec { get; set; } + + /// <summary> + /// Gets or sets the video bit rate. + /// </summary> + /// <value>The video bit rate.</value> + public int? VideoBitRate { get; set; } + + /// <summary> + /// Gets or sets the width. + /// </summary> + /// <value>The width.</value> + public int? Width { get; set; } + + /// <summary> + /// Gets or sets the height. + /// </summary> + /// <value>The height.</value> + public int? Height { get; set; } + + /// <summary> + /// Gets or sets the width of the max. + /// </summary> + /// <value>The width of the max.</value> + public int? MaxWidth { get; set; } + + /// <summary> + /// Gets or sets the height of the max. + /// </summary> + /// <value>The height of the max.</value> + public int? MaxHeight { get; set; } + + /// <summary> + /// Gets or sets the frame rate. + /// </summary> + /// <value>The frame rate.</value> + public double? FrameRate { get; set; } + + /// <summary> + /// Gets or sets the index of the audio stream. + /// </summary> + /// <value>The index of the audio stream.</value> + public int? AudioStreamIndex { get; set; } + + /// <summary> + /// Gets or sets the index of the video stream. + /// </summary> + /// <value>The index of the video stream.</value> + public int? VideoStreamIndex { get; set; } + + /// <summary> + /// Gets or sets the index of the subtitle stream. + /// </summary> + /// <value>The index of the subtitle stream.</value> + public int? SubtitleStreamIndex { get; set; } + + /// <summary> + /// Gets or sets the profile. + /// </summary> + /// <value>The profile.</value> + public string Profile { get; set; } + + /// <summary> + /// Gets or sets the level. + /// </summary> + /// <value>The level.</value> + public string Level { get; set; } + + /// <summary> + /// Gets or sets the baseline stream audio bit rate. + /// </summary> + /// <value>The baseline stream audio bit rate.</value> + public int? BaselineStreamAudioBitRate { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether [append baseline stream]. + /// </summary> + /// <value><c>true</c> if [append baseline stream]; otherwise, <c>false</c>.</value> + public bool AppendBaselineStream { get; set; } + + /// <summary> + /// Gets or sets the time stamp offset ms. Only used with HLS. + /// </summary> + /// <value>The time stamp offset ms.</value> + public int? TimeStampOffsetMs { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/BaseItemInfo.cs b/MediaBrowser.Model/Entities/BaseItemInfo.cs index a280b1f71..88af18289 100644 --- a/MediaBrowser.Model/Entities/BaseItemInfo.cs +++ b/MediaBrowser.Model/Entities/BaseItemInfo.cs @@ -1,4 +1,5 @@ -using System; +using MediaBrowser.Model.Dto; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Runtime.Serialization; @@ -34,7 +35,7 @@ namespace MediaBrowser.Model.Entities /// </summary> /// <value>The type of the media.</value> public string MediaType { get; set; } - + /// <summary> /// Gets or sets the run time ticks. /// </summary> @@ -45,7 +46,7 @@ namespace MediaBrowser.Model.Entities /// Gets or sets the primary image tag. /// </summary> /// <value>The primary image tag.</value> - public Guid? PrimaryImageTag { get; set; } + public string PrimaryImageTag { get; set; } /// <summary> /// Gets or sets the primary image item identifier. @@ -57,19 +58,19 @@ namespace MediaBrowser.Model.Entities /// Gets or sets the logo image tag. /// </summary> /// <value>The logo image tag.</value> - public Guid? LogoImageTag { get; set; } + public string LogoImageTag { get; set; } /// <summary> /// Gets or sets the logo item identifier. /// </summary> /// <value>The logo item identifier.</value> public string LogoItemId { get; set; } - + /// <summary> /// Gets or sets the thumb image tag. /// </summary> /// <value>The thumb image tag.</value> - public Guid? ThumbImageTag { get; set; } + public string ThumbImageTag { get; set; } /// <summary> /// Gets or sets the thumb item identifier. @@ -81,7 +82,7 @@ namespace MediaBrowser.Model.Entities /// Gets or sets the thumb image tag. /// </summary> /// <value>The thumb image tag.</value> - public Guid? BackdropImageTag { get; set; } + public string BackdropImageTag { get; set; } /// <summary> /// Gets or sets the thumb item identifier. @@ -136,7 +137,25 @@ namespace MediaBrowser.Model.Entities /// </summary> /// <value>The artists.</value> public List<string> Artists { 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 chapter images item identifier. + /// </summary> + /// <value>The chapter images item identifier.</value> + public string ChapterImagesItemId { get; set; } + + /// <summary> + /// Gets or sets the chapters. + /// </summary> + /// <value>The chapters.</value> + public List<ChapterInfoDto> Chapters { get; set; } + /// <summary> /// Gets a value indicating whether this instance has primary image. /// </summary> @@ -144,12 +163,14 @@ namespace MediaBrowser.Model.Entities [IgnoreDataMember] public bool HasPrimaryImage { - get { return PrimaryImageTag.HasValue; } + get { return PrimaryImageTag != null; } } public BaseItemInfo() { Artists = new List<string>(); + MediaStreams = new List<MediaStream>(); + Chapters = new List<ChapterInfoDto>(); } } } diff --git a/MediaBrowser.Model/Entities/DisplayPreferences.cs b/MediaBrowser.Model/Entities/DisplayPreferences.cs index 829affd01..56a2c6194 100644 --- a/MediaBrowser.Model/Entities/DisplayPreferences.cs +++ b/MediaBrowser.Model/Entities/DisplayPreferences.cs @@ -36,7 +36,7 @@ namespace MediaBrowser.Model.Entities /// Gets or sets the user id. /// </summary> /// <value>The user id.</value> - public Guid Id { get; set; } + public string Id { get; set; } /// <summary> /// Gets or sets the type of the view. /// </summary> @@ -103,9 +103,9 @@ namespace MediaBrowser.Model.Entities /// </summary> public void IncreaseImageSize() { - var newWidth = PrimaryImageWidth / ImageScale; + double newWidth = PrimaryImageWidth / ImageScale; - var size = DrawingUtils.Resize(PrimaryImageWidth, PrimaryImageHeight, newWidth); + ImageSize size = DrawingUtils.Resize(PrimaryImageWidth, PrimaryImageHeight, newWidth, null, null, null); PrimaryImageWidth = Convert.ToInt32(size.Width); PrimaryImageHeight = Convert.ToInt32(size.Height); @@ -116,40 +116,10 @@ namespace MediaBrowser.Model.Entities /// </summary> public void DecreaseImageSize() { - var size = DrawingUtils.Scale(PrimaryImageWidth, PrimaryImageHeight, ImageScale); + ImageSize size = DrawingUtils.Scale(PrimaryImageWidth, PrimaryImageHeight, ImageScale); PrimaryImageWidth = Convert.ToInt32(size.Width); PrimaryImageHeight = Convert.ToInt32(size.Height); } } - - /// <summary> - /// Enum ScrollDirection - /// </summary> - public enum ScrollDirection - { - /// <summary> - /// The horizontal - /// </summary> - Horizontal, - /// <summary> - /// The vertical - /// </summary> - Vertical - } - - /// <summary> - /// Enum SortOrder - /// </summary> - public enum SortOrder - { - /// <summary> - /// The ascending - /// </summary> - Ascending, - /// <summary> - /// The descending - /// </summary> - Descending - } } diff --git a/MediaBrowser.Model/Entities/RequestResult.cs b/MediaBrowser.Model/Entities/EmptyRequestResult.cs index 5c9a725fd..5c9a725fd 100644 --- a/MediaBrowser.Model/Entities/RequestResult.cs +++ b/MediaBrowser.Model/Entities/EmptyRequestResult.cs diff --git a/MediaBrowser.Model/Entities/IHasProviderIds.cs b/MediaBrowser.Model/Entities/IHasProviderIds.cs index efb75412f..796850dbd 100644 --- a/MediaBrowser.Model/Entities/IHasProviderIds.cs +++ b/MediaBrowser.Model/Entities/IHasProviderIds.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace MediaBrowser.Model.Entities { @@ -14,102 +13,4 @@ namespace MediaBrowser.Model.Entities /// <value>The provider ids.</value> Dictionary<string, string> ProviderIds { get; set; } } - - /// <summary> - /// Class ProviderIdsExtensions - /// </summary> - public static class ProviderIdsExtensions - { - /// <summary> - /// Determines whether [has provider identifier] [the specified instance]. - /// </summary> - /// <param name="instance">The instance.</param> - /// <param name="provider">The provider.</param> - /// <returns><c>true</c> if [has provider identifier] [the specified instance]; otherwise, <c>false</c>.</returns> - public static bool HasProviderId(this IHasProviderIds instance, MetadataProviders provider) - { - return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString())); - } - - /// <summary> - /// Gets a provider id - /// </summary> - /// <param name="instance">The instance.</param> - /// <param name="provider">The provider.</param> - /// <returns>System.String.</returns> - public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider) - { - return instance.GetProviderId(provider.ToString()); - } - - /// <summary> - /// Gets a provider id - /// </summary> - /// <param name="instance">The instance.</param> - /// <param name="name">The name.</param> - /// <returns>System.String.</returns> - public static string GetProviderId(this IHasProviderIds instance, string name) - { - if (instance == null) - { - throw new ArgumentNullException("instance"); - } - - if (instance.ProviderIds == null) - { - return null; - } - - string id; - instance.ProviderIds.TryGetValue(name, out id); - return id; - } - - /// <summary> - /// Sets a provider id - /// </summary> - /// <param name="instance">The instance.</param> - /// <param name="name">The name.</param> - /// <param name="value">The value.</param> - public static void SetProviderId(this IHasProviderIds instance, string name, string value) - { - if (instance == null) - { - throw new ArgumentNullException("instance"); - } - - // If it's null remove the key from the dictionary - if (string.IsNullOrEmpty(value)) - { - if (instance.ProviderIds != null) - { - if (instance.ProviderIds.ContainsKey(name)) - { - instance.ProviderIds.Remove(name); - } - } - } - else - { - // Ensure it exists - if (instance.ProviderIds == null) - { - instance.ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); - } - - instance.ProviderIds[name] = value; - } - } - - /// <summary> - /// Sets a provider id - /// </summary> - /// <param name="instance">The instance.</param> - /// <param name="provider">The provider.</param> - /// <param name="value">The value.</param> - public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value) - { - instance.SetProviderId(provider.ToString(), value); - } - } } diff --git a/MediaBrowser.Model/Entities/IsoType.cs b/MediaBrowser.Model/Entities/IsoType.cs new file mode 100644 index 000000000..567b98ab9 --- /dev/null +++ b/MediaBrowser.Model/Entities/IsoType.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum IsoType + /// </summary> + public enum IsoType + { + /// <summary> + /// The DVD + /// </summary> + Dvd, + /// <summary> + /// The blu ray + /// </summary> + BluRay + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs index dca8cd584..4371ddae4 100644 --- a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs +++ b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs @@ -12,41 +12,41 @@ namespace MediaBrowser.Model.Entities /// Gets or sets the folders added to. /// </summary> /// <value>The folders added to.</value> - public List<Guid> FoldersAddedTo { get; set; } + public List<string> FoldersAddedTo { get; set; } /// <summary> /// Gets or sets the folders removed from. /// </summary> /// <value>The folders removed from.</value> - public List<Guid> FoldersRemovedFrom { get; set; } + public List<string> FoldersRemovedFrom { get; set; } /// <summary> /// Gets or sets the items added. /// </summary> /// <value>The items added.</value> - public List<Guid> ItemsAdded { get; set; } + public List<string> ItemsAdded { get; set; } /// <summary> /// Gets or sets the items removed. /// </summary> /// <value>The items removed.</value> - public List<Guid> ItemsRemoved { get; set; } + public List<string> ItemsRemoved { get; set; } /// <summary> /// Gets or sets the items updated. /// </summary> /// <value>The items updated.</value> - public List<Guid> ItemsUpdated { get; set; } + public List<string> ItemsUpdated { get; set; } /// <summary> /// Initializes a new instance of the <see cref="LibraryUpdateInfo"/> class. /// </summary> public LibraryUpdateInfo() { - FoldersAddedTo = new List<Guid>(); - FoldersRemovedFrom = new List<Guid>(); - ItemsAdded = new List<Guid>(); - ItemsRemoved = new List<Guid>(); - ItemsUpdated = new List<Guid>(); + FoldersAddedTo = new List<string>(); + FoldersRemovedFrom = new List<string>(); + ItemsAdded = new List<string>(); + ItemsRemoved = new List<string>(); + ItemsUpdated = new List<string>(); } } } diff --git a/MediaBrowser.Model/Entities/MediaInfo.cs b/MediaBrowser.Model/Entities/MediaInfo.cs new file mode 100644 index 000000000..ef26cfa14 --- /dev/null +++ b/MediaBrowser.Model/Entities/MediaInfo.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.Entities +{ + public class MediaInfo + { + /// <summary> + /// Gets or sets the media streams. + /// </summary> + /// <value>The media streams.</value> + public List<MediaStream> MediaStreams { get; set; } + + /// <summary> + /// Gets or sets the format. + /// </summary> + /// <value>The format.</value> + public string Format { get; set; } + + public int? TotalBitrate { get; set; } + + public MediaInfo() + { + MediaStreams = new List<MediaStream>(); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index d54e3c0ef..9f64b36e4 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -1,5 +1,6 @@ -using System.Collections.Generic; +using System; using System.Diagnostics; +using System.Runtime.Serialization; namespace MediaBrowser.Model.Entities { @@ -129,6 +130,20 @@ namespace MediaBrowser.Model.Entities /// <value><c>true</c> if this instance is external; otherwise, <c>false</c>.</value> public bool IsExternal { get; set; } + [IgnoreDataMember] + public bool IsGraphicalSubtitleStream + { + get + { + if (IsExternal) return false; + + var codec = Codec ?? string.Empty; + + return codec.IndexOf("pgs", StringComparison.OrdinalIgnoreCase) != -1 || + codec.IndexOf("dvd", StringComparison.OrdinalIgnoreCase) != -1; + } + } + /// <summary> /// Gets or sets the filename. /// </summary> @@ -147,49 +162,4 @@ namespace MediaBrowser.Model.Entities /// <value>The level.</value> public double? Level { get; set; } } - - /// <summary> - /// Enum MediaStreamType - /// </summary> - public enum MediaStreamType - { - /// <summary> - /// The audio - /// </summary> - Audio, - /// <summary> - /// The video - /// </summary> - Video, - /// <summary> - /// The subtitle - /// </summary> - Subtitle, - /// <summary> - /// The embedded image - /// </summary> - EmbeddedImage - } - - public class MediaInfo - { - /// <summary> - /// Gets or sets the media streams. - /// </summary> - /// <value>The media streams.</value> - public List<MediaStream> MediaStreams { get; set; } - - /// <summary> - /// Gets or sets the format. - /// </summary> - /// <value>The format.</value> - public string Format { get; set; } - - public int? TotalBitrate { get; set; } - - public MediaInfo() - { - MediaStreams = new List<MediaStream>(); - } - } } diff --git a/MediaBrowser.Model/Entities/MediaStreamType.cs b/MediaBrowser.Model/Entities/MediaStreamType.cs new file mode 100644 index 000000000..084a411f9 --- /dev/null +++ b/MediaBrowser.Model/Entities/MediaStreamType.cs @@ -0,0 +1,25 @@ +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum MediaStreamType + /// </summary> + public enum MediaStreamType + { + /// <summary> + /// The audio + /// </summary> + Audio, + /// <summary> + /// The video + /// </summary> + Video, + /// <summary> + /// The subtitle + /// </summary> + Subtitle, + /// <summary> + /// The embedded image + /// </summary> + EmbeddedImage + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/MediaUrl.cs b/MediaBrowser.Model/Entities/MediaUrl.cs index 857e91fec..9aa7207ed 100644 --- a/MediaBrowser.Model/Entities/MediaUrl.cs +++ b/MediaBrowser.Model/Entities/MediaUrl.cs @@ -8,10 +8,4 @@ namespace MediaBrowser.Model.Entities public VideoSize? VideoSize { get; set; } public bool IsDirectLink { get; set; } } - - public enum VideoSize - { - StandardDefinition, - HighDefinition - } } diff --git a/MediaBrowser.Model/Entities/PackageReviewInfo.cs b/MediaBrowser.Model/Entities/PackageReviewInfo.cs index c350935f4..52500a41e 100644 --- a/MediaBrowser.Model/Entities/PackageReviewInfo.cs +++ b/MediaBrowser.Model/Entities/PackageReviewInfo.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace MediaBrowser.Model.Entities { diff --git a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs new file mode 100644 index 000000000..e10232baa --- /dev/null +++ b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Class ProviderIdsExtensions + /// </summary> + public static class ProviderIdsExtensions + { + /// <summary> + /// Determines whether [has provider identifier] [the specified instance]. + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="provider">The provider.</param> + /// <returns><c>true</c> if [has provider identifier] [the specified instance]; otherwise, <c>false</c>.</returns> + public static bool HasProviderId(this IHasProviderIds instance, MetadataProviders provider) + { + return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString())); + } + + /// <summary> + /// Gets a provider id + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="provider">The provider.</param> + /// <returns>System.String.</returns> + public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider) + { + return instance.GetProviderId(provider.ToString()); + } + + /// <summary> + /// Gets a provider id + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="name">The name.</param> + /// <returns>System.String.</returns> + public static string GetProviderId(this IHasProviderIds instance, string name) + { + if (instance == null) + { + throw new ArgumentNullException("instance"); + } + + if (instance.ProviderIds == null) + { + return null; + } + + string id; + instance.ProviderIds.TryGetValue(name, out id); + return id; + } + + /// <summary> + /// Sets a provider id + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="name">The name.</param> + /// <param name="value">The value.</param> + public static void SetProviderId(this IHasProviderIds instance, string name, string value) + { + if (instance == null) + { + throw new ArgumentNullException("instance"); + } + + // If it's null remove the key from the dictionary + if (string.IsNullOrEmpty(value)) + { + if (instance.ProviderIds != null) + { + if (instance.ProviderIds.ContainsKey(name)) + { + instance.ProviderIds.Remove(name); + } + } + } + else + { + // Ensure it exists + if (instance.ProviderIds == null) + { + instance.ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + } + + instance.ProviderIds[name] = value; + } + } + + /// <summary> + /// Sets a provider id + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="provider">The provider.</param> + /// <param name="value">The value.</param> + public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value) + { + instance.SetProviderId(provider.ToString(), value); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/ScrollDirection.cs b/MediaBrowser.Model/Entities/ScrollDirection.cs new file mode 100644 index 000000000..ed2210300 --- /dev/null +++ b/MediaBrowser.Model/Entities/ScrollDirection.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum ScrollDirection + /// </summary> + public enum ScrollDirection + { + /// <summary> + /// The horizontal + /// </summary> + Horizontal, + /// <summary> + /// The vertical + /// </summary> + Vertical + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/SortOrder.cs b/MediaBrowser.Model/Entities/SortOrder.cs new file mode 100644 index 000000000..5130449ba --- /dev/null +++ b/MediaBrowser.Model/Entities/SortOrder.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum SortOrder + /// </summary> + public enum SortOrder + { + /// <summary> + /// The ascending + /// </summary> + Ascending, + /// <summary> + /// The descending + /// </summary> + Descending + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/VideoSize.cs b/MediaBrowser.Model/Entities/VideoSize.cs new file mode 100644 index 000000000..0100f3b90 --- /dev/null +++ b/MediaBrowser.Model/Entities/VideoSize.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Entities +{ + public enum VideoSize + { + StandardDefinition, + HighDefinition + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/VideoType.cs b/MediaBrowser.Model/Entities/VideoType.cs index b2742add1..aa9a3c55f 100644 --- a/MediaBrowser.Model/Entities/VideoType.cs +++ b/MediaBrowser.Model/Entities/VideoType.cs @@ -27,19 +27,4 @@ namespace MediaBrowser.Model.Entities /// </summary> HdDvd } - - /// <summary> - /// Enum IsoType - /// </summary> - public enum IsoType - { - /// <summary> - /// The DVD - /// </summary> - Dvd, - /// <summary> - /// The blu ray - /// </summary> - BluRay - } } diff --git a/MediaBrowser.Model/Events/GenericEventArgs.cs b/MediaBrowser.Model/Events/GenericEventArgs.cs new file mode 100644 index 000000000..5a83419e1 --- /dev/null +++ b/MediaBrowser.Model/Events/GenericEventArgs.cs @@ -0,0 +1,17 @@ +using System; + +namespace MediaBrowser.Model.Events +{ + /// <summary> + /// Provides a generic EventArgs subclass that can hold any kind of object + /// </summary> + /// <typeparam name="T"></typeparam> + public class GenericEventArgs<T> : EventArgs + { + /// <summary> + /// Gets or sets the argument. + /// </summary> + /// <value>The argument.</value> + public T Argument { get; set; } + } +} diff --git a/MediaBrowser.Model/FileOrganization/EpisodeFileOrganizationRequest.cs b/MediaBrowser.Model/FileOrganization/EpisodeFileOrganizationRequest.cs new file mode 100644 index 000000000..0b12ebc51 --- /dev/null +++ b/MediaBrowser.Model/FileOrganization/EpisodeFileOrganizationRequest.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.FileOrganization +{ + public class EpisodeFileOrganizationRequest + { + public string ResultId { get; set; } + + public string SeriesId { get; set; } + + public int SeasonNumber { get; set; } + + public int EpisodeNumber { get; set; } + + public int? EndingEpisodeNumber { get; set; } + + public bool RememberCorrection { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/FileOrganization/FileOrganizationResult.cs b/MediaBrowser.Model/FileOrganization/FileOrganizationResult.cs index 4a3235a42..ef9d0ca2a 100644 --- a/MediaBrowser.Model/FileOrganization/FileOrganizationResult.cs +++ b/MediaBrowser.Model/FileOrganization/FileOrganizationResult.cs @@ -100,18 +100,4 @@ namespace MediaBrowser.Model.FileOrganization DuplicatePaths = new List<string>(); } } - - public enum FileSortingStatus - { - Success, - Failure, - SkippedExisting - } - - public enum FileOrganizerType - { - Movie, - Episode, - Song - } } diff --git a/MediaBrowser.Model/FileOrganization/FileOrganizationQuery.cs b/MediaBrowser.Model/FileOrganization/FileOrganizationResultQuery.cs index ce5750757..18287534e 100644 --- a/MediaBrowser.Model/FileOrganization/FileOrganizationQuery.cs +++ b/MediaBrowser.Model/FileOrganization/FileOrganizationResultQuery.cs @@ -15,19 +15,4 @@ namespace MediaBrowser.Model.FileOrganization /// <value>The limit.</value> public int? Limit { get; set; } } - - public class EpisodeFileOrganizationRequest - { - public string ResultId { get; set; } - - public string SeriesId { get; set; } - - public int SeasonNumber { get; set; } - - public int EpisodeNumber { get; set; } - - public int? EndingEpisodeNumber { get; set; } - - public bool RememberCorrection { get; set; } - } } diff --git a/MediaBrowser.Model/FileOrganization/FileOrganizerType.cs b/MediaBrowser.Model/FileOrganization/FileOrganizerType.cs new file mode 100644 index 000000000..cbbeb9ce2 --- /dev/null +++ b/MediaBrowser.Model/FileOrganization/FileOrganizerType.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.FileOrganization +{ + public enum FileOrganizerType + { + Movie, + Episode, + Song + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/FileOrganization/FileSortingStatus.cs b/MediaBrowser.Model/FileOrganization/FileSortingStatus.cs new file mode 100644 index 000000000..8a467c05f --- /dev/null +++ b/MediaBrowser.Model/FileOrganization/FileSortingStatus.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.FileOrganization +{ + public enum FileSortingStatus + { + Success, + Failure, + SkippedExisting + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Globalization/CountryInfo.cs b/MediaBrowser.Model/Globalization/CountryInfo.cs index 9f5f00d80..16aea8436 100644 --- a/MediaBrowser.Model/Globalization/CountryInfo.cs +++ b/MediaBrowser.Model/Globalization/CountryInfo.cs @@ -30,10 +30,4 @@ namespace MediaBrowser.Model.Globalization /// <value>The name of the three letter ISO region.</value> public string ThreeLetterISORegionName { get; set; } } - - public class LocalizatonOption - { - public string Name { get; set; } - public string Value { get; set; } - } } diff --git a/MediaBrowser.Model/Globalization/LocalizatonOption.cs b/MediaBrowser.Model/Globalization/LocalizatonOption.cs new file mode 100644 index 000000000..61749cbc3 --- /dev/null +++ b/MediaBrowser.Model/Globalization/LocalizatonOption.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Globalization +{ + public class LocalizatonOption + { + public string Name { get; set; } + public string Value { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/IO/FileSystemEntryInfo.cs b/MediaBrowser.Model/IO/FileSystemEntryInfo.cs index dc4840456..f17e2e5c3 100644 --- a/MediaBrowser.Model/IO/FileSystemEntryInfo.cs +++ b/MediaBrowser.Model/IO/FileSystemEntryInfo.cs @@ -24,27 +24,4 @@ namespace MediaBrowser.Model.IO /// <value>The type.</value> public FileSystemEntryType Type { get; set; } } - - /// <summary> - /// Enum FileSystemEntryType - /// </summary> - public enum FileSystemEntryType - { - /// <summary> - /// The file - /// </summary> - File, - /// <summary> - /// The directory - /// </summary> - Directory, - /// <summary> - /// The network computer - /// </summary> - NetworkComputer, - /// <summary> - /// The network share - /// </summary> - NetworkShare - } } diff --git a/MediaBrowser.Model/IO/FileSystemEntryType.cs b/MediaBrowser.Model/IO/FileSystemEntryType.cs new file mode 100644 index 000000000..e7c67c606 --- /dev/null +++ b/MediaBrowser.Model/IO/FileSystemEntryType.cs @@ -0,0 +1,25 @@ +namespace MediaBrowser.Model.IO +{ + /// <summary> + /// Enum FileSystemEntryType + /// </summary> + public enum FileSystemEntryType + { + /// <summary> + /// The file + /// </summary> + File, + /// <summary> + /// The directory + /// </summary> + Directory, + /// <summary> + /// The network computer + /// </summary> + NetworkComputer, + /// <summary> + /// The network share + /// </summary> + NetworkShare + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs new file mode 100644 index 000000000..2d88215bb --- /dev/null +++ b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs @@ -0,0 +1,108 @@ +using System; +using System.ComponentModel; + +namespace MediaBrowser.Model.LiveTv +{ + public class BaseTimerInfoDto : INotifyPropertyChanged + { + /// <summary> + /// Occurs when a property value changes. + /// </summary> + public event PropertyChangedEventHandler PropertyChanged; + + /// <summary> + /// Id of the recording. + /// </summary> + public string Id { get; set; } + + /// <summary> + /// Gets or sets the external identifier. + /// </summary> + /// <value>The external identifier.</value> + public string ExternalId { get; set; } + + /// <summary> + /// ChannelId of the recording. + /// </summary> + public string ChannelId { get; set; } + + /// <summary> + /// Gets or sets the external channel identifier. + /// </summary> + /// <value>The external channel identifier.</value> + public string ExternalChannelId { get; set; } + + /// <summary> + /// ChannelName of the recording. + /// </summary> + public string ChannelName { get; set; } + + /// <summary> + /// Gets or sets the program identifier. + /// </summary> + /// <value>The program identifier.</value> + public string ProgramId { get; set; } + + /// <summary> + /// Gets or sets the external program identifier. + /// </summary> + /// <value>The external program identifier.</value> + public string ExternalProgramId { get; set; } + + /// <summary> + /// Name of the recording. + /// </summary> + public string Name { get; set; } + + /// <summary> + /// Description 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 name of the service. + /// </summary> + /// <value>The name of the service.</value> + public string ServiceName { get; set; } + + /// <summary> + /// Gets or sets the priority. + /// </summary> + /// <value>The priority.</value> + public int Priority { get; set; } + + /// <summary> + /// Gets or sets the pre padding seconds. + /// </summary> + /// <value>The pre padding seconds.</value> + public int PrePaddingSeconds { get; set; } + + /// <summary> + /// Gets or sets the post padding seconds. + /// </summary> + /// <value>The post padding seconds.</value> + public int PostPaddingSeconds { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is pre padding required. + /// </summary> + /// <value><c>true</c> if this instance is pre padding required; otherwise, <c>false</c>.</value> + public bool IsPrePaddingRequired { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is post padding required. + /// </summary> + /// <value><c>true</c> if this instance is post padding required; otherwise, <c>false</c>.</value> + public bool IsPostPaddingRequired { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs index fe6faf363..3fec0ee56 100644 --- a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs @@ -39,7 +39,7 @@ namespace MediaBrowser.Model.LiveTv /// Gets or sets the image tags. /// </summary> /// <value>The image tags.</value> - public Dictionary<ImageType, Guid> ImageTags { get; set; } + public Dictionary<ImageType, string> ImageTags { get; set; } /// <summary> /// Gets or sets the number. @@ -113,7 +113,7 @@ namespace MediaBrowser.Model.LiveTv public ChannelInfoDto() { - ImageTags = new Dictionary<ImageType, Guid>(); + ImageTags = new Dictionary<ImageType, string>(); MediaSources = new List<MediaSourceInfo>(); } diff --git a/MediaBrowser.Model/LiveTv/DayPattern.cs b/MediaBrowser.Model/LiveTv/DayPattern.cs new file mode 100644 index 000000000..8251795dc --- /dev/null +++ b/MediaBrowser.Model/LiveTv/DayPattern.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.LiveTv +{ + public enum DayPattern + { + Daily, + Weekdays, + Weekends + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/GuideInfo.cs b/MediaBrowser.Model/LiveTv/GuideInfo.cs new file mode 100644 index 000000000..c21f6d871 --- /dev/null +++ b/MediaBrowser.Model/LiveTv/GuideInfo.cs @@ -0,0 +1,19 @@ +using System; + +namespace MediaBrowser.Model.LiveTv +{ + public class GuideInfo + { + /// <summary> + /// Gets or sets the start date. + /// </summary> + /// <value>The start date.</value> + public DateTime StartDate { get; set; } + + /// <summary> + /// Gets or sets the end date. + /// </summary> + /// <value>The end date.</value> + public DateTime EndDate { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/LiveTvInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvInfo.cs new file mode 100644 index 000000000..dd31c5a6b --- /dev/null +++ b/MediaBrowser.Model/LiveTv/LiveTvInfo.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.LiveTv +{ + public class LiveTvInfo + { + /// <summary> + /// Gets or sets the services. + /// </summary> + /// <value>The services.</value> + public List<LiveTvServiceInfo> Services { get; set; } + + /// <summary> + /// Gets or sets the name of the active service. + /// </summary> + /// <value>The name of the active service.</value> + public string ActiveServiceName { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is enabled. + /// </summary> + /// <value><c>true</c> if this instance is enabled; otherwise, <c>false</c>.</value> + public bool IsEnabled { get; set; } + + /// <summary> + /// Gets or sets the enabled users. + /// </summary> + /// <value>The enabled users.</value> + public List<string> EnabledUsers { get; set; } + + /// <summary> + /// Gets or sets the status. + /// </summary> + /// <value>The status.</value> + public LiveTvServiceStatus Status { get; set; } + + /// <summary> + /// Gets or sets the status message. + /// </summary> + /// <value>The status message.</value> + public string StatusMessage { get; set; } + + public LiveTvInfo() + { + Services = new List<LiveTvServiceInfo>(); + EnabledUsers = new List<string>(); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs index 85f58be3b..264870ffb 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace MediaBrowser.Model.LiveTv { @@ -51,140 +50,4 @@ namespace MediaBrowser.Model.LiveTv Tuners = new List<LiveTvTunerInfoDto>(); } } - - public class GuideInfo - { - /// <summary> - /// Gets or sets the start date. - /// </summary> - /// <value>The start date.</value> - public DateTime StartDate { get; set; } - - /// <summary> - /// Gets or sets the end date. - /// </summary> - /// <value>The end date.</value> - public DateTime EndDate { get; set; } - } - - public class LiveTvInfo - { - /// <summary> - /// Gets or sets the services. - /// </summary> - /// <value>The services.</value> - public List<LiveTvServiceInfo> Services { get; set; } - - /// <summary> - /// Gets or sets the name of the active service. - /// </summary> - /// <value>The name of the active service.</value> - public string ActiveServiceName { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance is enabled. - /// </summary> - /// <value><c>true</c> if this instance is enabled; otherwise, <c>false</c>.</value> - public bool IsEnabled { get; set; } - - /// <summary> - /// Gets or sets the enabled users. - /// </summary> - /// <value>The enabled users.</value> - public List<string> EnabledUsers { get; set; } - - /// <summary> - /// Gets or sets the status. - /// </summary> - /// <value>The status.</value> - public LiveTvServiceStatus Status { get; set; } - - /// <summary> - /// Gets or sets the status message. - /// </summary> - /// <value>The status message.</value> - public string StatusMessage { get; set; } - - public LiveTvInfo() - { - Services = new List<LiveTvServiceInfo>(); - EnabledUsers = new List<string>(); - } - } - - public class LiveTvTunerInfoDto - { - /// <summary> - /// Gets or sets the type of the source. - /// </summary> - /// <value>The type of the source.</value> - public string SourceType { 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 status. - /// </summary> - /// <value>The status.</value> - public LiveTvTunerStatus Status { 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 name of the channel. - /// </summary> - /// <value>The name of the channel.</value> - public string ChannelName { get; set; } - - /// <summary> - /// Gets or sets the recording identifier. - /// </summary> - /// <value>The recording identifier.</value> - public string RecordingId { get; set; } - - /// <summary> - /// Gets or sets the name of the program. - /// </summary> - /// <value>The name of the program.</value> - public string ProgramName { get; set; } - - /// <summary> - /// Gets or sets the clients. - /// </summary> - /// <value>The clients.</value> - public List<string> Clients { get; set; } - - public LiveTvTunerInfoDto() - { - Clients = new List<string>(); - } - } - - public enum LiveTvServiceStatus - { - Ok = 0, - Unavailable = 1 - } - - public enum LiveTvTunerStatus - { - Available = 0, - Disabled = 1, - RecordingTv = 2, - LiveTv = 3 - } } diff --git a/MediaBrowser.Model/LiveTv/LiveTvServiceStatus.cs b/MediaBrowser.Model/LiveTv/LiveTvServiceStatus.cs new file mode 100644 index 000000000..20fe84500 --- /dev/null +++ b/MediaBrowser.Model/LiveTv/LiveTvServiceStatus.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.LiveTv +{ + public enum LiveTvServiceStatus + { + Ok = 0, + Unavailable = 1 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/LiveTvTunerInfoDto.cs b/MediaBrowser.Model/LiveTv/LiveTvTunerInfoDto.cs new file mode 100644 index 000000000..28e8c158a --- /dev/null +++ b/MediaBrowser.Model/LiveTv/LiveTvTunerInfoDto.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.LiveTv +{ + public class LiveTvTunerInfoDto + { + /// <summary> + /// Gets or sets the type of the source. + /// </summary> + /// <value>The type of the source.</value> + public string SourceType { 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 status. + /// </summary> + /// <value>The status.</value> + public LiveTvTunerStatus Status { 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 name of the channel. + /// </summary> + /// <value>The name of the channel.</value> + public string ChannelName { get; set; } + + /// <summary> + /// Gets or sets the recording identifier. + /// </summary> + /// <value>The recording identifier.</value> + public string RecordingId { get; set; } + + /// <summary> + /// Gets or sets the name of the program. + /// </summary> + /// <value>The name of the program.</value> + public string ProgramName { get; set; } + + /// <summary> + /// Gets or sets the clients. + /// </summary> + /// <value>The clients.</value> + public List<string> Clients { get; set; } + + public LiveTvTunerInfoDto() + { + Clients = new List<string>(); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/LiveTvTunerStatus.cs b/MediaBrowser.Model/LiveTv/LiveTvTunerStatus.cs new file mode 100644 index 000000000..055199fca --- /dev/null +++ b/MediaBrowser.Model/LiveTv/LiveTvTunerStatus.cs @@ -0,0 +1,10 @@ +namespace MediaBrowser.Model.LiveTv +{ + public enum LiveTvTunerStatus + { + Available = 0, + Disabled = 1, + RecordingTv = 2, + LiveTv = 3 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/ProgramAudio.cs b/MediaBrowser.Model/LiveTv/ProgramAudio.cs new file mode 100644 index 000000000..902079b9a --- /dev/null +++ b/MediaBrowser.Model/LiveTv/ProgramAudio.cs @@ -0,0 +1,11 @@ +namespace MediaBrowser.Model.LiveTv +{ + public enum ProgramAudio + { + Mono, + Stereo, + Dolby, + DolbyDigital, + Thx + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs b/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs index f6b343bdb..fb931820e 100644 --- a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs @@ -45,7 +45,7 @@ namespace MediaBrowser.Model.LiveTv /// Gets or sets the channel primary image tag. /// </summary> /// <value>The channel primary image tag.</value> - public Guid? ChannelPrimaryImageTag { get; set; } + public string ChannelPrimaryImageTag { get; set; } /// <summary> /// Gets or sets the play access. @@ -136,7 +136,7 @@ namespace MediaBrowser.Model.LiveTv /// Gets or sets the image tags. /// </summary> /// <value>The image tags.</value> - public Dictionary<ImageType, Guid> ImageTags { get; set; } + public Dictionary<ImageType, string> ImageTags { get; set; } /// <summary> /// Gets or sets the user data. @@ -211,18 +211,9 @@ namespace MediaBrowser.Model.LiveTv public ProgramInfoDto() { Genres = new List<string>(); - ImageTags = new Dictionary<ImageType, Guid>(); + ImageTags = new Dictionary<ImageType, string>(); } public event PropertyChangedEventHandler PropertyChanged; } - - public enum ProgramAudio - { - Mono, - Stereo, - Dolby, - DolbyDigital, - Thx - } }
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/ProgramQuery.cs b/MediaBrowser.Model/LiveTv/ProgramQuery.cs index a2a824994..36c06d4c0 100644 --- a/MediaBrowser.Model/LiveTv/ProgramQuery.cs +++ b/MediaBrowser.Model/LiveTv/ProgramQuery.cs @@ -32,31 +32,4 @@ namespace MediaBrowser.Model.LiveTv ChannelIdList = new string[] { }; } } - - public class RecommendedProgramQuery - { - /// <summary> - /// Gets or sets the user identifier. - /// </summary> - /// <value>The user identifier.</value> - public string UserId { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance is airing. - /// </summary> - /// <value><c>true</c> if this instance is airing; otherwise, <c>false</c>.</value> - public bool? IsAiring { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance has aired. - /// </summary> - /// <value><c>null</c> if [has aired] contains no value, <c>true</c> if [has aired]; otherwise, <c>false</c>.</value> - public bool? HasAired { get; set; } - - /// <summary> - /// The maximum number of items to return - /// </summary> - /// <value>The limit.</value> - public int? Limit { get; set; } - } } diff --git a/MediaBrowser.Model/LiveTv/RecommendedProgramQuery.cs b/MediaBrowser.Model/LiveTv/RecommendedProgramQuery.cs new file mode 100644 index 000000000..907902123 --- /dev/null +++ b/MediaBrowser.Model/LiveTv/RecommendedProgramQuery.cs @@ -0,0 +1,29 @@ +namespace MediaBrowser.Model.LiveTv +{ + public class RecommendedProgramQuery + { + /// <summary> + /// Gets or sets the user identifier. + /// </summary> + /// <value>The user identifier.</value> + public string UserId { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is airing. + /// </summary> + /// <value><c>true</c> if this instance is airing; otherwise, <c>false</c>.</value> + public bool? IsAiring { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance has aired. + /// </summary> + /// <value><c>null</c> if [has aired] contains no value, <c>true</c> if [has aired]; otherwise, <c>false</c>.</value> + public bool? HasAired { get; set; } + + /// <summary> + /// The maximum number of items to return + /// </summary> + /// <value>The limit.</value> + public int? Limit { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/RecordingGroupQuery.cs b/MediaBrowser.Model/LiveTv/RecordingGroupQuery.cs new file mode 100644 index 000000000..8c20e7f3f --- /dev/null +++ b/MediaBrowser.Model/LiveTv/RecordingGroupQuery.cs @@ -0,0 +1,11 @@ +namespace MediaBrowser.Model.LiveTv +{ + public class RecordingGroupQuery + { + /// <summary> + /// Gets or sets the user identifier. + /// </summary> + /// <value>The user identifier.</value> + public string UserId { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs index de07382c0..3705b7a29 100644 --- a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs @@ -50,7 +50,7 @@ namespace MediaBrowser.Model.LiveTv /// Gets or sets the channel primary image tag. /// </summary> /// <value>The channel primary image tag.</value> - public Guid? ChannelPrimaryImageTag { get; set; } + public string ChannelPrimaryImageTag { get; set; } /// <summary> /// ChannelName of the recording. @@ -224,7 +224,7 @@ namespace MediaBrowser.Model.LiveTv /// Gets or sets the image tags. /// </summary> /// <value>The image tags.</value> - public Dictionary<ImageType, Guid> ImageTags { get; set; } + public Dictionary<ImageType, string> ImageTags { get; set; } /// <summary> /// Gets or sets the user data. @@ -253,7 +253,7 @@ namespace MediaBrowser.Model.LiveTv public RecordingInfoDto() { Genres = new List<string>(); - ImageTags = new Dictionary<ImageType, Guid>(); + ImageTags = new Dictionary<ImageType, string>(); MediaSources = new List<MediaSourceInfo>(); } diff --git a/MediaBrowser.Model/LiveTv/RecordingQuery.cs b/MediaBrowser.Model/LiveTv/RecordingQuery.cs index 1fa9af49b..daa137db6 100644 --- a/MediaBrowser.Model/LiveTv/RecordingQuery.cs +++ b/MediaBrowser.Model/LiveTv/RecordingQuery.cs @@ -1,6 +1,4 @@ -using MediaBrowser.Model.Entities; - -namespace MediaBrowser.Model.LiveTv +namespace MediaBrowser.Model.LiveTv { /// <summary> /// Class RecordingQuery. @@ -61,43 +59,4 @@ namespace MediaBrowser.Model.LiveTv /// <value>The series timer identifier.</value> public string SeriesTimerId { get; set; } } - - public class RecordingGroupQuery - { - /// <summary> - /// Gets or sets the user identifier. - /// </summary> - /// <value>The user identifier.</value> - public string UserId { get; set; } - } - - public class TimerQuery - { - /// <summary> - /// Gets or sets the channel identifier. - /// </summary> - /// <value>The channel identifier.</value> - public string ChannelId { get; set; } - - /// <summary> - /// Gets or sets the series timer identifier. - /// </summary> - /// <value>The series timer identifier.</value> - public string SeriesTimerId { get; set; } - } - - public class SeriesTimerQuery - { - /// <summary> - /// Gets or sets the sort by - SortName, Priority - /// </summary> - /// <value>The sort by.</value> - public string SortBy { get; set; } - - /// <summary> - /// Gets or sets the sort order. - /// </summary> - /// <value>The sort order.</value> - public SortOrder SortOrder { get; set; } - } } diff --git a/MediaBrowser.Model/LiveTv/RecordingStatus.cs b/MediaBrowser.Model/LiveTv/RecordingStatus.cs index 95e9dcb01..7ab716c4d 100644 --- a/MediaBrowser.Model/LiveTv/RecordingStatus.cs +++ b/MediaBrowser.Model/LiveTv/RecordingStatus.cs @@ -13,11 +13,4 @@ namespace MediaBrowser.Model.LiveTv ConflictedNotOk, Error } - - public enum DayPattern - { - Daily, - Weekdays, - Weekends - } } diff --git a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs index 393233c1b..7c590307f 100644 --- a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs @@ -43,7 +43,7 @@ namespace MediaBrowser.Model.LiveTv /// Gets or sets the image tags. /// </summary> /// <value>The image tags.</value> - public Dictionary<ImageType, Guid> ImageTags { get; set; } + public Dictionary<ImageType, string> ImageTags { get; set; } /// <summary> /// Gets a value indicating whether this instance has primary image. @@ -57,7 +57,7 @@ namespace MediaBrowser.Model.LiveTv public SeriesTimerInfoDto() { - ImageTags = new Dictionary<ImageType, Guid>(); + ImageTags = new Dictionary<ImageType, string>(); Days = new List<DayOfWeek>(); } } diff --git a/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs b/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs new file mode 100644 index 000000000..95260cc0e --- /dev/null +++ b/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs @@ -0,0 +1,19 @@ +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Model.LiveTv +{ + public class SeriesTimerQuery + { + /// <summary> + /// Gets or sets the sort by - SortName, Priority + /// </summary> + /// <value>The sort by.</value> + public string SortBy { get; set; } + + /// <summary> + /// Gets or sets the sort order. + /// </summary> + /// <value>The sort order.</value> + public SortOrder SortOrder { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/TimerInfoDto.cs b/MediaBrowser.Model/LiveTv/TimerInfoDto.cs index 137c95719..16cac945f 100644 --- a/MediaBrowser.Model/LiveTv/TimerInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/TimerInfoDto.cs @@ -1,7 +1,4 @@ -using System; -using System.ComponentModel; - -namespace MediaBrowser.Model.LiveTv +namespace MediaBrowser.Model.LiveTv { public class TimerInfoDto : BaseTimerInfoDto { @@ -36,107 +33,4 @@ namespace MediaBrowser.Model.LiveTv public ProgramInfoDto ProgramInfo { get; set; } } - - public class BaseTimerInfoDto : INotifyPropertyChanged - { - /// <summary> - /// Occurs when a property value changes. - /// </summary> - public event PropertyChangedEventHandler PropertyChanged; - - /// <summary> - /// Id of the recording. - /// </summary> - public string Id { get; set; } - - /// <summary> - /// Gets or sets the external identifier. - /// </summary> - /// <value>The external identifier.</value> - public string ExternalId { get; set; } - - /// <summary> - /// ChannelId of the recording. - /// </summary> - public string ChannelId { get; set; } - - /// <summary> - /// Gets or sets the external channel identifier. - /// </summary> - /// <value>The external channel identifier.</value> - public string ExternalChannelId { get; set; } - - /// <summary> - /// ChannelName of the recording. - /// </summary> - public string ChannelName { get; set; } - - /// <summary> - /// Gets or sets the program identifier. - /// </summary> - /// <value>The program identifier.</value> - public string ProgramId { get; set; } - - /// <summary> - /// Gets or sets the external program identifier. - /// </summary> - /// <value>The external program identifier.</value> - public string ExternalProgramId { get; set; } - - /// <summary> - /// Name of the recording. - /// </summary> - public string Name { get; set; } - - /// <summary> - /// Description 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 name of the service. - /// </summary> - /// <value>The name of the service.</value> - public string ServiceName { get; set; } - - /// <summary> - /// Gets or sets the priority. - /// </summary> - /// <value>The priority.</value> - public int Priority { get; set; } - - /// <summary> - /// Gets or sets the pre padding seconds. - /// </summary> - /// <value>The pre padding seconds.</value> - public int PrePaddingSeconds { get; set; } - - /// <summary> - /// Gets or sets the post padding seconds. - /// </summary> - /// <value>The post padding seconds.</value> - public int PostPaddingSeconds { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance is pre padding required. - /// </summary> - /// <value><c>true</c> if this instance is pre padding required; otherwise, <c>false</c>.</value> - public bool IsPrePaddingRequired { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance is post padding required. - /// </summary> - /// <value><c>true</c> if this instance is post padding required; otherwise, <c>false</c>.</value> - public bool IsPostPaddingRequired { get; set; } - } } diff --git a/MediaBrowser.Model/LiveTv/TimerQuery.cs b/MediaBrowser.Model/LiveTv/TimerQuery.cs new file mode 100644 index 000000000..e6ceff530 --- /dev/null +++ b/MediaBrowser.Model/LiveTv/TimerQuery.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.LiveTv +{ + public class TimerQuery + { + /// <summary> + /// Gets or sets the channel identifier. + /// </summary> + /// <value>The channel identifier.</value> + public string ChannelId { get; set; } + + /// <summary> + /// Gets or sets the series timer identifier. + /// </summary> + /// <value>The series timer identifier.</value> + public string SeriesTimerId { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 710e5f6b4..2c714f831 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -57,35 +57,66 @@ <Compile Include="ApiClient\IApiClient.cs" /> <Compile Include="ApiClient\ApiClientExtensions.cs" /> <Compile Include="ApiClient\IServerEvents.cs" /> - <Compile Include="ApiClient\ServerEventArgs.cs" /> + <Compile Include="ApiClient\GeneralCommandEventArgs.cs" /> + <Compile Include="ApiClient\SessionUpdatesEventArgs.cs" /> + <Compile Include="Channels\ChannelItemQuery.cs" /> <Compile Include="Channels\ChannelQuery.cs" /> - <Compile Include="Configuration\AutoOrganize.cs" /> + <Compile Include="Chapters\RemoteChapterInfo.cs" /> + <Compile Include="Chapters\RemoteChapterResult.cs" /> + <Compile Include="Configuration\TvFileOrganizationOptions.cs" /> <Compile Include="Configuration\BaseApplicationConfiguration.cs" /> <Compile Include="Configuration\DlnaOptions.cs" /> + <Compile Include="Configuration\EncodingQuality.cs" /> + <Compile Include="Configuration\ImageOption.cs" /> + <Compile Include="Configuration\ImageSavingConvention.cs" /> + <Compile Include="Configuration\LiveTvOptions.cs" /> <Compile Include="Configuration\MetadataPlugin.cs" /> <Compile Include="Configuration\MetadataOptions.cs" /> + <Compile Include="Configuration\MetadataPluginSummary.cs" /> + <Compile Include="Configuration\MetadataPluginType.cs" /> + <Compile Include="Configuration\NotificationOption.cs" /> <Compile Include="Configuration\NotificationOptions.cs" /> + <Compile Include="Configuration\NotificationType.cs" /> + <Compile Include="Configuration\PathSubstitution.cs" /> + <Compile Include="Configuration\SendToUserType.cs" /> <Compile Include="Configuration\ServerConfiguration.cs" /> + <Compile Include="Configuration\SubtitleOptions.cs" /> + <Compile Include="Configuration\UnratedItem.cs" /> + <Compile Include="Dlna\AudioOptions.cs" /> <Compile Include="Dlna\CodecProfile.cs" /> + <Compile Include="Dlna\CodecType.cs" /> <Compile Include="Dlna\ConditionProcessor.cs" /> <Compile Include="Dlna\ContainerProfile.cs" /> <Compile Include="Dlna\ContentFeatureBuilder.cs" /> <Compile Include="Dlna\DeviceIdentification.cs" /> <Compile Include="Dlna\DeviceProfile.cs" /> <Compile Include="Dlna\DeviceProfileInfo.cs" /> + <Compile Include="Dlna\DeviceProfileType.cs" /> <Compile Include="Dlna\DirectPlayProfile.cs" /> + <Compile Include="Dlna\DlnaFlags.cs" /> <Compile Include="Dlna\DlnaMaps.cs" /> + <Compile Include="Dlna\DlnaProfileType.cs" /> <Compile Include="Dlna\EventSubscription.cs" /> <Compile Include="Dlna\Filter.cs" /> + <Compile Include="Dlna\HeaderMatchType.cs" /> + <Compile Include="Dlna\HttpHeaderInfo.cs" /> <Compile Include="Dlna\MediaFormatProfile.cs" /> <Compile Include="Dlna\MediaFormatProfileResolver.cs" /> + <Compile Include="Dlna\ProfileCondition.cs" /> + <Compile Include="Dlna\ProfileConditionType.cs" /> + <Compile Include="Dlna\ProfileConditionValue.cs" /> <Compile Include="Dlna\ResponseProfile.cs" /> <Compile Include="Dlna\SearchCriteria.cs" /> + <Compile Include="Dlna\SearchType.cs" /> <Compile Include="Dlna\SortCriteria.cs" /> <Compile Include="Dlna\StreamBuilder.cs" /> <Compile Include="Dlna\StreamInfo.cs" /> + <Compile Include="Dlna\TranscodeSeekInfo.cs" /> <Compile Include="Dlna\TranscodingProfile.cs" /> + <Compile Include="Dlna\VideoOptions.cs" /> + <Compile Include="Dlna\XmlAttribute.cs" /> <Compile Include="Drawing\ImageOutputFormat.cs" /> + <Compile Include="Drawing\ImageSize.cs" /> <Compile Include="Dto\BaseItemPerson.cs" /> <Compile Include="Dto\ChapterInfoDto.cs" /> <Compile Include="Dto\GameSystemSummary.cs" /> @@ -94,24 +125,64 @@ <Compile Include="Dto\ItemByNameCounts.cs" /> <Compile Include="Dto\ItemCounts.cs" /> <Compile Include="Dto\ItemIndex.cs" /> + <Compile Include="Dto\RatingType.cs" /> <Compile Include="Dto\RecommendationDto.cs" /> - <Compile Include="Dto\MediaVersionInfo.cs" /> + <Compile Include="Dto\MediaSourceInfo.cs" /> + <Compile Include="Dto\RecommendationType.cs" /> + <Compile Include="Dto\SubtitleDownloadOptions.cs" /> + <Compile Include="Dto\VideoStreamOptions.cs" /> + <Compile Include="Entities\IsoType.cs" /> + <Compile Include="Entities\MediaInfo.cs" /> + <Compile Include="Entities\MediaStreamType.cs" /> <Compile Include="Entities\PackageReviewInfo.cs" /> + <Compile Include="Entities\ProviderIdsExtensions.cs" /> + <Compile Include="Entities\ScrollDirection.cs" /> + <Compile Include="Entities\SortOrder.cs" /> + <Compile Include="Entities\VideoSize.cs" /> + <Compile Include="Events\GenericEventArgs.cs" /> + <Compile Include="FileOrganization\EpisodeFileOrganizationRequest.cs" /> <Compile Include="FileOrganization\FileOrganizationResult.cs" /> - <Compile Include="FileOrganization\FileOrganizationQuery.cs" /> + <Compile Include="FileOrganization\FileOrganizationResultQuery.cs" /> + <Compile Include="FileOrganization\FileOrganizerType.cs" /> + <Compile Include="FileOrganization\FileSortingStatus.cs" /> + <Compile Include="Globalization\LocalizatonOption.cs" /> + <Compile Include="IO\FileSystemEntryType.cs" /> <Compile Include="Library\PlayAccess.cs" /> + <Compile Include="LiveTv\BaseTimerInfoDto.cs" /> <Compile Include="LiveTv\ChannelInfoDto.cs" /> <Compile Include="LiveTv\ChannelQuery.cs" /> + <Compile Include="LiveTv\DayPattern.cs" /> + <Compile Include="LiveTv\GuideInfo.cs" /> + <Compile Include="LiveTv\LiveTvInfo.cs" /> + <Compile Include="LiveTv\LiveTvServiceStatus.cs" /> + <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" /> <Compile Include="LiveTv\SeriesTimerInfoDto.cs" /> + <Compile Include="LiveTv\SeriesTimerQuery.cs" /> <Compile Include="LiveTv\TimerInfoDto.cs" /> + <Compile Include="LiveTv\TimerQuery.cs" /> <Compile Include="Logging\NullLogger.cs" /> + <Compile Include="MediaInfo\AudioCodec.cs" /> + <Compile Include="MediaInfo\Container.cs" /> + <Compile Include="MediaInfo\SubtitleFormat.cs" /> + <Compile Include="MediaInfo\TransportStreamTimestamp.cs" /> + <Compile Include="MediaInfo\VideoCodec.cs" /> + <Compile Include="News\NewsChannel.cs" /> <Compile Include="News\NewsItem.cs" /> + <Compile Include="News\NewsQuery.cs" /> + <Compile Include="Notifications\NotificationRequest.cs" /> + <Compile Include="Notifications\NotificationServiceInfo.cs" /> + <Compile Include="Notifications\NotificationTypeInfo.cs" /> <Compile Include="Providers\ExternalIdInfo.cs" /> + <Compile Include="Providers\ExternalUrl.cs" /> <Compile Include="Providers\ImageProviderInfo.cs" /> <Compile Include="Providers\RemoteImageInfo.cs" /> <Compile Include="Dto\StudioDto.cs" /> @@ -136,8 +207,11 @@ <Compile Include="Notifications\NotificationQuery.cs" /> <Compile Include="Notifications\NotificationResult.cs" /> <Compile Include="Notifications\NotificationsSummary.cs" /> + <Compile Include="Providers\RemoteImageQuery.cs" /> <Compile Include="Providers\RemoteImageResult.cs" /> <Compile Include="Providers\RemoteSearchResult.cs" /> + <Compile Include="Providers\RemoteSubtitleInfo.cs" /> + <Compile Include="Querying\AllThemeMediaResult.cs" /> <Compile Include="Querying\ArtistsQuery.cs" /> <Compile Include="Querying\EpisodeQuery.cs" /> <Compile Include="Querying\ItemCountsQuery.cs" /> @@ -145,14 +219,24 @@ <Compile Include="Entities\BaseItemInfo.cs" /> <Compile Include="Querying\NextUpQuery.cs" /> <Compile Include="Querying\QueryResult.cs" /> + <Compile Include="Querying\SeasonQuery.cs" /> <Compile Include="Querying\SessionQuery.cs" /> + <Compile Include="Querying\SimilarItemsByNameQuery.cs" /> <Compile Include="Querying\SimilarItemsQuery.cs" /> + <Compile Include="Querying\UpcomingEpisodesQuery.cs" /> <Compile Include="Querying\UserQuery.cs" /> <Compile Include="Search\SearchQuery.cs" /> <Compile Include="Session\BrowseRequest.cs" /> + <Compile Include="Session\ClientCapabilities.cs" /> <Compile Include="Session\GeneralCommand.cs" /> + <Compile Include="Session\GeneralCommandType.cs" /> <Compile Include="Session\MessageCommand.cs" /> - <Compile Include="Session\PlaybackReports.cs" /> + <Compile Include="Session\PlaybackProgressInfo.cs" /> + <Compile Include="Session\PlaybackStartInfo.cs" /> + <Compile Include="Session\PlaybackStopInfo.cs" /> + <Compile Include="Session\PlayCommand.cs" /> + <Compile Include="Session\PlayerStateInfo.cs" /> + <Compile Include="Session\PlayMethod.cs" /> <Compile Include="Session\PlayRequest.cs" /> <Compile Include="Session\PlaystateCommand.cs" /> <Compile Include="Logging\ILogManager.cs" /> @@ -181,22 +265,25 @@ <Compile Include="Net\NetworkShare.cs" /> <Compile Include="Net\NetworkShareType.cs" /> <Compile Include="Querying\PersonsQuery.cs" /> - <Compile Include="Querying\ThemeSongsResult.cs" /> + <Compile Include="Querying\ThemeMediaResult.cs" /> <Compile Include="Search\SearchHint.cs" /> <Compile Include="Search\SearchHintResult.cs" /> <Compile Include="Serialization\IJsonSerializer.cs" /> <Compile Include="Serialization\IXmlSerializer.cs" /> + <Compile Include="Session\PlaystateRequest.cs" /> <Compile Include="Session\SessionCapabilities.cs" /> <Compile Include="Session\SessionInfoDto.cs" /> + <Compile Include="Session\SessionUserInfo.cs" /> <Compile Include="Session\UserDataChangeInfo.cs" /> <Compile Include="Themes\AppTheme.cs" /> + <Compile Include="Themes\AppThemeInfo.cs" /> <Compile Include="Themes\ThemeImage.cs" /> <Compile Include="Updates\CheckForUpdateResult.cs" /> <Compile Include="Updates\PackageTargetSystem.cs" /> <Compile Include="Updates\InstallationInfo.cs" /> <Compile Include="Updates\PackageType.cs" /> <Compile Include="Updates\PackageVersionClass.cs" /> - <Compile Include="Entities\RequestResult.cs" /> + <Compile Include="Entities\EmptyRequestResult.cs" /> <Compile Include="Configuration\UserConfiguration.cs" /> <Compile Include="Drawing\DrawingUtils.cs" /> <Compile Include="Dto\UserItemDataDto.cs" /> diff --git a/MediaBrowser.Model/MediaInfo/AudioCodec.cs b/MediaBrowser.Model/MediaInfo/AudioCodec.cs new file mode 100644 index 000000000..a76c0e742 --- /dev/null +++ b/MediaBrowser.Model/MediaInfo/AudioCodec.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.MediaInfo +{ + public class AudioCodec + { + public const string AAC = "AAC"; + public const string MP3 = "MP3"; + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs index 01e75e6f8..963e8dd95 100644 --- a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs +++ b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs @@ -34,11 +34,4 @@ namespace MediaBrowser.Model.MediaInfo /// <value>The chapters.</value> public List<double> Chapters { get; set; } } - - public enum TransportStreamTimestamp - { - None, - Zero, - Valid - } } diff --git a/MediaBrowser.Model/MediaInfo/Container.cs b/MediaBrowser.Model/MediaInfo/Container.cs new file mode 100644 index 000000000..0305b9cfa --- /dev/null +++ b/MediaBrowser.Model/MediaInfo/Container.cs @@ -0,0 +1,8 @@ + +namespace MediaBrowser.Model.MediaInfo +{ + public class Container + { + public const string MP4 = "MP4"; + } +} diff --git a/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs b/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs new file mode 100644 index 000000000..51a0dbc9e --- /dev/null +++ b/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs @@ -0,0 +1,7 @@ +namespace MediaBrowser.Model.MediaInfo +{ + public class SubtitleFormat + { + public const string SRT = "SRT"; + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/MediaInfo/TransportStreamTimestamp.cs b/MediaBrowser.Model/MediaInfo/TransportStreamTimestamp.cs new file mode 100644 index 000000000..4c808a8dc --- /dev/null +++ b/MediaBrowser.Model/MediaInfo/TransportStreamTimestamp.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.MediaInfo +{ + public enum TransportStreamTimestamp + { + None, + Zero, + Valid + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/MediaInfo/VideoCodec.cs b/MediaBrowser.Model/MediaInfo/VideoCodec.cs new file mode 100644 index 000000000..7405eb13e --- /dev/null +++ b/MediaBrowser.Model/MediaInfo/VideoCodec.cs @@ -0,0 +1,12 @@ +namespace MediaBrowser.Model.MediaInfo +{ + public class VideoCodec + { + public const string H263 = "H263"; + public const string H264 = "H264"; + public const string H265 = "H265"; + public const string MPEG4 = "MPEG4"; + public const string MSMPEG4 = "MSMPEG4"; + public const string VC1 = "VC1"; + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/News/NewsChannel.cs b/MediaBrowser.Model/News/NewsChannel.cs new file mode 100644 index 000000000..c3955b0a0 --- /dev/null +++ b/MediaBrowser.Model/News/NewsChannel.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.News +{ + public class NewsChannel + { + public string Title { get; set; } + public string Link { get; set; } + public string Description { get; set; } + public List<NewsItem> Items { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/News/NewsItem.cs b/MediaBrowser.Model/News/NewsItem.cs index 181f43db7..2a05c420a 100644 --- a/MediaBrowser.Model/News/NewsItem.cs +++ b/MediaBrowser.Model/News/NewsItem.cs @@ -1,16 +1,7 @@ using System; -using System.Collections.Generic; namespace MediaBrowser.Model.News { - public class NewsChannel - { - public string Title { get; set; } - public string Link { get; set; } - public string Description { get; set; } - public List<NewsItem> Items { get; set; } - } - public class NewsItem { public string Title { get; set; } @@ -20,11 +11,4 @@ namespace MediaBrowser.Model.News public string Guid { get; set; } public DateTime Date { get; set; } } - - public class NewsQuery - { - public int? StartIndex { get; set; } - - public int? Limit { get; set; } - } } diff --git a/MediaBrowser.Model/News/NewsQuery.cs b/MediaBrowser.Model/News/NewsQuery.cs new file mode 100644 index 000000000..567888921 --- /dev/null +++ b/MediaBrowser.Model/News/NewsQuery.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.News +{ + public class NewsQuery + { + public int? StartIndex { get; set; } + + public int? Limit { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Notifications/Notification.cs b/MediaBrowser.Model/Notifications/Notification.cs index d894911e7..731c3d303 100644 --- a/MediaBrowser.Model/Notifications/Notification.cs +++ b/MediaBrowser.Model/Notifications/Notification.cs @@ -1,6 +1,4 @@ -using MediaBrowser.Model.Configuration; -using System; -using System.Collections.Generic; +using System; namespace MediaBrowser.Model.Notifications { @@ -27,70 +25,4 @@ namespace MediaBrowser.Model.Notifications Date = DateTime.UtcNow; } } - - public class NotificationRequest - { - public string Name { get; set; } - - public string Description { get; set; } - - public string Url { get; set; } - - public NotificationLevel Level { get; set; } - - public List<string> UserIds { get; set; } - - public DateTime Date { get; set; } - - /// <summary> - /// The corresponding type name used in configuration. Not for display. - /// </summary> - public string NotificationType { get; set; } - - public Dictionary<string, string> Variables { get; set; } - - public SendToUserType? SendToUserMode { get; set; } - - public List<string> ExcludeUserIds { get; set; } - - public NotificationRequest() - { - UserIds = new List<string>(); - Date = DateTime.UtcNow; - - Variables = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); - - ExcludeUserIds = new List<string>(); - } - } - - public class NotificationTypeInfo - { - public string Type { get; set; } - - public string Name { get; set; } - - public bool Enabled { get; set; } - - public string Category { get; set; } - - public bool IsBasedOnUserEvent { get; set; } - - public string DefaultTitle { get; set; } - - public string DefaultDescription { get; set; } - - public List<string> Variables { get; set; } - - public NotificationTypeInfo() - { - Variables = new List<string>(); - } - } - - public class NotificationServiceInfo - { - public string Name { get; set; } - public string Id { get; set; } - } } diff --git a/MediaBrowser.Model/Notifications/NotificationRequest.cs b/MediaBrowser.Model/Notifications/NotificationRequest.cs new file mode 100644 index 000000000..d47e9c4f2 --- /dev/null +++ b/MediaBrowser.Model/Notifications/NotificationRequest.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using MediaBrowser.Model.Configuration; + +namespace MediaBrowser.Model.Notifications +{ + public class NotificationRequest + { + public string Name { get; set; } + + public string Description { get; set; } + + public string Url { get; set; } + + public NotificationLevel Level { get; set; } + + public List<string> UserIds { get; set; } + + public DateTime Date { get; set; } + + /// <summary> + /// The corresponding type name used in configuration. Not for display. + /// </summary> + public string NotificationType { get; set; } + + public Dictionary<string, string> Variables { get; set; } + + public SendToUserType? SendToUserMode { get; set; } + + public List<string> ExcludeUserIds { get; set; } + + public NotificationRequest() + { + UserIds = new List<string>(); + Date = DateTime.UtcNow; + + Variables = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + + ExcludeUserIds = new List<string>(); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Notifications/NotificationServiceInfo.cs b/MediaBrowser.Model/Notifications/NotificationServiceInfo.cs new file mode 100644 index 000000000..0ffe7d4ae --- /dev/null +++ b/MediaBrowser.Model/Notifications/NotificationServiceInfo.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Notifications +{ + public class NotificationServiceInfo + { + public string Name { get; set; } + public string Id { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs b/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs new file mode 100644 index 000000000..59b39fbc7 --- /dev/null +++ b/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.Notifications +{ + public class NotificationTypeInfo + { + public string Type { get; set; } + + public string Name { get; set; } + + public bool Enabled { get; set; } + + public string Category { get; set; } + + public bool IsBasedOnUserEvent { get; set; } + + public string DefaultTitle { get; set; } + + public string DefaultDescription { get; set; } + + public List<string> Variables { get; set; } + + public NotificationTypeInfo() + { + Variables = new List<string>(); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Plugins/BasePluginConfiguration.cs b/MediaBrowser.Model/Plugins/BasePluginConfiguration.cs index 4c7b8812f..9a8bfadd1 100644 --- a/MediaBrowser.Model/Plugins/BasePluginConfiguration.cs +++ b/MediaBrowser.Model/Plugins/BasePluginConfiguration.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Model.Updates; - + namespace MediaBrowser.Model.Plugins { /// <summary> @@ -7,26 +6,5 @@ namespace MediaBrowser.Model.Plugins /// </summary> public class BasePluginConfiguration { - /// <summary> - /// Whether or not this plug-in should be automatically updated when a - /// compatible new version is released - /// </summary> - /// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value> - public bool EnableAutoUpdate { get; set; } - - /// <summary> - /// The classification of updates to which to subscribe. - /// Options are: Dev, Beta or Release - /// </summary> - /// <value>The update class.</value> - public PackageVersionClass UpdateClass { get; set; } - - /// <summary> - /// Initializes a new instance of the <see cref="BasePluginConfiguration" /> class. - /// </summary> - public BasePluginConfiguration() - { - EnableAutoUpdate = true; - } } } diff --git a/MediaBrowser.Model/Plugins/PluginInfo.cs b/MediaBrowser.Model/Plugins/PluginInfo.cs index fbc2e2927..e84c06c21 100644 --- a/MediaBrowser.Model/Plugins/PluginInfo.cs +++ b/MediaBrowser.Model/Plugins/PluginInfo.cs @@ -49,25 +49,5 @@ namespace MediaBrowser.Model.Plugins /// </summary> /// <value>The unique id.</value> public string Id { get; set; } - - /// <summary> - /// Whether or not this plug-in should be automatically updated when a - /// compatible new version is released - /// </summary> - /// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value> - public bool EnableAutoUpdate { get; set; } - - /// <summary> - /// The classification of updates to which to subscribe. - /// Options are: Dev, Beta or Release - /// </summary> - /// <value>The update class.</value> - public PackageVersionClass UpdateClass { get; set; } - - /// <summary> - /// Gets or sets the minimum required UI version. - /// </summary> - /// <value>The minimum required UI version.</value> - public string MinimumRequiredUIVersion { get; set; } } } diff --git a/MediaBrowser.Model/Providers/ExternalIdInfo.cs b/MediaBrowser.Model/Providers/ExternalIdInfo.cs index e041f06af..2c5cfe91b 100644 --- a/MediaBrowser.Model/Providers/ExternalIdInfo.cs +++ b/MediaBrowser.Model/Providers/ExternalIdInfo.cs @@ -21,19 +21,4 @@ namespace MediaBrowser.Model.Providers /// <value>The URL format string.</value> public string UrlFormatString { get; set; } } - - public class ExternalUrl - { - /// <summary> - /// Gets or sets the name. - /// </summary> - /// <value>The name.</value> - public string Name { get; set; } - - /// <summary> - /// Gets or sets the type of the item. - /// </summary> - /// <value>The type of the item.</value> - public string Url { get; set; } - } } diff --git a/MediaBrowser.Model/Providers/ExternalUrl.cs b/MediaBrowser.Model/Providers/ExternalUrl.cs new file mode 100644 index 000000000..fb744f446 --- /dev/null +++ b/MediaBrowser.Model/Providers/ExternalUrl.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Providers +{ + public class ExternalUrl + { + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value>The name.</value> + public string Name { get; set; } + + /// <summary> + /// Gets or sets the type of the item. + /// </summary> + /// <value>The type of the item.</value> + public string Url { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Providers/RemoteImageQuery.cs b/MediaBrowser.Model/Providers/RemoteImageQuery.cs new file mode 100644 index 000000000..8d5231a25 --- /dev/null +++ b/MediaBrowser.Model/Providers/RemoteImageQuery.cs @@ -0,0 +1,15 @@ +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Model.Providers +{ + public class RemoteImageQuery + { + public string ProviderName { get; set; } + + public ImageType? ImageType { get; set; } + + public bool IncludeDisabledProviders { get; set; } + + public bool IncludeAllLanguages { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Providers/RemoteImageResult.cs b/MediaBrowser.Model/Providers/RemoteImageResult.cs index ed2788c0b..1c60db6ae 100644 --- a/MediaBrowser.Model/Providers/RemoteImageResult.cs +++ b/MediaBrowser.Model/Providers/RemoteImageResult.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using MediaBrowser.Model.Entities; namespace MediaBrowser.Model.Providers { @@ -26,15 +25,4 @@ namespace MediaBrowser.Model.Providers /// <value>The providers.</value> public List<string> Providers { get; set; } } - - public class RemoteImageQuery - { - public string ProviderName { get; set; } - - public ImageType? ImageType { get; set; } - - public bool IncludeDisabledProviders { get; set; } - - public bool IncludeAllLanguages { get; set; } - } } diff --git a/MediaBrowser.Model/Providers/RemoteSubtitleInfo.cs b/MediaBrowser.Model/Providers/RemoteSubtitleInfo.cs new file mode 100644 index 000000000..0a4a52cd5 --- /dev/null +++ b/MediaBrowser.Model/Providers/RemoteSubtitleInfo.cs @@ -0,0 +1,19 @@ +using System; + +namespace MediaBrowser.Model.Providers +{ + public class RemoteSubtitleInfo + { + public string ThreeLetterISOLanguageName { get; set; } + public string Id { get; set; } + public string ProviderName { get; set; } + public string Name { get; set; } + public string Format { get; set; } + public string Author { get; set; } + public string Comment { get; set; } + public DateTime? DateCreated { get; set; } + public float? CommunityRating { get; set; } + public int? DownloadCount { get; set; } + public bool? IsHashMatch { get; set; } + } +} diff --git a/MediaBrowser.Model/Querying/ThemeSongsResult.cs b/MediaBrowser.Model/Querying/AllThemeMediaResult.cs index 9b0a1c61b..89640eb65 100644 --- a/MediaBrowser.Model/Querying/ThemeSongsResult.cs +++ b/MediaBrowser.Model/Querying/AllThemeMediaResult.cs @@ -1,18 +1,5 @@ - -namespace MediaBrowser.Model.Querying +namespace MediaBrowser.Model.Querying { - /// <summary> - /// Class ThemeMediaResult - /// </summary> - public class ThemeMediaResult : ItemsResult - { - /// <summary> - /// Gets or sets the owner id. - /// </summary> - /// <value>The owner id.</value> - public string OwnerId { get; set; } - } - public class AllThemeMediaResult { public ThemeMediaResult ThemeVideosResult { get; set; } @@ -30,4 +17,4 @@ namespace MediaBrowser.Model.Querying SoundtrackSongsResult = new ThemeMediaResult(); } } -} +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Querying/EpisodeQuery.cs b/MediaBrowser.Model/Querying/EpisodeQuery.cs index 589b46433..e2fc3220a 100644 --- a/MediaBrowser.Model/Querying/EpisodeQuery.cs +++ b/MediaBrowser.Model/Querying/EpisodeQuery.cs @@ -22,24 +22,4 @@ namespace MediaBrowser.Model.Querying Fields = new ItemFields[] { }; } } - - public class SeasonQuery - { - public string UserId { get; set; } - - public string SeriesId { get; set; } - - public bool? IsMissing { get; set; } - - public bool? IsVirtualUnaired { get; set; } - - public ItemFields[] Fields { get; set; } - - public bool? IsSpecialSeason { get; set; } - - public SeasonQuery() - { - Fields = new ItemFields[] { }; - } - } } diff --git a/MediaBrowser.Model/Querying/ItemFilter.cs b/MediaBrowser.Model/Querying/ItemFilter.cs index 2e88a98c9..d30978ebf 100644 --- a/MediaBrowser.Model/Querying/ItemFilter.cs +++ b/MediaBrowser.Model/Querying/ItemFilter.cs @@ -27,6 +27,10 @@ namespace MediaBrowser.Model.Querying /// </summary> IsFavorite = 5, /// <summary> + /// The is recently added + /// </summary> + IsRecentlyAdded = 6, + /// <summary> /// The item is resumable /// </summary> IsResumable = 7, diff --git a/MediaBrowser.Model/Querying/NextUpQuery.cs b/MediaBrowser.Model/Querying/NextUpQuery.cs index cdce2e307..0e9c9882f 100644 --- a/MediaBrowser.Model/Querying/NextUpQuery.cs +++ b/MediaBrowser.Model/Querying/NextUpQuery.cs @@ -10,6 +10,12 @@ namespace MediaBrowser.Model.Querying public string UserId { get; set; } /// <summary> + /// Gets or sets the parent identifier. + /// </summary> + /// <value>The parent identifier.</value> + public string ParentId { get; set; } + + /// <summary> /// Gets or sets the series id. /// </summary> /// <value>The series id.</value> @@ -33,32 +39,4 @@ namespace MediaBrowser.Model.Querying /// <value>The fields.</value> public ItemFields[] Fields { get; set; } } - - public class UpcomingEpisodesQuery - { - /// <summary> - /// Gets or sets the user id. - /// </summary> - /// <value>The user id.</value> - public string UserId { get; set; } - - /// <summary> - /// Skips over a given number of items within the results. Use for paging. - /// </summary> - /// <value>The start index.</value> - public int? StartIndex { get; set; } - - /// <summary> - /// The maximum number of items to return - /// </summary> - /// <value>The limit.</value> - public int? Limit { get; set; } - - /// <summary> - /// Fields to return within the items, in addition to basic information - /// </summary> - /// <value>The fields.</value> - public ItemFields[] Fields { get; set; } - } - } diff --git a/MediaBrowser.Model/Querying/SeasonQuery.cs b/MediaBrowser.Model/Querying/SeasonQuery.cs new file mode 100644 index 000000000..b1fe635bb --- /dev/null +++ b/MediaBrowser.Model/Querying/SeasonQuery.cs @@ -0,0 +1,22 @@ +namespace MediaBrowser.Model.Querying +{ + public class SeasonQuery + { + public string UserId { get; set; } + + public string SeriesId { get; set; } + + public bool? IsMissing { get; set; } + + public bool? IsVirtualUnaired { get; set; } + + public ItemFields[] Fields { get; set; } + + public bool? IsSpecialSeason { get; set; } + + public SeasonQuery() + { + Fields = new ItemFields[] { }; + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Querying/SimilarItemsByNameQuery.cs b/MediaBrowser.Model/Querying/SimilarItemsByNameQuery.cs new file mode 100644 index 000000000..7d0d4da31 --- /dev/null +++ b/MediaBrowser.Model/Querying/SimilarItemsByNameQuery.cs @@ -0,0 +1,29 @@ +namespace MediaBrowser.Model.Querying +{ + public class SimilarItemsByNameQuery + { + /// <summary> + /// The user to localize search results for + /// </summary> + /// <value>The user id.</value> + public string UserId { get; set; } + + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value>The name.</value> + public string Name { get; set; } + + /// <summary> + /// The maximum number of items to return + /// </summary> + /// <value>The limit.</value> + public int? Limit { get; set; } + + /// <summary> + /// Fields to return within the items, in addition to basic information + /// </summary> + /// <value>The fields.</value> + public ItemFields[] Fields { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Querying/SimilarItemsQuery.cs b/MediaBrowser.Model/Querying/SimilarItemsQuery.cs index d792aa76d..0dd491550 100644 --- a/MediaBrowser.Model/Querying/SimilarItemsQuery.cs +++ b/MediaBrowser.Model/Querying/SimilarItemsQuery.cs @@ -26,31 +26,4 @@ /// <value>The fields.</value> public ItemFields[] Fields { get; set; } } - - public class SimilarItemsByNameQuery - { - /// <summary> - /// The user to localize search results for - /// </summary> - /// <value>The user id.</value> - public string UserId { get; set; } - - /// <summary> - /// Gets or sets the name. - /// </summary> - /// <value>The name.</value> - public string Name { get; set; } - - /// <summary> - /// The maximum number of items to return - /// </summary> - /// <value>The limit.</value> - public int? Limit { get; set; } - - /// <summary> - /// Fields to return within the items, in addition to basic information - /// </summary> - /// <value>The fields.</value> - public ItemFields[] Fields { get; set; } - } } diff --git a/MediaBrowser.Model/Querying/ThemeMediaResult.cs b/MediaBrowser.Model/Querying/ThemeMediaResult.cs new file mode 100644 index 000000000..80478a910 --- /dev/null +++ b/MediaBrowser.Model/Querying/ThemeMediaResult.cs @@ -0,0 +1,15 @@ + +namespace MediaBrowser.Model.Querying +{ + /// <summary> + /// Class ThemeMediaResult + /// </summary> + public class ThemeMediaResult : ItemsResult + { + /// <summary> + /// Gets or sets the owner id. + /// </summary> + /// <value>The owner id.</value> + public string OwnerId { get; set; } + } +} diff --git a/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs b/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs new file mode 100644 index 000000000..e5a875e88 --- /dev/null +++ b/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs @@ -0,0 +1,35 @@ +namespace MediaBrowser.Model.Querying +{ + public class UpcomingEpisodesQuery + { + /// <summary> + /// Gets or sets the user id. + /// </summary> + /// <value>The user id.</value> + public string UserId { get; set; } + + /// <summary> + /// Gets or sets the parent identifier. + /// </summary> + /// <value>The parent identifier.</value> + public string ParentId { get; set; } + + /// <summary> + /// Skips over a given number of items within the results. Use for paging. + /// </summary> + /// <value>The start index.</value> + public int? StartIndex { get; set; } + + /// <summary> + /// The maximum number of items to return + /// </summary> + /// <value>The limit.</value> + public int? Limit { get; set; } + + /// <summary> + /// Fields to return within the items, in addition to basic information + /// </summary> + /// <value>The fields.</value> + public ItemFields[] Fields { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Search/SearchHint.cs b/MediaBrowser.Model/Search/SearchHint.cs index 002200c0f..4eced7706 100644 --- a/MediaBrowser.Model/Search/SearchHint.cs +++ b/MediaBrowser.Model/Search/SearchHint.cs @@ -47,13 +47,13 @@ namespace MediaBrowser.Model.Search /// Gets or sets the image tag. /// </summary> /// <value>The image tag.</value> - public Guid? PrimaryImageTag { get; set; } + public string PrimaryImageTag { get; set; } /// <summary> /// Gets or sets the thumb image tag. /// </summary> /// <value>The thumb image tag.</value> - public Guid? ThumbImageTag { get; set; } + public string ThumbImageTag { get; set; } /// <summary> /// Gets or sets the thumb image item identifier. @@ -65,7 +65,7 @@ namespace MediaBrowser.Model.Search /// Gets or sets the backdrop image tag. /// </summary> /// <value>The backdrop image tag.</value> - public Guid? BackdropImageTag { get; set; } + public string BackdropImageTag { get; set; } /// <summary> /// Gets or sets the backdrop image item identifier. diff --git a/MediaBrowser.Model/Session/ClientCapabilities.cs b/MediaBrowser.Model/Session/ClientCapabilities.cs new file mode 100644 index 000000000..5bee06087 --- /dev/null +++ b/MediaBrowser.Model/Session/ClientCapabilities.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.Session +{ + public class ClientCapabilities + { + public List<string> PlayableMediaTypes { get; set; } + public List<string> SupportedCommands { get; set; } + + public ClientCapabilities() + { + PlayableMediaTypes = new List<string>(); + SupportedCommands = new List<string>(); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/GeneralCommand.cs b/MediaBrowser.Model/Session/GeneralCommand.cs index 071eac954..7e818245d 100644 --- a/MediaBrowser.Model/Session/GeneralCommand.cs +++ b/MediaBrowser.Model/Session/GeneralCommand.cs @@ -16,39 +16,4 @@ namespace MediaBrowser.Model.Session Arguments = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); } } - - /// <summary> - /// This exists simply to identify a set of known commands. - /// </summary> - public enum GeneralCommandType - { - MoveUp = 0, - MoveDown = 1, - MoveLeft = 2, - MoveRight = 3, - PageUp = 4, - PageDown = 5, - PreviousLetter = 6, - NextLetter = 7, - ToggleOsd = 8, - ToggleContextMenu = 9, - Select = 10, - Back = 11, - TakeScreenshot = 12, - SendKey = 13, - SendString = 14, - GoHome = 15, - GoToSettings = 16, - VolumeUp = 17, - VolumeDown = 18, - Mute = 19, - Unmute = 20, - ToggleMute = 21, - SetVolume = 22, - SetAudioStreamIndex = 23, - SetSubtitleStreamIndex = 24, - ToggleFullscreen = 25, - DisplayContent = 26, - GoToSearch = 27 - } } diff --git a/MediaBrowser.Model/Session/GeneralCommandType.cs b/MediaBrowser.Model/Session/GeneralCommandType.cs new file mode 100644 index 000000000..f8773a246 --- /dev/null +++ b/MediaBrowser.Model/Session/GeneralCommandType.cs @@ -0,0 +1,38 @@ +namespace MediaBrowser.Model.Session +{ + /// <summary> + /// This exists simply to identify a set of known commands. + /// </summary> + public enum GeneralCommandType + { + MoveUp = 0, + MoveDown = 1, + MoveLeft = 2, + MoveRight = 3, + PageUp = 4, + PageDown = 5, + PreviousLetter = 6, + NextLetter = 7, + ToggleOsd = 8, + ToggleContextMenu = 9, + Select = 10, + Back = 11, + TakeScreenshot = 12, + SendKey = 13, + SendString = 14, + GoHome = 15, + GoToSettings = 16, + VolumeUp = 17, + VolumeDown = 18, + Mute = 19, + Unmute = 20, + ToggleMute = 21, + SetVolume = 22, + SetAudioStreamIndex = 23, + SetSubtitleStreamIndex = 24, + ToggleFullscreen = 25, + DisplayContent = 26, + GoToSearch = 27, + DisplayMessage = 28 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/PlayCommand.cs b/MediaBrowser.Model/Session/PlayCommand.cs new file mode 100644 index 000000000..3a5a951d7 --- /dev/null +++ b/MediaBrowser.Model/Session/PlayCommand.cs @@ -0,0 +1,29 @@ +namespace MediaBrowser.Model.Session +{ + /// <summary> + /// Enum PlayCommand + /// </summary> + public enum PlayCommand + { + /// <summary> + /// The play now + /// </summary> + PlayNow = 0, + /// <summary> + /// The play next + /// </summary> + PlayNext = 1, + /// <summary> + /// The play last + /// </summary> + PlayLast = 2, + /// <summary> + /// The play instant mix + /// </summary> + PlayInstantMix = 3, + /// <summary> + /// The play shuffle + /// </summary> + PlayShuffle = 4 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/PlayMethod.cs b/MediaBrowser.Model/Session/PlayMethod.cs new file mode 100644 index 000000000..87b728627 --- /dev/null +++ b/MediaBrowser.Model/Session/PlayMethod.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.Session +{ + public enum PlayMethod + { + Transcode = 0, + DirectStream = 1, + DirectPlay = 2 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/PlayRequest.cs b/MediaBrowser.Model/Session/PlayRequest.cs index 74d7a70a3..5db5e90cb 100644 --- a/MediaBrowser.Model/Session/PlayRequest.cs +++ b/MediaBrowser.Model/Session/PlayRequest.cs @@ -30,31 +30,4 @@ namespace MediaBrowser.Model.Session /// <value>The controlling user identifier.</value> public string ControllingUserId { get; set; } } - - /// <summary> - /// Enum PlayCommand - /// </summary> - public enum PlayCommand - { - /// <summary> - /// The play now - /// </summary> - PlayNow = 0, - /// <summary> - /// The play next - /// </summary> - PlayNext = 1, - /// <summary> - /// The play last - /// </summary> - PlayLast = 2, - /// <summary> - /// The play instant mix - /// </summary> - PlayInstantMix = 3, - /// <summary> - /// The play shuffle - /// </summary> - PlayShuffle = 4 - } }
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/PlaybackReports.cs b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs index 93960076e..f04dea1ea 100644 --- a/MediaBrowser.Model/Session/PlaybackReports.cs +++ b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs @@ -1,26 +1,8 @@ using MediaBrowser.Model.Entities; -using System.Collections.Generic; namespace MediaBrowser.Model.Session { /// <summary> - /// Class PlaybackStartInfo. - /// </summary> - public class PlaybackStartInfo : PlaybackProgressInfo - { - public PlaybackStartInfo() - { - QueueableMediaTypes = new List<string>(); - } - - /// <summary> - /// Gets or sets the queueable media types. - /// </summary> - /// <value>The queueable media types.</value> - public List<string> QueueableMediaTypes { get; set; } - } - - /// <summary> /// Class PlaybackProgressInfo. /// </summary> public class PlaybackProgressInfo @@ -97,47 +79,4 @@ namespace MediaBrowser.Model.Session /// <value>The play method.</value> public PlayMethod PlayMethod { get; set; } } - - public enum PlayMethod - { - Transcode = 0, - DirectStream = 1, - DirectPlay = 2 - } - - /// <summary> - /// Class PlaybackStopInfo. - /// </summary> - public class PlaybackStopInfo - { - /// <summary> - /// Gets or sets the item. - /// </summary> - /// <value>The item.</value> - public BaseItemInfo Item { get; set; } - - /// <summary> - /// Gets or sets the item identifier. - /// </summary> - /// <value>The item identifier.</value> - public string ItemId { get; set; } - - /// <summary> - /// Gets or sets the session id. - /// </summary> - /// <value>The session id.</value> - public string SessionId { get; set; } - - /// <summary> - /// Gets or sets the media version identifier. - /// </summary> - /// <value>The media version identifier.</value> - public string MediaSourceId { get; set; } - - /// <summary> - /// Gets or sets the position ticks. - /// </summary> - /// <value>The position ticks.</value> - public long? PositionTicks { get; set; } - } -} +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/PlaybackStartInfo.cs b/MediaBrowser.Model/Session/PlaybackStartInfo.cs new file mode 100644 index 000000000..d1ea2841e --- /dev/null +++ b/MediaBrowser.Model/Session/PlaybackStartInfo.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.Session +{ + /// <summary> + /// Class PlaybackStartInfo. + /// </summary> + public class PlaybackStartInfo : PlaybackProgressInfo + { + public PlaybackStartInfo() + { + QueueableMediaTypes = new List<string>(); + } + + /// <summary> + /// Gets or sets the queueable media types. + /// </summary> + /// <value>The queueable media types.</value> + public List<string> QueueableMediaTypes { get; set; } + } +} diff --git a/MediaBrowser.Model/Session/PlaybackStopInfo.cs b/MediaBrowser.Model/Session/PlaybackStopInfo.cs new file mode 100644 index 000000000..38025f183 --- /dev/null +++ b/MediaBrowser.Model/Session/PlaybackStopInfo.cs @@ -0,0 +1,40 @@ +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Model.Session +{ + /// <summary> + /// Class PlaybackStopInfo. + /// </summary> + public class PlaybackStopInfo + { + /// <summary> + /// Gets or sets the item. + /// </summary> + /// <value>The item.</value> + public BaseItemInfo Item { get; set; } + + /// <summary> + /// Gets or sets the item identifier. + /// </summary> + /// <value>The item identifier.</value> + public string ItemId { get; set; } + + /// <summary> + /// Gets or sets the session id. + /// </summary> + /// <value>The session id.</value> + public string SessionId { get; set; } + + /// <summary> + /// Gets or sets the media version identifier. + /// </summary> + /// <value>The media version identifier.</value> + public string MediaSourceId { get; set; } + + /// <summary> + /// Gets or sets the position ticks. + /// </summary> + /// <value>The position ticks.</value> + public long? PositionTicks { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/PlayerStateInfo.cs b/MediaBrowser.Model/Session/PlayerStateInfo.cs new file mode 100644 index 000000000..c9afef8e0 --- /dev/null +++ b/MediaBrowser.Model/Session/PlayerStateInfo.cs @@ -0,0 +1,59 @@ +namespace MediaBrowser.Model.Session +{ + public class PlayerStateInfo + { + /// <summary> + /// Gets or sets the now playing position ticks. + /// </summary> + /// <value>The now playing position ticks.</value> + public long? PositionTicks { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance can seek. + /// </summary> + /// <value><c>true</c> if this instance can seek; otherwise, <c>false</c>.</value> + public bool CanSeek { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is paused. + /// </summary> + /// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value> + public bool IsPaused { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is muted. + /// </summary> + /// <value><c>true</c> if this instance is muted; otherwise, <c>false</c>.</value> + public bool IsMuted { get; set; } + + /// <summary> + /// Gets or sets the volume level. + /// </summary> + /// <value>The volume level.</value> + public int? VolumeLevel { get; set; } + + /// <summary> + /// Gets or sets the index of the now playing audio stream. + /// </summary> + /// <value>The index of the now playing audio stream.</value> + public int? AudioStreamIndex { get; set; } + + /// <summary> + /// Gets or sets the index of the now playing subtitle stream. + /// </summary> + /// <value>The index of the now playing subtitle stream.</value> + public int? SubtitleStreamIndex { get; set; } + + /// <summary> + /// Gets or sets the now playing media version identifier. + /// </summary> + /// <value>The now playing media version identifier.</value> + public string MediaSourceId { get; set; } + + /// <summary> + /// Gets or sets the play method. + /// </summary> + /// <value>The play method.</value> + public PlayMethod? PlayMethod { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/PlaystateCommand.cs b/MediaBrowser.Model/Session/PlaystateCommand.cs index 6466c6485..2af4f26e3 100644 --- a/MediaBrowser.Model/Session/PlaystateCommand.cs +++ b/MediaBrowser.Model/Session/PlaystateCommand.cs @@ -39,17 +39,4 @@ namespace MediaBrowser.Model.Session /// </summary> FastForward } - - public class PlaystateRequest - { - public PlaystateCommand Command { get; set; } - - public long? SeekPositionTicks { get; set; } - - /// <summary> - /// Gets or sets the controlling user identifier. - /// </summary> - /// <value>The controlling user identifier.</value> - public string ControllingUserId { get; set; } - } }
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/PlaystateRequest.cs b/MediaBrowser.Model/Session/PlaystateRequest.cs new file mode 100644 index 000000000..8a046b503 --- /dev/null +++ b/MediaBrowser.Model/Session/PlaystateRequest.cs @@ -0,0 +1,15 @@ +namespace MediaBrowser.Model.Session +{ + public class PlaystateRequest + { + public PlaystateCommand Command { get; set; } + + public long? SeekPositionTicks { get; set; } + + /// <summary> + /// Gets or sets the controlling user identifier. + /// </summary> + /// <value>The controlling user identifier.</value> + public string ControllingUserId { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Session/SessionInfoDto.cs b/MediaBrowser.Model/Session/SessionInfoDto.cs index cd6ecbbb2..46e214d24 100644 --- a/MediaBrowser.Model/Session/SessionInfoDto.cs +++ b/MediaBrowser.Model/Session/SessionInfoDto.cs @@ -55,7 +55,7 @@ namespace MediaBrowser.Model.Session /// Gets or sets the user primary image tag. /// </summary> /// <value>The user primary image tag.</value> - public Guid? UserPrimaryImageTag { get; set; } + public string UserPrimaryImageTag { get; set; } /// <summary> /// Gets or sets the name of the user. @@ -148,90 +148,4 @@ namespace MediaBrowser.Model.Session SupportedCommands = new List<string>(); } } - - /// <summary> - /// Class SessionUserInfo. - /// </summary> - public class SessionUserInfo - { - /// <summary> - /// Gets or sets the user identifier. - /// </summary> - /// <value>The user identifier.</value> - public string UserId { get; set; } - /// <summary> - /// Gets or sets the name of the user. - /// </summary> - /// <value>The name of the user.</value> - public string UserName { get; set; } - } - - public class ClientCapabilities - { - public List<string> PlayableMediaTypes { get; set; } - public List<string> SupportedCommands { get; set; } - - public ClientCapabilities() - { - PlayableMediaTypes = new List<string>(); - SupportedCommands = new List<string>(); - } - } - - public class PlayerStateInfo - { - /// <summary> - /// Gets or sets the now playing position ticks. - /// </summary> - /// <value>The now playing position ticks.</value> - public long? PositionTicks { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance can seek. - /// </summary> - /// <value><c>true</c> if this instance can seek; otherwise, <c>false</c>.</value> - public bool CanSeek { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance is paused. - /// </summary> - /// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value> - public bool IsPaused { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance is muted. - /// </summary> - /// <value><c>true</c> if this instance is muted; otherwise, <c>false</c>.</value> - public bool IsMuted { get; set; } - - /// <summary> - /// Gets or sets the volume level. - /// </summary> - /// <value>The volume level.</value> - public int? VolumeLevel { get; set; } - - /// <summary> - /// Gets or sets the index of the now playing audio stream. - /// </summary> - /// <value>The index of the now playing audio stream.</value> - public int? AudioStreamIndex { get; set; } - - /// <summary> - /// Gets or sets the index of the now playing subtitle stream. - /// </summary> - /// <value>The index of the now playing subtitle stream.</value> - public int? SubtitleStreamIndex { get; set; } - - /// <summary> - /// Gets or sets the now playing media version identifier. - /// </summary> - /// <value>The now playing media version identifier.</value> - public string MediaSourceId { get; set; } - - /// <summary> - /// Gets or sets the play method. - /// </summary> - /// <value>The play method.</value> - public PlayMethod? PlayMethod { get; set; } - } } diff --git a/MediaBrowser.Model/Session/SessionUserInfo.cs b/MediaBrowser.Model/Session/SessionUserInfo.cs new file mode 100644 index 000000000..39b96931a --- /dev/null +++ b/MediaBrowser.Model/Session/SessionUserInfo.cs @@ -0,0 +1,19 @@ +namespace MediaBrowser.Model.Session +{ + /// <summary> + /// Class SessionUserInfo. + /// </summary> + public class SessionUserInfo + { + /// <summary> + /// Gets or sets the user identifier. + /// </summary> + /// <value>The user identifier.</value> + public string UserId { get; set; } + /// <summary> + /// Gets or sets the name of the user. + /// </summary> + /// <value>The name of the user.</value> + public string UserName { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Tasks/TaskInfo.cs b/MediaBrowser.Model/Tasks/TaskInfo.cs index 8e795f22f..83ee0b7e6 100644 --- a/MediaBrowser.Model/Tasks/TaskInfo.cs +++ b/MediaBrowser.Model/Tasks/TaskInfo.cs @@ -30,7 +30,7 @@ namespace MediaBrowser.Model.Tasks /// Gets or sets the id. /// </summary> /// <value>The id.</value> - public Guid Id { get; set; } + public string Id { get; set; } /// <summary> /// Gets or sets the last execution result. diff --git a/MediaBrowser.Model/Tasks/TaskResult.cs b/MediaBrowser.Model/Tasks/TaskResult.cs index c04d2f2fe..e73b4c9a1 100644 --- a/MediaBrowser.Model/Tasks/TaskResult.cs +++ b/MediaBrowser.Model/Tasks/TaskResult.cs @@ -35,7 +35,7 @@ namespace MediaBrowser.Model.Tasks /// Gets or sets the id. /// </summary> /// <value>The id.</value> - public Guid Id { get; set; } + public string Id { get; set; } /// <summary> /// Gets or sets the error message. diff --git a/MediaBrowser.Model/Themes/AppTheme.cs b/MediaBrowser.Model/Themes/AppTheme.cs index a814fec33..40a729963 100644 --- a/MediaBrowser.Model/Themes/AppTheme.cs +++ b/MediaBrowser.Model/Themes/AppTheme.cs @@ -20,11 +20,4 @@ namespace MediaBrowser.Model.Themes Images = new List<ThemeImage>(); } } - - public class AppThemeInfo - { - public string AppName { get; set; } - - public string Name { get; set; } - } } diff --git a/MediaBrowser.Model/Themes/AppThemeInfo.cs b/MediaBrowser.Model/Themes/AppThemeInfo.cs new file mode 100644 index 000000000..bc359530a --- /dev/null +++ b/MediaBrowser.Model/Themes/AppThemeInfo.cs @@ -0,0 +1,9 @@ +namespace MediaBrowser.Model.Themes +{ + public class AppThemeInfo + { + public string AppName { get; set; } + + public string Name { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Updates/InstallationInfo.cs b/MediaBrowser.Model/Updates/InstallationInfo.cs index 09b4975a8..b904a0e58 100644 --- a/MediaBrowser.Model/Updates/InstallationInfo.cs +++ b/MediaBrowser.Model/Updates/InstallationInfo.cs @@ -11,7 +11,7 @@ namespace MediaBrowser.Model.Updates /// Gets or sets the id. /// </summary> /// <value>The id.</value> - public Guid Id { get; set; } + public string Id { get; set; } /// <summary> /// Gets or sets the name. diff --git a/MediaBrowser.Model/Updates/PackageVersionInfo.cs b/MediaBrowser.Model/Updates/PackageVersionInfo.cs index 3b0a94019..b3d297e8e 100644 --- a/MediaBrowser.Model/Updates/PackageVersionInfo.cs +++ b/MediaBrowser.Model/Updates/PackageVersionInfo.cs @@ -47,7 +47,7 @@ namespace MediaBrowser.Model.Updates /// <param name="str">The STR.</param> /// <param name="def">The def.</param> /// <returns>System.String.</returns> - private static string ValueOrDefault(string str, string def = "") + private static string ValueOrDefault(string str, string def) { return string.IsNullOrEmpty(str) ? def : str; } @@ -80,7 +80,7 @@ namespace MediaBrowser.Model.Updates /// Gets or sets the source URL. /// </summary> /// <value>The source URL.</value> - public Guid checksum { get; set; } + public string checksum { get; set; } /// <summary> /// Gets or sets the target filename. diff --git a/MediaBrowser.Model/Web/QueryStringDictionary.cs b/MediaBrowser.Model/Web/QueryStringDictionary.cs index 905fbb215..b011d4d9c 100644 --- a/MediaBrowser.Model/Web/QueryStringDictionary.cs +++ b/MediaBrowser.Model/Web/QueryStringDictionary.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; namespace MediaBrowser.Model.Web @@ -24,7 +25,7 @@ namespace MediaBrowser.Model.Web /// <param name="value">The value.</param> public void Add(string name, int value) { - Add(name, value.ToString()); + Add(name, value.ToString(CultureInfo.InvariantCulture)); } /// <summary> @@ -34,7 +35,7 @@ namespace MediaBrowser.Model.Web /// <param name="value">The value.</param> public void Add(string name, long value) { - Add(name, value.ToString()); + Add(name, value.ToString(CultureInfo.InvariantCulture)); } /// <summary> @@ -44,7 +45,7 @@ namespace MediaBrowser.Model.Web /// <param name="value">The value.</param> public void Add(string name, double value) { - Add(name, value.ToString()); + Add(name, value.ToString(CultureInfo.InvariantCulture)); } /// <summary> @@ -128,50 +129,6 @@ namespace MediaBrowser.Model.Web /// <param name="name">The name.</param> /// <param name="value">The value.</param> /// <exception cref="System.ArgumentNullException">value</exception> - public void Add(string name, Guid value) - { - if (value == Guid.Empty) - { - throw new ArgumentNullException("value"); - } - - Add(name, value.ToString()); - } - - /// <summary> - /// Adds if not empty. - /// </summary> - /// <param name="name">The name.</param> - /// <param name="value">The value.</param> - public void AddIfNotEmpty(string name, Guid value) - { - if (value != Guid.Empty) - { - Add(name, value); - } - - Add(name, value); - } - - /// <summary> - /// Adds if not null. - /// </summary> - /// <param name="name">The name.</param> - /// <param name="value">The value.</param> - public void AddIfNotNull(string name, Guid? value) - { - if (value.HasValue) - { - Add(name, value.Value); - } - } - - /// <summary> - /// Adds the specified name. - /// </summary> - /// <param name="name">The name.</param> - /// <param name="value">The value.</param> - /// <exception cref="System.ArgumentNullException">value</exception> public void Add(string name, IEnumerable<int> value) { if (value == null) @@ -179,7 +136,7 @@ namespace MediaBrowser.Model.Web throw new ArgumentNullException("value"); } - Add(name, string.Join(",", value.Select(v => v.ToString()).ToArray())); + Add(name, string.Join(",", value.Select(v => v.ToString(CultureInfo.InvariantCulture)).ToArray())); } /// <summary> @@ -208,7 +165,7 @@ namespace MediaBrowser.Model.Web throw new ArgumentNullException("value"); } - var paramValue = string.Join(",", value.ToArray()); + string paramValue = string.Join(",", value.ToArray()); Add(name, paramValue); } @@ -232,7 +189,7 @@ namespace MediaBrowser.Model.Web /// <param name="name">The name.</param> /// <param name="value">The value.</param> /// <param name="delimiter">The delimiter.</param> - /// <exception cref="System.ArgumentNullException">value</exception> + /// <exception cref="ArgumentNullException">value</exception> public void Add(string name, IEnumerable<string> value, string delimiter) { if (value == null) @@ -240,7 +197,7 @@ namespace MediaBrowser.Model.Web throw new ArgumentNullException("value"); } - var paramValue = string.Join(delimiter, value.ToArray()); + string paramValue = string.Join(delimiter, value.ToArray()); Add(name, paramValue); } @@ -265,7 +222,7 @@ namespace MediaBrowser.Model.Web /// <returns>System.String.</returns> public string GetQueryString() { - var queryParams = this.Select(i => string.Format("{0}={1}", i.Key, GetEncodedValue(i.Value))).ToArray(); + string[] queryParams = this.Select(i => string.Format("{0}={1}", i.Key, GetEncodedValue(i.Value))).ToArray(); return string.Join("&", queryParams); } @@ -287,7 +244,7 @@ namespace MediaBrowser.Model.Web /// <returns>System.String.</returns> public string GetUrl(string prefix) { - var query = GetQueryString(); + string query = GetQueryString(); if (string.IsNullOrEmpty(query)) { |
