Make maximum description length configurable
This commit is contained in:
@@ -7,8 +7,6 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
|
||||
/// </summary>
|
||||
public static class Utils
|
||||
{
|
||||
private static int maxDescriptionChars = 500;
|
||||
|
||||
/// <summary>
|
||||
/// Sanitize the given URL.
|
||||
/// </summary>
|
||||
@@ -41,7 +39,13 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
|
||||
/// <returns>A string with \n replaced by br tags.</returns>
|
||||
public static string FormatDescription(string description)
|
||||
{
|
||||
return description.Replace("\n", "<br>", System.StringComparison.CurrentCulture).Substring(0, maxDescriptionChars);
|
||||
var maxLength = 500;
|
||||
if (Plugin.Instance != null)
|
||||
{
|
||||
maxLength = Plugin.Instance.Configuration.MaxDescriptionLength;
|
||||
}
|
||||
|
||||
return description.Replace("\n", "<br>", System.StringComparison.CurrentCulture).Substring(0, maxLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user