sync updates

pull/702/head
Luke Pulverenti 10 years ago
parent 5812a989c2
commit 2485b5c22d

@ -172,6 +172,6 @@ namespace MediaBrowser.Controller.Sync
/// </summary> /// </summary>
/// <param name="targetId">The target identifier.</param> /// <param name="targetId">The target identifier.</param>
/// <returns>IEnumerable&lt;SyncQualityOption&gt;.</returns> /// <returns>IEnumerable&lt;SyncQualityOption&gt;.</returns>
IEnumerable<SyncQualityOption> GetProfileOptions(string targetId); IEnumerable<SyncProfileOption> GetProfileOptions(string targetId);
} }
} }

@ -1133,8 +1133,8 @@
<Compile Include="..\MediaBrowser.Model\Sync\SyncParameter.cs"> <Compile Include="..\MediaBrowser.Model\Sync\SyncParameter.cs">
<Link>Sync\SyncParameter.cs</Link> <Link>Sync\SyncParameter.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncQuality.cs"> <Compile Include="..\MediaBrowser.Model\Sync\SyncProfileOption.cs">
<Link>Sync\SyncQuality.cs</Link> <Link>Sync\SyncProfileOption.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncQualityOption.cs"> <Compile Include="..\MediaBrowser.Model\Sync\SyncQualityOption.cs">
<Link>Sync\SyncQualityOption.cs</Link> <Link>Sync\SyncQualityOption.cs</Link>

@ -1092,8 +1092,8 @@
<Compile Include="..\MediaBrowser.Model\Sync\SyncParameter.cs"> <Compile Include="..\MediaBrowser.Model\Sync\SyncParameter.cs">
<Link>Sync\SyncParameter.cs</Link> <Link>Sync\SyncParameter.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncQuality.cs"> <Compile Include="..\MediaBrowser.Model\Sync\SyncProfileOption.cs">
<Link>Sync\SyncQuality.cs</Link> <Link>Sync\SyncProfileOption.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncQualityOption.cs"> <Compile Include="..\MediaBrowser.Model\Sync\SyncQualityOption.cs">
<Link>Sync\SyncQualityOption.cs</Link> <Link>Sync\SyncQualityOption.cs</Link>

@ -398,7 +398,7 @@
<Compile Include="Sync\SyncJobStatus.cs" /> <Compile Include="Sync\SyncJobStatus.cs" />
<Compile Include="Sync\SyncOptions.cs" /> <Compile Include="Sync\SyncOptions.cs" />
<Compile Include="Sync\SyncParameter.cs" /> <Compile Include="Sync\SyncParameter.cs" />
<Compile Include="Sync\SyncQuality.cs" /> <Compile Include="Sync\SyncProfileOption.cs" />
<Compile Include="Sync\SyncQualityOption.cs" /> <Compile Include="Sync\SyncQualityOption.cs" />
<Compile Include="Sync\SyncTarget.cs" /> <Compile Include="Sync\SyncTarget.cs" />
<Compile Include="System\LogFile.cs" /> <Compile Include="System\LogFile.cs" />

@ -23,14 +23,14 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the profile options. /// Gets or sets the profile options.
/// </summary> /// </summary>
/// <value>The profile options.</value> /// <value>The profile options.</value>
public List<SyncQualityOption> ProfileOptions { get; set; } public List<SyncProfileOption> ProfileOptions { get; set; }
public SyncDialogOptions() public SyncDialogOptions()
{ {
Targets = new List<SyncTarget>(); Targets = new List<SyncTarget>();
Options = new List<SyncJobOption>(); Options = new List<SyncJobOption>();
QualityOptions = new List<SyncQualityOption>(); QualityOptions = new List<SyncQualityOption>();
ProfileOptions = new List<SyncQualityOption>(); ProfileOptions = new List<SyncProfileOption>();
} }
} }
} }

@ -30,6 +30,11 @@ namespace MediaBrowser.Model.Sync
/// <value>The quality.</value> /// <value>The quality.</value>
public string Quality { get; set; } public string Quality { get; set; }
/// <summary> /// <summary>
/// Gets or sets the profile.
/// </summary>
/// <value>The profile.</value>
public string Profile { get; set; }
/// <summary>
/// Gets or sets the name. /// Gets or sets the name.
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>

@ -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;
}
}
}

@ -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
}
}

@ -9,6 +9,11 @@ namespace MediaBrowser.Model.Sync
/// <value>The name.</value> /// <value>The name.</value>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>The description.</value>
public string Description { get; set; }
/// <summary>
/// Gets or sets the identifier. /// Gets or sets the identifier.
/// </summary> /// </summary>
/// <value>The identifier.</value> /// <value>The identifier.</value>

@ -1,5 +1,4 @@
using System.Net.NetworkInformation; using MediaBrowser.Common.Events;
using MediaBrowser.Common.Events;
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO; using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
@ -849,6 +848,12 @@ namespace MediaBrowser.Server.Implementations.Library
foreach (var user in users) foreach (var user in users)
{ {
await ResetPassword(user).ConfigureAwait(false); 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); usersReset.Add(user.Name);
} }
} }

