mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
commit
526e6d5624
3 changed files with 19 additions and 4 deletions
|
@ -80,7 +80,7 @@ namespace MediaBrowser.Api.Playback
|
|||
return 6;
|
||||
}
|
||||
|
||||
return 10;
|
||||
return 6;
|
||||
}
|
||||
|
||||
if (IsSegmentedLiveStream)
|
||||
|
|
|
@ -16,9 +16,10 @@ using System.Globalization;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Xml;
|
||||
|
||||
using MediaBrowser.Controller.Extensions;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Xml;
|
||||
|
@ -353,7 +354,8 @@ namespace MediaBrowser.XbmcMetadata.Savers
|
|||
|
||||
if (!string.IsNullOrEmpty(stream.Language))
|
||||
{
|
||||
writer.WriteElementString("language", stream.Language);
|
||||
// https://emby.media/community/index.php?/topic/49071-nfo-not-generated-on-actualize-or-rescan-or-identify
|
||||
writer.WriteElementString("language", RemoveInvalidXMLChars(stream.Language));
|
||||
}
|
||||
|
||||
var scanType = stream.IsInterlaced ? "interlaced" : "progressive";
|
||||
|
@ -422,6 +424,19 @@ namespace MediaBrowser.XbmcMetadata.Savers
|
|||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
// filters control characters but allows only properly-formed surrogate sequences
|
||||
private static Regex _invalidXMLChars = new Regex(
|
||||
@"(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F\uFEFF\uFFFE\uFFFF]");
|
||||
|
||||
/// <summary>
|
||||
/// removes any unusual unicode characters that can't be encoded into XML
|
||||
/// </summary>
|
||||
public static string RemoveInvalidXMLChars(string text)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text)) return string.Empty;
|
||||
return _invalidXMLChars.Replace(text, string.Empty);
|
||||
}
|
||||
|
||||
public const string DateAddedFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("3.2.25.8")]
|
||||
[assembly: AssemblyVersion("3.2.25.9")]
|
||||
|
|
Loading…
Reference in a new issue