The Free Software Media System - Server Backend & API
sync updates
Luke Pulverenti2485b5c22df6
diff --git a/MediaBrowser.Controller/Sync/ISyncManager.cs b/MediaBrowser.Controller/Sync/ISyncManager.csindex 69548ea3bb..c51c8c1ba9 100644--- a/MediaBrowser.Controller/Sync/ISyncManager.cs+++ b/MediaBrowser.Controller/Sync/ISyncManager.cs@@ -172,6 +172,6 @@ namespace MediaBrowser.Controller.Sync/// </summary>/// <param name="targetId">The target identifier.</param>/// <returns>IEnumerable<SyncQualityOption>.</returns>- IEnumerable<SyncQualityOption> GetProfileOptions(string targetId);+ IEnumerable<SyncProfileOption> GetProfileOptions(string targetId);}}diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csprojindex 74f927c7e2..f60f227d7f 100644--- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj+++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj@@ -1133,8 +1133,8 @@<Compile Include="..\MediaBrowser.Model\Sync\SyncParameter.cs"><Link>Sync\SyncParameter.cs</Link></Compile>- <Compile Include="..\MediaBrowser.Model\Sync\SyncQuality.cs">- <Link>Sync\SyncQuality.cs</Link>+ <Compile Include="..\MediaBrowser.Model\Sync\SyncProfileOption.cs">+ <Link>Sync\SyncProfileOption.cs</Link></Compile><Compile Include="..\MediaBrowser.Model\Sync\SyncQualityOption.cs"><Link>Sync\SyncQualityOption.cs</Link>diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csprojindex a732494d1a..1685d5f7b7 100644--- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj+++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj@@ -1092,8 +1092,8 @@<Compile Include="..\MediaBrowser.Model\Sync\SyncParameter.cs"><Link>Sync\SyncParameter.cs</Link></Compile>- <Compile Include="..\MediaBrowser.Model\Sync\SyncQuality.cs">- <Link>Sync\SyncQuality.cs</Link>+ <Compile Include="..\MediaBrowser.Model\Sync\SyncProfileOption.cs">+ <Link>Sync\SyncProfileOption.cs</Link></Compile><Compile Include="..\MediaBrowser.Model\Sync\SyncQualityOption.cs"><Link>Sync\SyncQualityOption.cs</Link>diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csprojindex 9d4192b17d..c546958aa5 100644--- a/MediaBrowser.Model/MediaBrowser.Model.csproj+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj@@ -398,7 +398,7 @@<Compile Include="Sync\SyncJobStatus.cs" /><Compile Include="Sync\SyncOptions.cs" /><Compile Include="Sync\SyncParameter.cs" />- <Compile Include="Sync\SyncQuality.cs" />+ <Compile Include="Sync\SyncProfileOption.cs" /><Compile Include="Sync\SyncQualityOption.cs" /><Compile Include="Sync\SyncTarget.cs" /><Compile Include="System\LogFile.cs" />diff --git a/MediaBrowser.Model/Sync/SyncDialogOptions.cs b/MediaBrowser.Model/Sync/SyncDialogOptions.csindex 2b8672d76e..a987a6cd69 100644--- a/MediaBrowser.Model/Sync/SyncDialogOptions.cs+++ b/MediaBrowser.Model/Sync/SyncDialogOptions.cs@@ -23,14 +23,14 @@ namespace MediaBrowser.Model.Sync/// Gets or sets the profile options./// </summary>/// <value>The profile options.</value>- public List<SyncQualityOption> ProfileOptions { get; set; }+ public List<SyncProfileOption> ProfileOptions { get; set; }public SyncDialogOptions(){Targets = new List<SyncTarget>();Options = new List<SyncJobOption>();QualityOptions = new List<SyncQualityOption>();- ProfileOptions = new List<SyncQualityOption>();+ ProfileOptions = new List<SyncProfileOption>();}}}diff --git a/MediaBrowser.Model/Sync/SyncJobRequest.cs b/MediaBrowser.Model/Sync/SyncJobRequest.csindex 2af4283839..8f9d9520c3 100644--- a/MediaBrowser.Model/Sync/SyncJobRequest.cs+++ b/MediaBrowser.Model/Sync/SyncJobRequest.cs@@ -30,6 +30,11 @@ namespace MediaBrowser.Model.Sync/// <value>The quality.</value>public string Quality { get; set; }/// <summary>+ /// Gets or sets the profile.+ /// </summary>+ /// <value>The profile.</value>+ public string Profile { get; set; }+ /// <summary>/// Gets or sets the name./// </summary>/// <value>The name.</value>diff --git a/MediaBrowser.Model/Sync/SyncProfileOption.cs b/MediaBrowser.Model/Sync/SyncProfileOption.csnew file mode 100644index 0000000000..605af6b25c--- /dev/null+++ b/MediaBrowser.Model/Sync/SyncProfileOption.cs@@ -0,0 +1,37 @@++namespace MediaBrowser.Model.Sync+{+ public class SyncProfileOption+ {+ /// <summary>+ /// Gets or sets the name.+ /// </summary>+ /// <value>The name.</value>+ public string Name { get; set; }+ /// <summary>+ /// Gets or sets the description.+ /// </summary>+ /// <value>The description.</value>+ public string Description { get; set; }+ /// <summary>+ /// Gets or sets the identifier.+ /// </summary>+ /// <value>The identifier.</value>+ public string Id { get; set; }+ /// <summary>+ /// Gets or sets a value indicating whether this instance is default.+ /// </summary>+ /// <value><c>true</c> if this instance is default; otherwise, <c>false</c>.</value>+ public bool IsDefault { get; set; }+ /// <summary>+ /// Gets or sets a value indicating whether [enable quality options].+ /// </summary>+ /// <value><c>true</c> if [enable quality options]; otherwise, <c>false</c>.</value>+ public bool EnableQualityOptions { get; set; }++ public SyncProfileOption()+ {+ EnableQualityOptions = true;+ }+ }+}diff --git a/MediaBrowser.Model/Sync/SyncQuality.cs b/MediaBrowser.Model/Sync/SyncQuality.csdeleted file mode 100644index 27ee756a32..0000000000--- a/MediaBrowser.Model/Sync/SyncQuality.cs+++ /dev/null@@ -1,25 +0,0 @@--namespace MediaBrowser.Model.Sync-{- public enum SyncQuality- {- /// <summary>- /// The good- /// </summary>- Low = 0,-- /// <summary>- /// The better- /// </summary>- Medium = 1,-- /// <summary>- /// The best- /// </summary>- High = 2,- /// <summary>- /// The original- /// </summary>- Original = 3- }-}diff --git a/MediaBrowser.Model/Sync/SyncQualityOption.cs b/MediaBrowser.Model/Sync/SyncQualityOption.csindex 1945613c06..597b987270 100644--- a/MediaBrowser.Model/Sync/SyncQualityOption.cs+++ b/MediaBrowser.Model/Sync/SyncQualityOption.cs@@ -9,6 +9,11 @@ namespace MediaBrowser.Model.Sync/// <value>The name.</value>public string Name { get; set; }/// <summary>+ /// Gets or sets the description.+ /// </summary>+ /// <value>The description.</value>+ public string Description { get; set; }+ /// <summary>/// Gets or sets the identifier./// </summary>/// <value>The identifier.</value>diff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/MediaBrowser.Server.Implementations/Library/UserManager.csindex 6e6e23a5ae..b101f6ae1a 100644--- a/MediaBrowser.Server.Implementations/Library/UserManager.cs+++ b/MediaBrowser.Server.Implementations/Library/UserManager.cs@@ -1,5 +1,4 @@-using System.Net.NetworkInformation;-using MediaBrowser.Common.Events;+using MediaBrowser.Common.Events;using MediaBrowser.Common.Extensions;using MediaBrowser.Common.IO;using MediaBrowser.Common.Net;@@ -849,6 +848,12 @@ namespace MediaBrowser.Server.Implementations.Libraryforeach (var user in users){await ResetPassword(user).ConfigureAwait(false);++ if (user.Policy.IsDisabled)+ {+ user.Policy.IsDisabled = false;+ await UpdateUserPolicy(user, user.Policy, true).ConfigureAwait(false);+ }usersReset.Add(user.Name);}}diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.jsonindex 1aa18e6c82..d3693840a2 100644--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json@@ -117,7 +117,6 @@"HeaderSelectSubtitles": "Select Subtitles","ButtonMarkForRemoval": "Remove from device","ButtonUnmarkForRemoval": "Cancel removal from device",- "LabelSyncQualityHelp": "Select the desired quality. Original quality will sync the original file, regardless of whether the device is capable of playing it or not.","LabelDefaultStream": "(Default)","LabelForcedStream": "(Forced)","LabelDefaultForcedStream": "(Default/Forced)",@@ -731,10 +730,6 @@"LabelSyncTo": "Sync to:","LabelSyncJobName": "Sync job name:","LabelQuality": "Quality:",- "OptionOriginal": "Original",- "OptionHigh": "High",- "OptionMedium": "Medium",- "OptionLow": "Low","HeaderSettings": "Settings","OptionAutomaticallySyncNewContent": "Automatically sync new content","OptionAutomaticallySyncNewContentHelp": "New content added to this category will be automatically synced to the device.",@@ -751,5 +746,7 @@"SyncJobItemStatusSynced": "Synced","SyncJobItemStatusFailed": "Failed","SyncJobItemStatusRemovedFromDevice": "Removed from device",- "SyncJobItemStatusCancelled": "Cancelled"+ "SyncJobItemStatusCancelled": "Cancelled",+ "LabelProfile": "Profile:",+ "LabelBitrateMbps": "Bitrate (Mbps):"}diff --git a/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs b/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.csindex e4361ed1a5..ff43816b0f 100644--- a/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs+++ b/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs@@ -80,31 +80,32 @@ namespace MediaBrowser.Server.Implementations.Sync{new SyncQualityOption{- Name = SyncQuality.Original.ToString(),- Id = SyncQuality.Original.ToString()+ Name = "Original",+ Id = "original",+ Description = "Syncs original files as-is, regardless of whether the device is capable of playing them or not."},new SyncQualityOption{- Name = SyncQuality.High.ToString(),- Id = SyncQuality.High.ToString(),+ Name = "High",+ Id = "high",IsDefault = true},new SyncQualityOption{- Name = SyncQuality.Medium.ToString(),- Id = SyncQuality.Medium.ToString()+ Name = "Medium",+ Id = "medium"},new SyncQualityOption{- Name = SyncQuality.Low.ToString(),- Id = SyncQuality.Low.ToString()+ Name = "Low",+ Id = "low"}};}- public IEnumerable<SyncQualityOption> GetProfileOptions(SyncTarget target)+ public IEnumerable<SyncProfileOption> GetProfileOptions(SyncTarget target){- return new List<SyncQualityOption>();+ return new List<SyncProfileOption>();}}}diff --git a/MediaBrowser.Server.Implementations/Sync/IHasSyncQuality.cs b/MediaBrowser.Server.Implementations/Sync/IHasSyncQuality.csindex cefce4d179..06ff3f9aa6 100644--- a/MediaBrowser.Server.Implementations/Sync/IHasSyncQuality.cs+++ b/MediaBrowser.Server.Implementations/Sync/IHasSyncQuality.cs@@ -27,6 +27,6 @@ namespace MediaBrowser.Server.Implementations.Sync/// </summary>/// <param name="target">The target.</param>/// <returns>IEnumerable<SyncQualityOption>.</returns>- IEnumerable<SyncQualityOption> GetProfileOptions(SyncTarget target);+ IEnumerable<SyncProfileOption> GetProfileOptions(SyncTarget target);}}diff --git a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs b/MediaBrowser.Server.Implementations/Sync/SyncManager.csindex b75f6e7618..e8331e87e8 100644--- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs+++ b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs@@ -159,7 +159,8 @@ namespace MediaBrowser.Server.Implementations.SyncItemCount = items.Count,Category = request.Category,ParentId = request.ParentId,- Quality = request.Quality+ Quality = request.Quality,+ Profile = request.Profile};if (!request.Category.HasValue && request.ItemIds != null)@@ -1079,29 +1080,29 @@ namespace MediaBrowser.Server.Implementations.Sync{new SyncQualityOption{- Name = SyncQuality.Original.ToString(),- Id = SyncQuality.Original.ToString()+ Name = "High",+ Id = "high",+ IsDefault = true},new SyncQualityOption{- Name = SyncQuality.High.ToString(),- Id = SyncQuality.High.ToString(),- IsDefault = true+ Name = "Medium",+ Id = "medium"},new SyncQualityOption{- Name = SyncQuality.Medium.ToString(),- Id = SyncQuality.Medium.ToString()+ Name = "Low",+ Id = "low"},new SyncQualityOption{- Name = SyncQuality.Low.ToString(),- Id = SyncQuality.Low.ToString()+ Name = "Custom",+ Id = "custom"}};}- public IEnumerable<SyncQualityOption> GetProfileOptions(string targetId)+ public IEnumerable<SyncProfileOption> GetProfileOptions(string targetId){foreach (var provider in _providers){@@ -1114,10 +1115,10 @@ namespace MediaBrowser.Server.Implementations.Sync}}- return new List<SyncQualityOption>();+ return new List<SyncProfileOption>();}- private IEnumerable<SyncQualityOption> GetProfileOptions(ISyncProvider provider, SyncTarget target)+ private IEnumerable<SyncProfileOption> GetProfileOptions(ISyncProvider provider, SyncTarget target){var hasQuality = provider as IHasSyncQuality;if (hasQuality != null)@@ -1125,12 +1126,29 @@ namespace MediaBrowser.Server.Implementations.Syncreturn hasQuality.GetProfileOptions(target);}- var list = new List<SyncQualityOption>();+ var list = new List<SyncProfileOption>();++ list.Add(new SyncProfileOption+ {+ Name = "Original",+ Id = "Original",+ Description = "Syncs original files as-is.",+ EnableQualityOptions = false+ });++ list.Add(new SyncProfileOption+ {+ Name = "Web - H264/AAC, MP3",+ Id = "mobile",+ Description = "Designed for compatibility with all devices, including web browsers."+ });- list.Add(new SyncQualityOption+ list.Add(new SyncProfileOption{- Name = SyncQuality.Low.ToString(),- Id = SyncQuality.Low.ToString()+ Name = "General - H264/AAC/AC3, MP3",+ Id = "general",+ Description = "Designed for compatibility with Chromecast, Roku, Smart TV's, and other similar devices.",+ IsDefault = true});return list;