public UserPolicy() { EnableLiveTvManagement = true; EnableMediaPlayback = true; EnableLiveTvAccess = true; EnableSharedDeviceControl = true; BlockedTags = new string[] { }; BlockUnratedItems = new UnratedItem[] { }; EnableUserPreferenceAccess = true; AccessSchedules = new AccessSchedule[] { }; EnableAllChannels = true; EnabledChannels = new string[] { }; EnableAllFolders = true; EnabledFolders = new string[] { }; EnabledDevices = new string[] { }; EnableAllDevices = true; EnableContentDownloading = true; }
/// <summary> /// Initializes a new instance of the <see cref="UserConfiguration" /> class. /// </summary> public UserConfiguration() { PlayDefaultAudioTrack = true; EnableLiveTvManagement = true; EnableMediaPlayback = true; EnableLiveTvAccess = true; EnableSharedDeviceControl = true; LatestItemsExcludes = new string[] { }; OrderedViews = new string[] { }; BlockedMediaFolders = new string[] { }; DisplayChannelsWithinViews = new string[] { }; BlockedTags = new string[] { }; BlockedChannels = new string[] { }; BlockUnratedItems = new UnratedItem[] { }; ExcludeFoldersFromGrouping = new string[] { }; DisplayCollectionsView = true; IncludeTrailersInSuggestions = true; EnableCinemaMode = true; EnableUserPreferenceAccess = true; AccessSchedules = new AccessSchedule[] { }; }
private bool IsParentalScheduleAllowed(AccessSchedule schedule, DateTime date) { if (date.Kind != DateTimeKind.Utc) { throw new ArgumentException("Utc date expected"); } var localTime = date.ToLocalTime(); return(localTime.DayOfWeek == schedule.DayOfWeek && IsWithinTime(schedule, localTime)); }
public UserPolicy() { EnableContentDeletion = true; EnableContentDeletionFromFolders = Array.Empty <string>(); EnableSyncTranscoding = true; EnableMediaConversion = true; EnableMediaPlayback = true; EnableAudioPlaybackTranscoding = true; EnableVideoPlaybackTranscoding = true; EnablePlaybackRemuxing = true; EnableLiveTvManagement = true; EnableLiveTvAccess = true; // Without this on by default, admins won't be able to do this // Improve in the future EnableLiveTvManagement = true; EnableSharedDeviceControl = true; BlockedTags = Array.Empty <string>(); BlockUnratedItems = new UnratedItem[] { }; EnableUserPreferenceAccess = true; AccessSchedules = new AccessSchedule[] { }; EnableAllChannels = true; EnabledChannels = Array.Empty <string>(); EnableAllFolders = true; EnabledFolders = Array.Empty <string>(); EnabledDevices = Array.Empty <string>(); EnableAllDevices = true; EnableContentDownloading = true; EnablePublicSharing = true; EnableRemoteAccess = true; }
private bool IsWithinTime(AccessSchedule schedule, DateTime localTime) { var hour = localTime.TimeOfDay.TotalHours; return(hour >= schedule.StartHour && hour <= schedule.EndHour); }
/// <summary> /// Initializes a new instance of the <see cref="UserConfiguration" /> class. /// </summary> public UserConfiguration() { PlayDefaultAudioTrack = true; EnableLiveTvManagement = true; EnableMediaPlayback = true; EnableLiveTvAccess = true; EnableSharedDeviceControl = true; LatestItemsExcludes = new string[] { }; OrderedViews = new string[] { }; BlockedMediaFolders = new string[] { }; DisplayChannelsWithinViews = new string[] { }; BlockedTags = new string[] { }; BlockedChannels = new string[] { }; BlockUnratedItems = new UnratedItem[] { }; ExcludeFoldersFromGrouping = new string[] { }; DisplayCollectionsView = true; SyncConnectName = true; SyncConnectImage = true; IncludeTrailersInSuggestions = true; EnableCinemaMode = true; EnableUserPreferenceAccess = true; AccessSchedules = new AccessSchedule[] { }; }