@ -117,7 +117,6 @@
"HeaderSelectSubtitles": "Select Subtitles", "HeaderSelectSubtitles": "Select Subtitles",
"ButtonMarkForRemoval": "Remove from device", "ButtonMarkForRemoval": "Remove from device",
"ButtonUnmarkForRemoval": "Cancel removal 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)", "LabelDefaultStream": "(Default)",
"LabelForcedStream": "(Forced)", "LabelForcedStream": "(Forced)",
"LabelDefaultForcedStream": "(Default/Forced)", "LabelDefaultForcedStream": "(Default/Forced)",
@ -731,10 +730,6 @@
"LabelSyncTo": "Sync to:", "LabelSyncTo": "Sync to:",
"LabelSyncJobName": "Sync job name:", "LabelSyncJobName": "Sync job name:",
"LabelQuality": "Quality:", "LabelQuality": "Quality:",
"OptionOriginal": "Original",
"OptionHigh": "High",
"OptionMedium": "Medium",
"OptionLow": "Low",
"HeaderSettings": "Settings", "HeaderSettings": "Settings",
"OptionAutomaticallySyncNewContent": "Automatically sync new content", "OptionAutomaticallySyncNewContent": "Automatically sync new content",
"OptionAutomaticallySyncNewContentHelp": "New content added to this category will be automatically synced to the device.", "OptionAutomaticallySyncNewContentHelp": "New content added to this category will be automatically synced to the device.",
@ -751,5 +746,7 @@
"SyncJobItemStatusSynced": "Synced", "SyncJobItemStatusSynced": "Synced",
"SyncJobItemStatusFailed": "Failed", "SyncJobItemStatusFailed": "Failed",
"SyncJobItemStatusRemovedFromDevice": "Removed from device", "SyncJobItemStatusRemovedFromDevice": "Removed from device",
"SyncJobItemStatusCancelled": "Cancelled" "SyncJobItemStatusCancelled": "Cancelled",
"LabelProfile": "Profile:",
"LabelBitrateMbps": "Bitrate (Mbps):"
} }

@ -80,31 +80,32 @@ namespace MediaBrowser.Server.Implementations.Sync
{ {
new SyncQualityOption new SyncQualityOption
{ {
Name = SyncQuality.Original.ToString(), Name = "Original",
Id = SyncQuality.Original.ToString() Id = "original",
Description = "Syncs original files as-is, regardless of whether the device is capable of playing them or not."
}, },
new SyncQualityOption new SyncQualityOption
{ {
Name = SyncQuality.High.ToString(), Name = "High",
Id = SyncQuality.High.ToString(), Id = "high",
IsDefault = true IsDefault = true
}, },
new SyncQualityOption new SyncQualityOption
{ {
Name = SyncQuality.Medium.ToString(), Name = "Medium",
Id = SyncQuality.Medium.ToString() Id = "medium"
}, },
new SyncQualityOption new SyncQualityOption
{ {
Name = SyncQuality.Low.ToString(), Name = "Low",
Id = SyncQuality.Low.ToString() Id = "low"
} }
}; };
} }
public IEnumerable<SyncQualityOption> GetProfileOptions(SyncTarget target) public IEnumerable<SyncProfileOption> GetProfileOptions(SyncTarget target)
{ {
return new List<SyncQualityOption>(); return new List<SyncProfileOption>();
} }
} }
} }

@ -27,6 +27,6 @@ namespace MediaBrowser.Server.Implementations.Sync
/// </summary> /// </summary>
/// <param name="target">The target.</param> /// <param name="target">The target.</param>
/// <returns>IEnumerable&lt;SyncQualityOption&gt;.</returns> /// <returns>IEnumerable&lt;SyncQualityOption&gt;.</returns>
IEnumerable<SyncQualityOption> GetProfileOptions(SyncTarget target); IEnumerable<SyncProfileOption> GetProfileOptions(SyncTarget target);
} }
} }

@ -159,7 +159,8 @@ namespace MediaBrowser.Server.Implementations.Sync
ItemCount = items.Count, ItemCount = items.Count,
Category = request.Category, Category = request.Category,
ParentId = request.ParentId, ParentId = request.ParentId,
Quality = request.Quality Quality = request.Quality,
Profile = request.Profile
}; };
if (!request.Category.HasValue && request.ItemIds != null) if (!request.Category.HasValue && request.ItemIds != null)
@ -1079,29 +1080,29 @@ namespace MediaBrowser.Server.Implementations.Sync
{ {
new SyncQualityOption new SyncQualityOption
{ {
Name = SyncQuality.Original.ToString(), Name = "High",
Id = SyncQuality.Original.ToString() Id = "high",
IsDefault = true
}, },
new SyncQualityOption new SyncQualityOption
{ {
Name = SyncQuality.High.ToString(), Name = "Medium",
Id = SyncQuality.High.ToString(), Id = "medium"
IsDefault = true
}, },
new SyncQualityOption new SyncQualityOption
{ {
Name = SyncQuality.Medium.ToString(), Name = "Low",
Id = SyncQuality.Medium.ToString() Id = "low"
}, },
new SyncQualityOption new SyncQualityOption
{ {
Name = SyncQuality.Low.ToString(), Name = "Custom",
Id = SyncQuality.Low.ToString() Id = "custom"
} }
}; };
} }
public IEnumerable<SyncQualityOption> GetProfileOptions(string targetId) public IEnumerable<SyncProfileOption> GetProfileOptions(string targetId)
{ {
foreach (var provider in _providers) 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; var hasQuality = provider as IHasSyncQuality;
if (hasQuality != null) if (hasQuality != null)
@ -1125,12 +1126,29 @@ namespace MediaBrowser.Server.Implementations.Sync
return hasQuality.GetProfileOptions(target); 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(), Name = "General - H264/AAC/AC3, MP3",
Id = SyncQuality.Low.ToString() Id = "general",
Description = "Designed for compatibility with Chromecast, Roku, Smart TV's, and other similar devices.",
IsDefault = true
}); });
return list; return list;

Loading…
Cancel
Save