Fix a few issues in User

pull/3423/head
Patrick Barron 5 years ago
parent becfe018f0
commit 0ccf7320b0

@ -260,9 +260,7 @@ namespace Jellyfin.Data.Entities
public bool HasPermission(PermissionKind permission) public bool HasPermission(PermissionKind permission)
{ {
var list = Permissions.Where(p => p.Kind == permission); return Permissions.First(p => p.Kind == permission).Value;
return list.First().Value;
} }
public void SetPermission(PermissionKind kind, bool value) public void SetPermission(PermissionKind kind, bool value)
@ -283,16 +281,14 @@ namespace Jellyfin.Data.Entities
public void SetPreference(PreferenceKind preference, string[] values) public void SetPreference(PreferenceKind preference, string[] values)
{ {
var pref = Preferences.First(p => p.Kind == preference); Preferences.First(p => p.Kind == preference).Value
= string.Join(Delimiter.ToString(CultureInfo.InvariantCulture), values);
pref.Value = string.Join(Delimiter.ToString(CultureInfo.InvariantCulture), values);
} }
public bool IsParentalScheduleAllowed() public bool IsParentalScheduleAllowed()
{ {
var schedules = this.AccessSchedules; return AccessSchedules.Count == 0
|| AccessSchedules.Any(i => IsParentalScheduleAllowed(i, DateTime.UtcNow));
return schedules.Count == 0 || schedules.Any(i => IsParentalScheduleAllowed(i, DateTime.Now));
} }
public bool IsFolderGrouped(Guid id) public bool IsFolderGrouped(Guid id)

Loading…
Cancel
Save