diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-15 00:17:35 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-15 00:17:35 -0400 |
| commit | 2485b5c22df66f81bc58a4b18c90da6b38c835f9 (patch) | |
| tree | 28f2e1b667b40a7e6069cf8a3ed94aeac365aedb | |
| parent | 5812a989c2c5e55930eb39c18229cbe7d0452a6d (diff) | |
sync updates
14 files changed, 112 insertions, 69 deletions
diff --git a/MediaBrowser.Controller/Sync/ISyncManager.cs b/MediaBrowser.Controller/Sync/ISyncManager.cs index 69548ea3b..c51c8c1ba 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.csproj index 74f927c7e..f60f227d7 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.csproj index a732494d1..1685d5f7b 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.csproj index 9d4192b17..c546958aa 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.cs index 2b8672d76..a987a6cd6 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.cs index 2af428383..8f9d9520c 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.cs new file mode 100644 index 000000000..605af6b25 --- /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.cs deleted file mode 100644 index 27ee756a3..000000000 --- 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.cs index 1945613c0..597b98727 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.cs index 6e6e23a5a..b101f6ae1 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.Library foreach (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.json index 1aa18e6c8..d3693840a 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.cs index e4361ed1a..ff43816b0 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.cs index cefce4d17..06ff3f9aa 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.cs index b75f6e761..e8331e87e 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs +++ b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs @@ -159,7 +159,8 @@ namespace MediaBrowser.Server.Implementations.Sync ItemCount = 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.Sync return 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; |
