diff options
Diffstat (limited to 'MediaBrowser.Model')
23 files changed, 465 insertions, 47 deletions
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index 74a3314b7..80a9ec3c4 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -93,6 +93,12 @@ namespace MediaBrowser.Model.ApiClient Task ReportCapabilities(ClientCapabilities capabilities, CancellationToken cancellationToken); /// <summary> + /// Logouts this instance. + /// </summary> + /// <returns>Task.</returns> + Task Logout(); + + /// <summary> /// Gets the index of the game players. /// </summary> /// <param name="userId">The user id.</param> diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index d9404ce29..904c7bcdd 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Model.Notifications; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Notifications; using MediaBrowser.Model.Weather; using System; @@ -22,12 +23,6 @@ namespace MediaBrowser.Model.Configuration public WeatherUnits WeatherUnit { get; set; } /// <summary> - /// Gets or sets a value indicating whether [enable HTTP level logging]. - /// </summary> - /// <value><c>true</c> if [enable HTTP level logging]; otherwise, <c>false</c>.</value> - public bool EnableHttpLevelLogging { get; set; } - - /// <summary> /// Gets or sets a value indicating whether [enable u pn p]. /// </summary> /// <value><c>true</c> if [enable u pn p]; otherwise, <c>false</c>.</value> @@ -222,7 +217,6 @@ namespace MediaBrowser.Model.Configuration ImageSavingConvention = ImageSavingConvention.Compatible; HttpServerPortNumber = 8096; LegacyWebSocketPortNumber = 8945; - EnableHttpLevelLogging = true; EnableDashboardResponseCaching = true; EnableAutomaticRestart = true; @@ -261,8 +255,58 @@ namespace MediaBrowser.Model.Configuration MetadataOptions = new[] { new MetadataOptions(1, 1280) {ItemType = "Book"}, - new MetadataOptions(1, 1280) {ItemType = "MusicAlbum"}, - new MetadataOptions(1, 1280) {ItemType = "MusicArtist"}, + + new MetadataOptions(1, 1280) + { + ItemType = "MusicAlbum", + ImageOptions = new [] + { + new ImageOption + { + Limit = 1, + MinWidth = 1280, + Type = ImageType.Backdrop + }, + + // Don't download this by default as it's rarely used. + new ImageOption + { + Limit = 0, + Type = ImageType.Disc + } + } + }, + + new MetadataOptions(1, 1280) + { + ItemType = "MusicArtist", + ImageOptions = new [] + { + new ImageOption + { + Limit = 1, + MinWidth = 1280, + Type = ImageType.Backdrop + }, + + // Don't download this by default + // They do look great, but most artists won't have them, which means a banner view isn't really possible + new ImageOption + { + Limit = 0, + Type = ImageType.Banner + }, + + // Don't download this by default + // Generally not used + new ImageOption + { + Limit = 0, + Type = ImageType.Art + } + } + }, + new MetadataOptions(0, 1280) {ItemType = "Season"} }; diff --git a/MediaBrowser.Model/Configuration/UserConfiguration.cs b/MediaBrowser.Model/Configuration/UserConfiguration.cs index 0834452fb..1afc9a191 100644 --- a/MediaBrowser.Model/Configuration/UserConfiguration.cs +++ b/MediaBrowser.Model/Configuration/UserConfiguration.cs @@ -93,6 +93,7 @@ namespace MediaBrowser.Model.Configuration BlockUnratedItems = new UnratedItem[] { }; ExcludeFoldersFromGrouping = new string[] { }; + DisplayCollectionsView = true; } } } diff --git a/MediaBrowser.Model/Dlna/AudioOptions.cs b/MediaBrowser.Model/Dlna/AudioOptions.cs index d04133a3d..6e630ee55 100644 --- a/MediaBrowser.Model/Dlna/AudioOptions.cs +++ b/MediaBrowser.Model/Dlna/AudioOptions.cs @@ -29,5 +29,11 @@ namespace MediaBrowser.Model.Dlna /// The application's configured quality setting /// </summary> public int? MaxBitrate { get; set; } + + /// <summary> + /// Gets or sets the context. + /// </summary> + /// <value>The context.</value> + public EncodingContext Context { get; set; } } }
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs index deaa30714..4040b57f9 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs @@ -89,6 +89,9 @@ namespace MediaBrowser.Model.Dlna public CodecProfile[] CodecProfiles { get; set; } public ResponseProfile[] ResponseProfiles { get; set; } + public SubtitleProfile[] SoftSubtitleProfiles { get; set; } + public SubtitleProfile[] ExternalSubtitleProfiles { get; set; } + public DeviceProfile() { DirectPlayProfiles = new DirectPlayProfile[] { }; @@ -97,6 +100,9 @@ namespace MediaBrowser.Model.Dlna CodecProfiles = new CodecProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; + SoftSubtitleProfiles = new SubtitleProfile[] { }; + ExternalSubtitleProfiles = new SubtitleProfile[] { }; + XmlRootAttributes = new XmlAttribute[] { }; SupportedMediaTypes = "Audio,Photo,Video"; diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 8aadd428f..57dedf6cf 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -9,6 +9,8 @@ namespace MediaBrowser.Model.Dlna { public class StreamBuilder { + private string[] _serverTextSubtitleOutputs = new string[] { "srt", "vtt" }; + public StreamInfo BuildAudioItem(AudioOptions options) { ValidateAudioInput(options); @@ -48,16 +50,13 @@ namespace MediaBrowser.Model.Dlna List<MediaSourceInfo> mediaSources = options.MediaSources; - // If the client wants a specific media soure, filter now + // If the client wants a specific media source, filter now if (!string.IsNullOrEmpty(options.MediaSourceId)) { - // Avoid implicitly captured closure - string mediaSourceId = options.MediaSourceId; - var newMediaSources = new List<MediaSourceInfo>(); foreach (MediaSourceInfo i in mediaSources) { - if (StringHelper.EqualsIgnoreCase(i.Id, mediaSourceId)) + if (StringHelper.EqualsIgnoreCase(i.Id, options.MediaSourceId)) newMediaSources.Add(i); } @@ -171,7 +170,7 @@ namespace MediaBrowser.Model.Dlna TranscodingProfile transcodingProfile = null; foreach (TranscodingProfile i in options.Profile.TranscodingProfiles) { - if (i.Type == playlistItem.MediaType) + if (i.Type == playlistItem.MediaType && i.Context == options.Context) { transcodingProfile = i; break; @@ -217,12 +216,9 @@ namespace MediaBrowser.Model.Dlna playlistItem.MaxAudioChannels = Math.Min(options.MaxAudioChannels.Value, currentValue); } - // Honor requested max bitrate - if (maxBitrateSetting.HasValue) + if (!playlistItem.AudioBitrate.HasValue) { - int currentValue = playlistItem.AudioBitrate ?? maxBitrateSetting.Value; - - playlistItem.AudioBitrate = Math.Min(maxBitrateSetting.Value, currentValue); + playlistItem.AudioBitrate = 128000; } } @@ -239,12 +235,17 @@ namespace MediaBrowser.Model.Dlna RunTimeTicks = item.RunTimeTicks }; - MediaStream audioStream = item.DefaultAudioStream; + int? audioStreamIndex = options.AudioStreamIndex ?? item.DefaultAudioStreamIndex; + playlistItem.SubtitleStreamIndex = options.SubtitleStreamIndex ?? item.DefaultSubtitleStreamIndex; + + MediaStream audioStream = audioStreamIndex.HasValue ? item.GetMediaStream(MediaStreamType.Audio, audioStreamIndex.Value) : null; + MediaStream subtitleStream = playlistItem.SubtitleStreamIndex.HasValue ? item.GetMediaStream(MediaStreamType.Subtitle, playlistItem.SubtitleStreamIndex.Value) : null; + MediaStream videoStream = item.VideoStream; int? maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate; - if (IsEligibleForDirectPlay(item, options, maxBitrateSetting)) + if (IsEligibleForDirectPlay(item, maxBitrateSetting, subtitleStream, options)) { // See if it can be direct played DirectPlayProfile directPlay = GetVideoDirectPlayProfile(options.Profile, item, videoStream, audioStream); @@ -254,6 +255,11 @@ namespace MediaBrowser.Model.Dlna playlistItem.IsDirectStream = true; playlistItem.Container = item.Container; + if (subtitleStream != null) + { + playlistItem.SubtitleDeliveryMethod = GetDirectStreamSubtitleDeliveryMethod(subtitleStream, options); + } + return playlistItem; } } @@ -262,7 +268,7 @@ namespace MediaBrowser.Model.Dlna TranscodingProfile transcodingProfile = null; foreach (TranscodingProfile i in options.Profile.TranscodingProfiles) { - if (i.Type == playlistItem.MediaType) + if (i.Type == playlistItem.MediaType && i.Context == options.Context) { transcodingProfile = i; break; @@ -271,6 +277,11 @@ namespace MediaBrowser.Model.Dlna if (transcodingProfile != null) { + if (subtitleStream != null) + { + playlistItem.SubtitleDeliveryMethod = GetTranscodedSubtitleDeliveryMethod(subtitleStream, options); + } + playlistItem.IsDirectStream = false; playlistItem.Container = transcodingProfile.Container; playlistItem.EstimateContentLength = transcodingProfile.EstimateContentLength; @@ -278,8 +289,7 @@ namespace MediaBrowser.Model.Dlna playlistItem.AudioCodec = transcodingProfile.AudioCodec.Split(',')[0]; playlistItem.VideoCodec = transcodingProfile.VideoCodec; playlistItem.Protocol = transcodingProfile.Protocol; - playlistItem.AudioStreamIndex = options.AudioStreamIndex ?? item.DefaultAudioStreamIndex; - playlistItem.SubtitleStreamIndex = options.SubtitleStreamIndex ?? item.DefaultSubtitleStreamIndex; + playlistItem.AudioStreamIndex = audioStreamIndex; List<ProfileCondition> videoTranscodingConditions = new List<ProfileCondition>(); foreach (CodecProfile i in options.Profile.CodecProfiles) @@ -317,12 +327,9 @@ namespace MediaBrowser.Model.Dlna playlistItem.MaxAudioChannels = Math.Min(options.MaxAudioChannels.Value, currentValue); } - // Honor requested max bitrate - if (options.MaxAudioTranscodingBitrate.HasValue) + if (!playlistItem.AudioBitrate.HasValue) { - int currentValue = playlistItem.AudioBitrate ?? options.MaxAudioTranscodingBitrate.Value; - - playlistItem.AudioBitrate = Math.Min(options.MaxAudioTranscodingBitrate.Value, currentValue); + playlistItem.AudioBitrate = GetAudioBitrate(playlistItem.TargetAudioChannels, playlistItem.TargetAudioCodec); } // Honor max rate @@ -339,15 +346,22 @@ namespace MediaBrowser.Model.Dlna playlistItem.VideoBitrate = Math.Min(videoBitrate, currentValue); } + } - // Hate to hard-code this, but it's still probably better than being subjected to encoder defaults - if (!playlistItem.VideoBitrate.HasValue) + return playlistItem; + } + + private int GetAudioBitrate(int? channels, string codec) + { + if (channels.HasValue) + { + if (channels.Value >= 5) { - playlistItem.VideoBitrate = 5000000; + return 320000; } } - return playlistItem; + return 128000; } private DirectPlayProfile GetVideoDirectPlayProfile(DeviceProfile profile, @@ -473,16 +487,105 @@ namespace MediaBrowser.Model.Dlna return directPlay; } - private bool IsEligibleForDirectPlay(MediaSourceInfo item, VideoOptions options, int? maxBitrate) + private bool IsEligibleForDirectPlay(MediaSourceInfo item, + int? maxBitrate, + MediaStream subtitleStream, + VideoOptions options) { - if (options.SubtitleStreamIndex.HasValue) + if (subtitleStream != null) { - return false; + if (!subtitleStream.IsTextSubtitleStream) + { + return false; + } + + SubtitleDeliveryMethod subtitleMethod = GetDirectStreamSubtitleDeliveryMethod(subtitleStream, options); + + if (subtitleMethod != SubtitleDeliveryMethod.External && subtitleMethod != SubtitleDeliveryMethod.Direct) + { + return false; + } } return IsAudioEligibleForDirectPlay(item, maxBitrate); } + private SubtitleDeliveryMethod GetDirectStreamSubtitleDeliveryMethod(MediaStream subtitleStream, + VideoOptions options) + { + if (subtitleStream.IsTextSubtitleStream) + { + string subtitleFormat = NormalizeSubtitleFormat(subtitleStream.Codec); + + bool supportsDirect = ContainsSubtitleFormat(options.Profile.SoftSubtitleProfiles, new[] { subtitleFormat }); + + if (supportsDirect) + { + return SubtitleDeliveryMethod.Direct; + } + + // See if the device can retrieve the subtitles externally + bool supportsSubsExternally = options.Context == EncodingContext.Streaming && + ContainsSubtitleFormat(options.Profile.ExternalSubtitleProfiles, _serverTextSubtitleOutputs); + + if (supportsSubsExternally) + { + return SubtitleDeliveryMethod.External; + } + } + + return SubtitleDeliveryMethod.Encode; + } + + private SubtitleDeliveryMethod GetTranscodedSubtitleDeliveryMethod(MediaStream subtitleStream, + VideoOptions options) + { + if (subtitleStream.IsTextSubtitleStream) + { + // See if the device can retrieve the subtitles externally + bool supportsSubsExternally = options.Context == EncodingContext.Streaming && + ContainsSubtitleFormat(options.Profile.ExternalSubtitleProfiles, _serverTextSubtitleOutputs); + + if (supportsSubsExternally) + { + return SubtitleDeliveryMethod.External; + } + + // See if the device can retrieve the subtitles externally + bool supportsEmbedded = ContainsSubtitleFormat(options.Profile.SoftSubtitleProfiles, _serverTextSubtitleOutputs); + + if (supportsEmbedded) + { + return SubtitleDeliveryMethod.Embed; + } + } + + return SubtitleDeliveryMethod.Encode; + } + + private string NormalizeSubtitleFormat(string codec) + { + if (StringHelper.EqualsIgnoreCase(codec, "subrip")) + { + return SubtitleFormat.SRT; + } + + return codec; + } + + private bool ContainsSubtitleFormat(SubtitleProfile[] profiles, string[] formats) + { + foreach (SubtitleProfile profile in profiles) + { + if (ListHelper.ContainsIgnoreCase(formats, profile.Format)) + { + return true; + } + } + + return false; + } + private bool IsAudioEligibleForDirectPlay(MediaSourceInfo item, int? maxBitrate) { // Honor the max bitrate setting diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index e5e013b2a..96aa2167f 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -58,6 +58,8 @@ namespace MediaBrowser.Model.Dlna public MediaSourceInfo MediaSource { get; set; } + public SubtitleDeliveryMethod SubtitleDeliveryMethod { get; set; } + public string MediaSourceId { get @@ -108,7 +110,7 @@ namespace MediaBrowser.Model.Dlna item.VideoCodec ?? string.Empty, item.AudioCodec ?? string.Empty, item.AudioStreamIndex.HasValue ? StringHelper.ToStringCultureInvariant(item.AudioStreamIndex.Value) : string.Empty, - item.SubtitleStreamIndex.HasValue ? StringHelper.ToStringCultureInvariant(item.SubtitleStreamIndex.Value) : string.Empty, + item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External ? StringHelper.ToStringCultureInvariant(item.SubtitleStreamIndex.Value) : string.Empty, item.VideoBitrate.HasValue ? StringHelper.ToStringCultureInvariant(item.VideoBitrate.Value) : string.Empty, item.AudioBitrate.HasValue ? StringHelper.ToStringCultureInvariant(item.AudioBitrate.Value) : string.Empty, item.MaxAudioChannels.HasValue ? StringHelper.ToStringCultureInvariant(item.MaxAudioChannels.Value) : string.Empty, @@ -427,4 +429,24 @@ namespace MediaBrowser.Model.Dlna } } } + + public enum SubtitleDeliveryMethod + { + /// <summary> + /// The encode + /// </summary> + Encode = 0, + /// <summary> + /// Internal format is supported natively + /// </summary> + Direct = 1, + /// <summary> + /// The embed + /// </summary> + Embed = 2, + /// <summary> + /// The external + /// </summary> + External = 3 + } } diff --git a/MediaBrowser.Model/Dlna/SubtitleProfile.cs b/MediaBrowser.Model/Dlna/SubtitleProfile.cs new file mode 100644 index 000000000..ec38d96ae --- /dev/null +++ b/MediaBrowser.Model/Dlna/SubtitleProfile.cs @@ -0,0 +1,8 @@ + +namespace MediaBrowser.Model.Dlna +{ + public class SubtitleProfile + { + public string Format { get; set; } + } +} diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs index 51f4bfe61..976f8e8d1 100644 --- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs +++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs @@ -32,6 +32,9 @@ namespace MediaBrowser.Model.Dlna [XmlAttribute("videoProfile")] public string VideoProfile { get; set; } + [XmlAttribute("context")] + public EncodingContext Context { get; set; } + public List<string> GetAudioCodecs() { List<string> list = new List<string>(); @@ -42,4 +45,10 @@ namespace MediaBrowser.Model.Dlna return list; } } + + public enum EncodingContext + { + Streaming = 0, + Static = 1 + } } diff --git a/MediaBrowser.Model/Dlna/VideoOptions.cs b/MediaBrowser.Model/Dlna/VideoOptions.cs index 39a5ab1b1..041d2cd5d 100644 --- a/MediaBrowser.Model/Dlna/VideoOptions.cs +++ b/MediaBrowser.Model/Dlna/VideoOptions.cs @@ -7,11 +7,5 @@ { 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/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs index cf5518db0..46c51ed8b 100644 --- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs +++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs @@ -103,6 +103,19 @@ namespace MediaBrowser.Model.Dto return null; } } + + public MediaStream GetMediaStream(MediaStreamType type, int index) + { + foreach (MediaStream i in MediaStreams) + { + if (i.Type == type && i.Index == index) + { + return i; + } + } + + return null; + } } public enum MediaSourceType diff --git a/MediaBrowser.Model/Entities/CollectionType.cs b/MediaBrowser.Model/Entities/CollectionType.cs index 1aae2a89c..5a9526d95 100644 --- a/MediaBrowser.Model/Entities/CollectionType.cs +++ b/MediaBrowser.Model/Entities/CollectionType.cs @@ -1,5 +1,4 @@ - -namespace MediaBrowser.Model.Entities +namespace MediaBrowser.Model.Entities { public static class CollectionType { diff --git a/MediaBrowser.Model/Extensions/ListHelper.cs b/MediaBrowser.Model/Extensions/ListHelper.cs index d929866bd..741f07469 100644 --- a/MediaBrowser.Model/Extensions/ListHelper.cs +++ b/MediaBrowser.Model/Extensions/ListHelper.cs @@ -24,5 +24,22 @@ namespace MediaBrowser.Model.Extensions return list.Contains(value, StringComparer.OrdinalIgnoreCase); } + + public static bool ContainsAnyIgnoreCase(string[] list, string[] values) + { + if (values == null) + { + throw new ArgumentNullException("values"); + } + + foreach (string val in values) + { + if (ContainsIgnoreCase(list, val)) + { + return true; + } + } + return false; + } } } diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 4d4ca8e20..a2f2b1318 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -89,6 +89,7 @@ <Compile Include="Configuration\MetadataOptions.cs" /> <Compile Include="Configuration\MetadataPluginSummary.cs" /> <Compile Include="Configuration\MetadataPluginType.cs" /> + <Compile Include="Dlna\SubtitleProfile.cs" /> <Compile Include="Notifications\NotificationOption.cs" /> <Compile Include="Notifications\NotificationOptions.cs" /> <Compile Include="Notifications\NotificationType.cs" /> @@ -295,6 +296,14 @@ <Compile Include="Session\SessionInfoDto.cs" /> <Compile Include="Session\SessionUserInfo.cs" /> <Compile Include="Session\UserDataChangeInfo.cs" /> + <Compile Include="Sync\SyncJob.cs" /> + <Compile Include="Sync\SyncJobQuery.cs" /> + <Compile Include="Sync\SyncJobRequest.cs" /> + <Compile Include="Sync\SyncJobStatus.cs" /> + <Compile Include="Sync\SyncQuality.cs" /> + <Compile Include="Sync\SyncSchedule.cs" /> + <Compile Include="Sync\SyncScheduleQuery.cs" /> + <Compile Include="Sync\SyncScheduleRequest.cs" /> <Compile Include="System\LogFile.cs" /> <Compile Include="Themes\AppTheme.cs" /> <Compile Include="Themes\AppThemeInfo.cs" /> diff --git a/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs b/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs index 30eb50825..7e9cdf53f 100644 --- a/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs +++ b/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs @@ -7,5 +7,6 @@ public const string ASS = "ass"; public const string VTT = "vtt"; public const string SUB = "sub"; + public const string SMI = "smi"; } }
\ No newline at end of file diff --git a/MediaBrowser.Model/Sync/SyncJob.cs b/MediaBrowser.Model/Sync/SyncJob.cs new file mode 100644 index 000000000..09049a196 --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncJob.cs @@ -0,0 +1,47 @@ + +namespace MediaBrowser.Model.Sync +{ + public class SyncJob + { + /// <summary> + /// Gets or sets the identifier. + /// </summary> + /// <value>The identifier.</value> + public string Id { get; set; } + /// <summary> + /// Gets or sets the device identifier. + /// </summary> + /// <value>The device identifier.</value> + public string DeviceId { 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 quality. + /// </summary> + /// <value>The quality.</value> + public SyncQuality Quality { get; set; } + /// <summary> + /// Gets or sets the status. + /// </summary> + /// <value>The status.</value> + public SyncJobStatus Status { get; set; } + /// <summary> + /// Gets or sets the current progress. + /// </summary> + /// <value>The current progress.</value> + public double? CurrentProgress { get; set; } + /// <summary> + /// Gets or sets the synchronize rule identifier. + /// </summary> + /// <value>The synchronize rule identifier.</value> + public string SyncScheduleId { get; set; } + /// <summary> + /// Gets or sets the transcoded path. + /// </summary> + /// <value>The transcoded path.</value> + public string TranscodedPath { get; set; } + } +} diff --git a/MediaBrowser.Model/Sync/SyncJobQuery.cs b/MediaBrowser.Model/Sync/SyncJobQuery.cs new file mode 100644 index 000000000..f41544db9 --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncJobQuery.cs @@ -0,0 +1,7 @@ + +namespace MediaBrowser.Model.Sync +{ + public class SyncJobQuery + { + } +} diff --git a/MediaBrowser.Model/Sync/SyncJobRequest.cs b/MediaBrowser.Model/Sync/SyncJobRequest.cs new file mode 100644 index 000000000..9871f976d --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncJobRequest.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.Sync +{ + public class SyncJobRequest + { + /// <summary> + /// Gets or sets the device identifier. + /// </summary> + /// <value>The device identifier.</value> + public List<string> DeviceIds { 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 quality. + /// </summary> + /// <value>The quality.</value> + public SyncQuality Quality { get; set; } + + public SyncJobRequest() + { + DeviceIds = new List<string>(); + } + } +} diff --git a/MediaBrowser.Model/Sync/SyncJobStatus.cs b/MediaBrowser.Model/Sync/SyncJobStatus.cs new file mode 100644 index 000000000..2a216fe04 --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncJobStatus.cs @@ -0,0 +1,35 @@ + +namespace MediaBrowser.Model.Sync +{ + public enum SyncJobStatus + { + /// <summary> + /// The queued + /// </summary> + Queued = 0, + /// <summary> + /// The transcoding + /// </summary> + Transcoding = 1, + /// <summary> + /// The transcoding failed + /// </summary> + TranscodingFailed = 2, + /// <summary> + /// The transcoding completed + /// </summary> + TranscodingCompleted = 3, + /// <summary> + /// The transfering + /// </summary> + Transfering = 4, + /// <summary> + /// The transfer failed + /// </summary> + TransferFailed = 4, + /// <summary> + /// The completed + /// </summary> + Completed = 6 + } +} diff --git a/MediaBrowser.Model/Sync/SyncQuality.cs b/MediaBrowser.Model/Sync/SyncQuality.cs new file mode 100644 index 000000000..f915e2768 --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncQuality.cs @@ -0,0 +1,21 @@ + +namespace MediaBrowser.Model.Sync +{ + public enum SyncQuality + { + /// <summary> + /// The good + /// </summary> + Good = 0, + + /// <summary> + /// The better + /// </summary> + Better = 1, + + /// <summary> + /// The best + /// </summary> + Best = 2 + } +} diff --git a/MediaBrowser.Model/Sync/SyncSchedule.cs b/MediaBrowser.Model/Sync/SyncSchedule.cs new file mode 100644 index 000000000..297cbd145 --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncSchedule.cs @@ -0,0 +1,12 @@ + +namespace MediaBrowser.Model.Sync +{ + public class SyncSchedule + { + /// <summary> + /// Gets or sets the identifier. + /// </summary> + /// <value>The identifier.</value> + public string Id { get; set; } + } +} diff --git a/MediaBrowser.Model/Sync/SyncScheduleQuery.cs b/MediaBrowser.Model/Sync/SyncScheduleQuery.cs new file mode 100644 index 000000000..b704a358c --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncScheduleQuery.cs @@ -0,0 +1,7 @@ + +namespace MediaBrowser.Model.Sync +{ + public class SyncScheduleQuery + { + } +} diff --git a/MediaBrowser.Model/Sync/SyncScheduleRequest.cs b/MediaBrowser.Model/Sync/SyncScheduleRequest.cs new file mode 100644 index 000000000..e1ba4b115 --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncScheduleRequest.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.Sync +{ + public class SyncScheduleRequest + { + /// <summary> + /// Gets or sets the device identifier. + /// </summary> + /// <value>The device identifier.</value> + public List<string> DeviceIds { get; set; } + /// <summary> + /// Gets or sets the quality. + /// </summary> + /// <value>The quality.</value> + public SyncQuality Quality { get; set; } + + public SyncScheduleRequest() + { + DeviceIds = new List<string>(); + } + } +} |
