aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-12-16 00:01:57 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-12-16 00:01:57 -0500
commit3c48def0d76417572193cd306846f1516e0e9038 (patch)
tree8570bb756e024eaca9f2d5b8008e43279aa9fb23 /MediaBrowser.Model
parent7f7d2f85e324bc9e2c6b170c89af0541601e8cad (diff)
sync updates
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/ApiClient/ConnectionOptions.cs23
-rw-r--r--MediaBrowser.Model/ApiClient/IConnectionManager.cs9
-rw-r--r--MediaBrowser.Model/Dto/UserDto.cs12
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj2
-rw-r--r--MediaBrowser.Model/Sync/SyncCategory.cs19
-rw-r--r--MediaBrowser.Model/Sync/SyncHelper.cs13
-rw-r--r--MediaBrowser.Model/Sync/SyncJob.cs10
-rw-r--r--MediaBrowser.Model/Sync/SyncJobRequest.cs10
-rw-r--r--MediaBrowser.Model/Sync/SyncOptions.cs3
-rw-r--r--MediaBrowser.Model/Users/UserPolicy.cs7
10 files changed, 102 insertions, 6 deletions
diff --git a/MediaBrowser.Model/ApiClient/ConnectionOptions.cs b/MediaBrowser.Model/ApiClient/ConnectionOptions.cs
new file mode 100644
index 0000000000..445eaa04ef
--- /dev/null
+++ b/MediaBrowser.Model/ApiClient/ConnectionOptions.cs
@@ -0,0 +1,23 @@
+
+namespace MediaBrowser.Model.ApiClient
+{
+ public class ConnectionOptions
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether [enable web socket].
+ /// </summary>
+ /// <value><c>true</c> if [enable web socket]; otherwise, <c>false</c>.</value>
+ public bool EnableWebSocket { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether [report capabilities].
+ /// </summary>
+ /// <value><c>true</c> if [report capabilities]; otherwise, <c>false</c>.</value>
+ public bool ReportCapabilities { get; set; }
+
+ public ConnectionOptions()
+ {
+ EnableWebSocket = true;
+ ReportCapabilities = true;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/ApiClient/IConnectionManager.cs b/MediaBrowser.Model/ApiClient/IConnectionManager.cs
index 3b88366e8b..a54c330acd 100644
--- a/MediaBrowser.Model/ApiClient/IConnectionManager.cs
+++ b/MediaBrowser.Model/ApiClient/IConnectionManager.cs
@@ -80,6 +80,15 @@ namespace MediaBrowser.Model.ApiClient
/// <summary>
/// Connects the specified server.
/// </summary>
+ /// <param name="server">The server.</param>
+ /// <param name="options">The options.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task&lt;ConnectionResult&gt;.</returns>
+ Task<ConnectionResult> Connect(ServerInfo server, ConnectionOptions options, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Connects the specified server.
+ /// </summary>
/// <param name="address">The address.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;ConnectionResult&gt;.</returns>
diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs
index 793a7efd2d..9b6d920306 100644
--- a/MediaBrowser.Model/Dto/UserDto.cs
+++ b/MediaBrowser.Model/Dto/UserDto.cs
@@ -1,6 +1,7 @@
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Extensions;
+using MediaBrowser.Model.Users;
using System;
using System.ComponentModel;
using System.Diagnostics;
@@ -60,6 +61,10 @@ namespace MediaBrowser.Model.Dto
/// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
public bool HasPassword { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance has configured password.
+ /// </summary>
+ /// <value><c>true</c> if this instance has configured password; otherwise, <c>false</c>.</value>
public bool HasConfiguredPassword { get; set; }
/// <summary>
@@ -81,6 +86,12 @@ namespace MediaBrowser.Model.Dto
public UserConfiguration Configuration { get; set; }
/// <summary>
+ /// Gets or sets the policy.
+ /// </summary>
+ /// <value>The policy.</value>
+ public UserPolicy Policy { get; set; }
+
+ /// <summary>
/// Gets or sets the primary image aspect ratio.
/// </summary>
/// <value>The primary image aspect ratio.</value>
@@ -108,6 +119,7 @@ namespace MediaBrowser.Model.Dto
public UserDto()
{
Configuration = new UserConfiguration();
+ Policy = new UserPolicy();
}
/// <summary>
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index f537508974..fbf45e0aee 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -104,6 +104,7 @@
<Compile Include="Connect\ConnectAuthenticationResult.cs" />
<Compile Include="Connect\ConnectAuthorization.cs" />
<Compile Include="Connect\ConnectAuthorizationRequest.cs" />
+ <Compile Include="ApiClient\ConnectionOptions.cs" />
<Compile Include="Connect\ConnectPassword.cs" />
<Compile Include="Connect\ConnectUser.cs" />
<Compile Include="Connect\ConnectUserQuery.cs" />
@@ -362,6 +363,7 @@
<Compile Include="Session\TranscodingInfo.cs" />
<Compile Include="Session\UserDataChangeInfo.cs" />
<Compile Include="Devices\ContentUploadHistory.cs" />
+ <Compile Include="Sync\SyncCategory.cs" />
<Compile Include="Sync\SyncHelper.cs" />
<Compile Include="Sync\SyncJob.cs" />
<Compile Include="Sync\SyncJobCreationResult.cs" />
diff --git a/MediaBrowser.Model/Sync/SyncCategory.cs b/MediaBrowser.Model/Sync/SyncCategory.cs
new file mode 100644
index 0000000000..e0d7486853
--- /dev/null
+++ b/MediaBrowser.Model/Sync/SyncCategory.cs
@@ -0,0 +1,19 @@
+
+namespace MediaBrowser.Model.Sync
+{
+ public enum SyncCategory
+ {
+ /// <summary>
+ /// The latest
+ /// </summary>
+ Latest = 0,
+ /// <summary>
+ /// The next up
+ /// </summary>
+ NextUp = 1,
+ /// <summary>
+ /// The resume
+ /// </summary>
+ Resume = 2
+ }
+}
diff --git a/MediaBrowser.Model/Sync/SyncHelper.cs b/MediaBrowser.Model/Sync/SyncHelper.cs
index ac595b5efc..64dc024e13 100644
--- a/MediaBrowser.Model/Sync/SyncHelper.cs
+++ b/MediaBrowser.Model/Sync/SyncHelper.cs
@@ -40,6 +40,7 @@ namespace MediaBrowser.Model.Sync
if (item.IsFolder || item.IsGameGenre || item.IsMusicGenre || item.IsGenre || item.IsArtist || item.IsStudio || item.IsPerson)
{
options.Add(SyncOptions.SyncNewContent);
+ options.Add(SyncOptions.ItemLimit);
break;
}
}
@@ -47,5 +48,17 @@ namespace MediaBrowser.Model.Sync
return options;
}
+
+ public static List<SyncOptions> GetSyncOptions(SyncCategory category)
+ {
+ List<SyncOptions> options = new List<SyncOptions>();
+
+ options.Add(SyncOptions.Quality);
+ options.Add(SyncOptions.UnwatchedOnly);
+ options.Add(SyncOptions.SyncNewContent);
+ options.Add(SyncOptions.ItemLimit);
+
+ return options;
+ }
}
}
diff --git a/MediaBrowser.Model/Sync/SyncJob.cs b/MediaBrowser.Model/Sync/SyncJob.cs
index 491223db51..92662d7bbf 100644
--- a/MediaBrowser.Model/Sync/SyncJob.cs
+++ b/MediaBrowser.Model/Sync/SyncJob.cs
@@ -21,6 +21,16 @@ namespace MediaBrowser.Model.Sync
/// <value>The quality.</value>
public SyncQuality Quality { get; set; }
/// <summary>
+ /// Gets or sets the category.
+ /// </summary>
+ /// <value>The category.</value>
+ public SyncCategory? Category { 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 current progress.
/// </summary>
/// <value>The current progress.</value>
diff --git a/MediaBrowser.Model/Sync/SyncJobRequest.cs b/MediaBrowser.Model/Sync/SyncJobRequest.cs
index 42a40acc73..7d3016d0ef 100644
--- a/MediaBrowser.Model/Sync/SyncJobRequest.cs
+++ b/MediaBrowser.Model/Sync/SyncJobRequest.cs
@@ -15,6 +15,16 @@ namespace MediaBrowser.Model.Sync
/// <value>The item ids.</value>
public List<string> ItemIds { get; set; }
/// <summary>
+ /// Gets or sets the category.
+ /// </summary>
+ /// <value>The category.</value>
+ public SyncCategory? Category { 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 quality.
/// </summary>
/// <value>The quality.</value>
diff --git a/MediaBrowser.Model/Sync/SyncOptions.cs b/MediaBrowser.Model/Sync/SyncOptions.cs
index edf22f7999..d4a7461f3a 100644
--- a/MediaBrowser.Model/Sync/SyncOptions.cs
+++ b/MediaBrowser.Model/Sync/SyncOptions.cs
@@ -6,6 +6,7 @@ namespace MediaBrowser.Model.Sync
Name = 0,
Quality = 1,
UnwatchedOnly = 2,
- SyncNewContent
+ SyncNewContent = 3,
+ ItemLimit = 4
}
}
diff --git a/MediaBrowser.Model/Users/UserPolicy.cs b/MediaBrowser.Model/Users/UserPolicy.cs
index 02d1777472..b458e28546 100644
--- a/MediaBrowser.Model/Users/UserPolicy.cs
+++ b/MediaBrowser.Model/Users/UserPolicy.cs
@@ -1,11 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
+
namespace MediaBrowser.Model.Users
{
public class UserPolicy
{
+ public bool EnableSync { get; set; }
}
}