From 79413d9f33aad2aae933e79ad22a8a01ae3b6807 Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Fri, 13 Mar 2020 23:11:59 +0100 Subject: Add a configuration flag to allow/disallow duplicates in playlists --- .../Extensions/ConfigurationExtensions.cs | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs') diff --git a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs index 76c9b4b26..48316499a 100644 --- a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs +++ b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs @@ -13,24 +13,37 @@ namespace MediaBrowser.Controller.Extensions public const string FfmpegProbeSizeKey = "FFmpeg:probesize"; /// - /// The key for the FFmpeg analyse duration option. + /// The key for the FFmpeg analyze duration option. /// public const string FfmpegAnalyzeDurationKey = "FFmpeg:analyzeduration"; /// - /// Retrieves the FFmpeg probe size from the . + /// The key for a setting that indicates whether playlists should allow duplicate entries. /// - /// This configuration. + public const string PlaylistsAllowDuplicatesKey = "playlists:allowDuplicates"; + + /// + /// Gets the FFmpeg probe size from the . + /// + /// The configuration to read the setting from. /// The FFmpeg probe size option. public static string GetFFmpegProbeSize(this IConfiguration configuration) => configuration[FfmpegProbeSizeKey]; /// - /// Retrieves the FFmpeg analyse duration from the . + /// Gets the FFmpeg analyze duration from the . /// - /// This configuration. - /// The FFmpeg analyse duration option. + /// The configuration to read the setting from. + /// The FFmpeg analyze duration option. public static string GetFFmpegAnalyzeDuration(this IConfiguration configuration) => configuration[FfmpegAnalyzeDurationKey]; + + /// + /// Gets a value indicating whether playlists should allow duplicate entries from the . + /// + /// The configuration to read the setting from. + /// True if playlists should allow duplicates, otherwise false. + public static bool DoPlaylistsAllowDuplicates(this IConfiguration configuration) + => configuration.GetValue(PlaylistsAllowDuplicatesKey); } } -- cgit v1.2.3