From 37c27a26e90b7eff62cec9e2b6a6c003e79fcbe4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 26 Jul 2014 13:30:15 -0400 Subject: added sync job database --- MediaBrowser.Model/Sync/SyncJob.cs | 80 ++++++++++++++++++------ MediaBrowser.Model/Sync/SyncJobCreationResult.cs | 8 +++ MediaBrowser.Model/Sync/SyncJobItem.cs | 48 ++++++++++++++ MediaBrowser.Model/Sync/SyncJobQuery.cs | 10 +++ MediaBrowser.Model/Sync/SyncJobRequest.cs | 32 ++++++++-- MediaBrowser.Model/Sync/SyncJobStatus.cs | 28 +-------- MediaBrowser.Model/Sync/SyncSchedule.cs | 12 ---- MediaBrowser.Model/Sync/SyncScheduleQuery.cs | 7 --- 8 files changed, 158 insertions(+), 67 deletions(-) create mode 100644 MediaBrowser.Model/Sync/SyncJobCreationResult.cs create mode 100644 MediaBrowser.Model/Sync/SyncJobItem.cs delete mode 100644 MediaBrowser.Model/Sync/SyncSchedule.cs delete mode 100644 MediaBrowser.Model/Sync/SyncScheduleQuery.cs (limited to 'MediaBrowser.Model/Sync') diff --git a/MediaBrowser.Model/Sync/SyncJob.cs b/MediaBrowser.Model/Sync/SyncJob.cs index 74dd79497c..f69fccae50 100644 --- a/MediaBrowser.Model/Sync/SyncJob.cs +++ b/MediaBrowser.Model/Sync/SyncJob.cs @@ -1,4 +1,6 @@ - +using System; +using System.Collections.Generic; + namespace MediaBrowser.Model.Sync { public class SyncJob @@ -14,39 +16,79 @@ namespace MediaBrowser.Model.Sync /// The device identifier. public string TargetId { get; set; } /// - /// Gets or sets the item identifier. - /// - /// The item identifier. - public string ItemId { get; set; } - /// /// Gets or sets the quality. /// /// The quality. public SyncQuality Quality { get; set; } /// + /// Gets or sets the current progress. + /// + /// The current progress. + public double? Progress { get; set; } + /// + /// Gets or sets the name. + /// + /// The name. + public string Name { get; set; } + /// /// Gets or sets the status. /// /// The status. - public SyncJobStatus Status { get; set; } + public SyncJobStatus Status { get; set; } /// - /// Gets or sets the current progress. + /// Gets or sets the user identifier. /// - /// The current progress. - public double? CurrentProgress { get; set; } + /// The user identifier. + public string UserId { get; set; } /// - /// Gets or sets the synchronize rule identifier. + /// Gets or sets a value indicating whether [unwatched only]. /// - /// The synchronize rule identifier. - public string SyncScheduleId { get; set; } + /// true if [unwatched only]; otherwise, false. + public bool UnwatchedOnly { get; set; } /// - /// Gets or sets the transcoded path. + /// Gets or sets the limit. /// - /// The transcoded path. - public string TranscodedPath { get; set; } + /// The limit. + public long? Limit { get; set; } /// - /// Gets or sets the name. + /// Gets or sets the type of the limit. /// - /// The name. - public string Name { get; set; } + /// The type of the limit. + public SyncLimitType? LimitType { get; set; } + /// + /// Gets or sets the requested item ids. + /// + /// The requested item ids. + public List RequestedItemIds { get; set; } + /// + /// Gets or sets a value indicating whether this instance is dynamic. + /// + /// true if this instance is dynamic; otherwise, false. + public bool IsDynamic { get; set; } + /// + /// Gets or sets the date created. + /// + /// The date created. + public DateTime DateCreated { get; set; } + /// + /// Gets or sets the date last modified. + /// + /// The date last modified. + public DateTime DateLastModified { get; set; } + /// + /// Gets or sets the item count. + /// + /// The item count. + public int ItemCount { get; set; } + + public string ParentName { get; set; } + public string PrimaryImageItemId { get; set; } + public string PrimaryImageTag { get; set; } + public double? PrimaryImageAspectRatio { get; set; } + + public SyncJob() + { + RequestedItemIds = new List(); + } } } diff --git a/MediaBrowser.Model/Sync/SyncJobCreationResult.cs b/MediaBrowser.Model/Sync/SyncJobCreationResult.cs new file mode 100644 index 0000000000..797318b2a9 --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncJobCreationResult.cs @@ -0,0 +1,8 @@ + +namespace MediaBrowser.Model.Sync +{ + public class SyncJobCreationResult + { + public SyncJob Job { get; set; } + } +} diff --git a/MediaBrowser.Model/Sync/SyncJobItem.cs b/MediaBrowser.Model/Sync/SyncJobItem.cs new file mode 100644 index 0000000000..141546eb5a --- /dev/null +++ b/MediaBrowser.Model/Sync/SyncJobItem.cs @@ -0,0 +1,48 @@ + +namespace MediaBrowser.Model.Sync +{ + public class SyncJobItem + { + /// + /// Gets or sets the identifier. + /// + /// The identifier. + public string Id { get; set; } + + /// + /// Gets or sets the job identifier. + /// + /// The job identifier. + public string JobId { get; set; } + + /// + /// Gets or sets the item identifier. + /// + /// The item identifier. + public string ItemId { get; set; } + + /// + /// Gets or sets the target identifier. + /// + /// The target identifier. + public string TargetId { get; set; } + + /// + /// Gets or sets the output path. + /// + /// The output path. + public string OutputPath { get; set; } + + /// + /// Gets or sets the status. + /// + /// The status. + public SyncJobStatus Status { get; set; } + + /// + /// Gets or sets the current progress. + /// + /// The current progress. + public double? CurrentProgress { get; set; } + } +} diff --git a/MediaBrowser.Model/Sync/SyncJobQuery.cs b/MediaBrowser.Model/Sync/SyncJobQuery.cs index f41544db9a..74b35186e0 100644 --- a/MediaBrowser.Model/Sync/SyncJobQuery.cs +++ b/MediaBrowser.Model/Sync/SyncJobQuery.cs @@ -3,5 +3,15 @@ namespace MediaBrowser.Model.Sync { public class SyncJobQuery { + /// + /// Gets or sets the start index. + /// + /// The start index. + public int? StartIndex { get; set; } + /// + /// Gets or sets the limit. + /// + /// The limit. + public int? Limit { get; set; } } } diff --git a/MediaBrowser.Model/Sync/SyncJobRequest.cs b/MediaBrowser.Model/Sync/SyncJobRequest.cs index cd833068ee..7728aad9bd 100644 --- a/MediaBrowser.Model/Sync/SyncJobRequest.cs +++ b/MediaBrowser.Model/Sync/SyncJobRequest.cs @@ -5,10 +5,10 @@ namespace MediaBrowser.Model.Sync public class SyncJobRequest { /// - /// Gets or sets the device identifier. + /// Gets or sets the target identifier. /// - /// The device identifier. - public List TargetIds { get; set; } + /// The target identifier. + public string TargetId { get; set; } /// /// Gets or sets the item ids. /// @@ -24,11 +24,35 @@ namespace MediaBrowser.Model.Sync /// /// The name. public string Name { get; set; } + /// + /// Gets or sets the user identifier. + /// + /// The user identifier. + public string UserId { get; set; } + /// + /// Gets or sets a value indicating whether [unwatched only]. + /// + /// true if [unwatched only]; otherwise, false. + public bool UnwatchedOnly { get; set; } + /// + /// Gets or sets the limit. + /// + /// The limit. + public long? Limit { get; set; } + /// + /// Gets or sets the type of the limit. + /// + /// The type of the limit. + public SyncLimitType? LimitType { get; set; } public SyncJobRequest() { - TargetIds = new List(); ItemIds = new List(); } } + + public enum SyncLimitType + { + ItemCount = 0 + } } diff --git a/MediaBrowser.Model/Sync/SyncJobStatus.cs b/MediaBrowser.Model/Sync/SyncJobStatus.cs index 2a216fe044..ef4d8d7bfc 100644 --- a/MediaBrowser.Model/Sync/SyncJobStatus.cs +++ b/MediaBrowser.Model/Sync/SyncJobStatus.cs @@ -3,33 +3,11 @@ namespace MediaBrowser.Model.Sync { public enum SyncJobStatus { - /// - /// The queued - /// Queued = 0, - /// - /// The transcoding - /// Transcoding = 1, - /// - /// The transcoding failed - /// TranscodingFailed = 2, - /// - /// The transcoding completed - /// - TranscodingCompleted = 3, - /// - /// The transfering - /// - Transfering = 4, - /// - /// The transfer failed - /// - TransferFailed = 4, - /// - /// The completed - /// - Completed = 6 + Transfering = 3, + Completed = 4, + Cancelled = 5 } } diff --git a/MediaBrowser.Model/Sync/SyncSchedule.cs b/MediaBrowser.Model/Sync/SyncSchedule.cs deleted file mode 100644 index 297cbd1450..0000000000 --- a/MediaBrowser.Model/Sync/SyncSchedule.cs +++ /dev/null @@ -1,12 +0,0 @@ - -namespace MediaBrowser.Model.Sync -{ - public class SyncSchedule - { - /// - /// Gets or sets the identifier. - /// - /// The identifier. - public string Id { get; set; } - } -} diff --git a/MediaBrowser.Model/Sync/SyncScheduleQuery.cs b/MediaBrowser.Model/Sync/SyncScheduleQuery.cs deleted file mode 100644 index b704a358ca..0000000000 --- a/MediaBrowser.Model/Sync/SyncScheduleQuery.cs +++ /dev/null @@ -1,7 +0,0 @@ - -namespace MediaBrowser.Model.Sync -{ - public class SyncScheduleQuery - { - } -} -- cgit v1.2.3