mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-23 15:30:56 -04:00
rework checkboxes for block unrated items
This commit is contained in:
parent
aeb43e229a
commit
6e5d90bafe
@ -135,7 +135,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedMusic;
|
return config.BlockUnratedItems.Contains(UnratedItem.Music);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SongInfo GetLookupInfo()
|
public SongInfo GetLookupInfo()
|
||||||
|
@ -129,7 +129,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedMusic;
|
return config.BlockUnratedItems.Contains(UnratedItem.Music);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AlbumInfo GetLookupInfo()
|
public AlbumInfo GetLookupInfo()
|
||||||
|
@ -123,7 +123,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedMusic;
|
return config.BlockUnratedItems.Contains(UnratedItem.Music);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RefreshAllMetadata(MetadataRefreshOptions refreshOptions, IProgress<double> progress, CancellationToken cancellationToken)
|
public async Task RefreshAllMetadata(MetadataRefreshOptions refreshOptions, IProgress<double> progress, CancellationToken cancellationToken)
|
||||||
|
@ -895,7 +895,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||||
protected virtual bool GetBlockUnratedValue(UserConfiguration config)
|
protected virtual bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockNotRated;
|
return config.BlockUnratedItems.Contains(UnratedItem.Other);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -38,7 +38,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedBooks;
|
return config.BlockUnratedItems.Contains(UnratedItem.Book);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BookInfo GetLookupInfo()
|
public BookInfo GetLookupInfo()
|
||||||
|
@ -3,6 +3,7 @@ using MediaBrowser.Model.Configuration;
|
|||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
@ -107,7 +108,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedGames;
|
return config.BlockUnratedItems.Contains(UnratedItem.Game);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameInfo GetLookupInfo()
|
public GameInfo GetLookupInfo()
|
||||||
|
@ -57,7 +57,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedMovies;
|
return config.BlockUnratedItems.Contains(UnratedItem.Movie);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IEnumerable<BaseItem> GetChildren(User user, bool includeLinkedChildren)
|
public override IEnumerable<BaseItem> GetChildren(User user, bool includeLinkedChildren)
|
||||||
|
@ -160,7 +160,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedMovies;
|
return config.BlockUnratedItems.Contains(UnratedItem.Movie);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MovieInfo GetLookupInfo()
|
public MovieInfo GetLookupInfo()
|
||||||
|
@ -3,6 +3,7 @@ using MediaBrowser.Controller.Providers;
|
|||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
@ -53,7 +54,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedMusic;
|
return config.BlockUnratedItems.Contains(UnratedItem.Music);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MusicVideoInfo GetLookupInfo()
|
public MusicVideoInfo GetLookupInfo()
|
||||||
|
@ -244,7 +244,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedSeries;
|
return config.BlockUnratedItems.Contains(UnratedItem.Series);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EpisodeInfo GetLookupInfo()
|
public EpisodeInfo GetLookupInfo()
|
||||||
|
@ -217,7 +217,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedSeries;
|
return config.BlockUnratedItems.Contains(UnratedItem.Series);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string PreferredMetadataLanguage { get; set; }
|
public string PreferredMetadataLanguage { get; set; }
|
||||||
|
@ -4,6 +4,7 @@ using MediaBrowser.Model.Entities;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
@ -97,7 +98,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
{
|
{
|
||||||
return config.BlockUnratedTrailers;
|
return config.BlockUnratedItems.Contains(UnratedItem.Trailer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TrailerInfo GetLookupInfo()
|
public TrailerInfo GetLookupInfo()
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
using MediaBrowser.Controller.Entities.Audio;
|
using MediaBrowser.Controller.Entities.Audio;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.LiveTv
|
namespace MediaBrowser.Controller.LiveTv
|
||||||
{
|
{
|
||||||
@ -75,5 +77,10 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
|
{
|
||||||
|
return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.LiveTv;
|
using MediaBrowser.Model.LiveTv;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.LiveTv
|
namespace MediaBrowser.Controller.LiveTv
|
||||||
{
|
{
|
||||||
@ -38,6 +40,11 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
|
{
|
||||||
|
return config.BlockUnratedItems.Contains(UnratedItem.LiveTvChannel);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether this instance is owned item.
|
/// Gets a value indicating whether this instance is owned item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.LiveTv;
|
using MediaBrowser.Model.LiveTv;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.LiveTv
|
namespace MediaBrowser.Controller.LiveTv
|
||||||
{
|
{
|
||||||
@ -196,5 +198,10 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
// Not great that this class has to know about that, but we'll improve that later.
|
// Not great that this class has to know about that, but we'll improve that later.
|
||||||
return ItemRepository.SaveItem(this, cancellationToken);
|
return ItemRepository.SaveItem(this, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
|
{
|
||||||
|
return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.LiveTv
|
namespace MediaBrowser.Controller.LiveTv
|
||||||
{
|
{
|
||||||
@ -75,5 +77,10 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||||
|
{
|
||||||
|
return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,12 +12,6 @@ namespace MediaBrowser.Model.Configuration
|
|||||||
/// <value>The max parental rating.</value>
|
/// <value>The max parental rating.</value>
|
||||||
public int? MaxParentalRating { get; set; }
|
public int? MaxParentalRating { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether items with no rating information should be blocked.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if items with no rating info should be blocked; otherwise, <c>false</c>.</value>
|
|
||||||
public bool BlockNotRated { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance is administrator.
|
/// Gets or sets a value indicating whether this instance is administrator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -54,13 +48,6 @@ namespace MediaBrowser.Model.Configuration
|
|||||||
public bool DisplayUnairedEpisodes { get; set; }
|
public bool DisplayUnairedEpisodes { get; set; }
|
||||||
public bool EnableRemoteControlOfOtherUsers { get; set; }
|
public bool EnableRemoteControlOfOtherUsers { get; set; }
|
||||||
|
|
||||||
public bool BlockUnratedMovies { get; set; }
|
|
||||||
public bool BlockUnratedTrailers { get; set; }
|
|
||||||
public bool BlockUnratedSeries { get; set; }
|
|
||||||
public bool BlockUnratedMusic { get; set; }
|
|
||||||
public bool BlockUnratedGames { get; set; }
|
|
||||||
public bool BlockUnratedBooks { get; set; }
|
|
||||||
|
|
||||||
public bool EnableLiveTvManagement { get; set; }
|
public bool EnableLiveTvManagement { get; set; }
|
||||||
public bool EnableLiveTvAccess { get; set; }
|
public bool EnableLiveTvAccess { get; set; }
|
||||||
|
|
||||||
@ -68,6 +55,8 @@ namespace MediaBrowser.Model.Configuration
|
|||||||
|
|
||||||
public string[] BlockedMediaFolders { get; set; }
|
public string[] BlockedMediaFolders { get; set; }
|
||||||
|
|
||||||
|
public UnratedItem[] BlockUnratedItems { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="UserConfiguration" /> class.
|
/// Initializes a new instance of the <see cref="UserConfiguration" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -75,13 +64,26 @@ namespace MediaBrowser.Model.Configuration
|
|||||||
{
|
{
|
||||||
IsAdministrator = true;
|
IsAdministrator = true;
|
||||||
EnableRemoteControlOfOtherUsers = true;
|
EnableRemoteControlOfOtherUsers = true;
|
||||||
BlockNotRated = false;
|
|
||||||
|
|
||||||
EnableLiveTvManagement = true;
|
EnableLiveTvManagement = true;
|
||||||
EnableMediaPlayback = true;
|
EnableMediaPlayback = true;
|
||||||
EnableLiveTvAccess = true;
|
EnableLiveTvAccess = true;
|
||||||
|
|
||||||
BlockedMediaFolders = new string[] { };
|
BlockedMediaFolders = new string[] { };
|
||||||
|
BlockUnratedItems = new UnratedItem[] { };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum UnratedItem
|
||||||
|
{
|
||||||
|
Movie,
|
||||||
|
Trailer,
|
||||||
|
Series,
|
||||||
|
Music,
|
||||||
|
Game,
|
||||||
|
Book,
|
||||||
|
LiveTvChannel,
|
||||||
|
LiveTvProgram,
|
||||||
|
Other
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user