The Free Software Media System - Server Backend & API
Replaced /d with [0-9], see issue #2923
Troy8c640a1492ad
diff --git a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs b/Emby.Dlna/Profiles/SonyBravia2010Profile.csindex 8ab4acd1be..9f0d82b8f8 100644--- a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2010Profile.cs@@ -13,7 +13,7 @@ namespace Emby.Dlna.ProfilesIdentification = new DeviceIdentification{- FriendlyName = @"KDL-\d{2}[EHLNPB]X\d[01]\d.*",+ FriendlyName = @"KDL-[0-9]{2}[EHLNPB]X[0-9][01][0-9].*",Manufacturer = "Sony",Headers = new[]@@ -21,7 +21,7 @@ namespace Emby.Dlna.Profilesnew HttpHeaderInfo{Name = "X-AV-Client-Info",- Value = @".*KDL-\d{2}[EHLNPB]X\d[01]\d.*",+ Value = @".*KDL-[0-9]{2}[EHLNPB]X[0-9][01][0-9].*",Match = HeaderMatchType.Regex}}diff --git a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs b/Emby.Dlna/Profiles/SonyBravia2011Profile.csindex 42d253394c..dfb91817ac 100644--- a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2011Profile.cs@@ -13,7 +13,7 @@ namespace Emby.Dlna.ProfilesIdentification = new DeviceIdentification{- FriendlyName = @"KDL-\d{2}([A-Z]X\d2\d|CX400).*",+ FriendlyName = @"KDL-[0-9]{2}([A-Z]X[0-9]2[0-9]|CX400).*",Manufacturer = "Sony",Headers = new[]@@ -21,7 +21,7 @@ namespace Emby.Dlna.Profilesnew HttpHeaderInfo{Name = "X-AV-Client-Info",- Value = @".*KDL-\d{2}([A-Z]X\d2\d|CX400).*",+ Value = @".*KDL-[0-9]{2}([A-Z]X[0-9]2[0-9]|CX400).*",Match = HeaderMatchType.Regex}}diff --git a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs b/Emby.Dlna/Profiles/SonyBravia2012Profile.csindex 0598e83422..d59ee38d74 100644--- a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2012Profile.cs@@ -13,7 +13,7 @@ namespace Emby.Dlna.ProfilesIdentification = new DeviceIdentification{- FriendlyName = @"KDL-\d{2}[A-Z]X\d5(\d|G).*",+ FriendlyName = @"KDL-[0-9]{2}[A-Z]X[0-9]5([0-9]|G).*",Manufacturer = "Sony",Headers = new[]@@ -21,7 +21,7 @@ namespace Emby.Dlna.Profilesnew HttpHeaderInfo{Name = "X-AV-Client-Info",- Value = @".*KDL-\d{2}[A-Z]X\d5(\d|G).*",+ Value = @".*KDL-[0-9]{2}[A-Z]X[0-9]5([0-9]|G).*",Match = HeaderMatchType.Regex}}diff --git a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs b/Emby.Dlna/Profiles/SonyBravia2013Profile.csindex 3d90a1e72d..73b0fd67eb 100644--- a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2013Profile.cs@@ -13,7 +13,7 @@ namespace Emby.Dlna.ProfilesIdentification = new DeviceIdentification{- FriendlyName = @"KDL-\d{2}[WR][5689]\d{2}A.*",+ FriendlyName = @"KDL-[0-9]{2}[WR][5689][0-9]{2}A.*",Manufacturer = "Sony",Headers = new[]@@ -21,7 +21,7 @@ namespace Emby.Dlna.Profilesnew HttpHeaderInfo{Name = "X-AV-Client-Info",- Value = @".*KDL-\d{2}[WR][5689]\d{2}A.*",+ Value = @".*KDL-[0-9]{2}[WR][5689][0-9]{2}A.*",Match = HeaderMatchType.Regex}}diff --git a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs b/Emby.Dlna/Profiles/SonyBravia2014Profile.csindex 9188f73ef1..db8ee5750f 100644--- a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2014Profile.cs@@ -13,7 +13,7 @@ namespace Emby.Dlna.ProfilesIdentification = new DeviceIdentification{- FriendlyName = @"(KDL-\d{2}W[5-9]\d{2}B|KDL-\d{2}R480|XBR-\d{2}X[89]\d{2}B|KD-\d{2}[SX][89]\d{3}B).*",+ FriendlyName = @"(KDL-[0-9]{2}W[5-9][0-9]{2}B|KDL-[0-9]{2}R480|XBR-[0-9]{2}X[89][0-9]{2}B|KD-[0-9]{2}[SX][89][0-9]{3}B).*",Manufacturer = "Sony",Headers = new[]@@ -21,7 +21,7 @@ namespace Emby.Dlna.Profilesnew HttpHeaderInfo{Name = "X-AV-Client-Info",- Value = @".*(KDL-\d{2}W[5-9]\d{2}B|KDL-\d{2}R480|XBR-\d{2}X[89]\d{2}B|KD-\d{2}[SX][89]\d{3}B).*",+ Value = @".*(KDL-[0-9]{2}W[5-9][0-9]{2}B|KDL-[0-9]{2}R480|XBR-[0-9]{2}X[89][0-9]{2}B|KD-[0-9]{2}[SX][89][0-9]{3}B).*",Match = HeaderMatchType.Regex}}diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2010).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2010).xmlindex f20e9fcb6f..1461db3117 100644--- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2010).xml+++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2010).xml@@ -3,10 +3,10 @@xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Name>Sony Bravia (2010)</Name><Identification>- <FriendlyName>KDL-\d{2}[EHLNPB]X\d[01]\d.*</FriendlyName>+ <FriendlyName>KDL-[0-9]{2}[EHLNPB]X[0-9][01][0-9].*</FriendlyName><Manufacturer>Sony</Manufacturer><Headers>- <HttpHeaderInfo name="X-AV-Client-Info" value=".*KDL-\d{2}[EHLNPB]X\d[01]\d.*" match="Regex" />+ <HttpHeaderInfo name="X-AV-Client-Info" value=".*KDL-[0-9]{2}[EHLNPB]X[0-9][01][0-9].*" match="Regex" /></Headers></Identification><Manufacturer>Microsoft Corporation</Manufacturer>diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xmlindex e516ff512d..7c5f2b1817 100644--- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml+++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml@@ -3,10 +3,10 @@xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Name>Sony Bravia (2011)</Name><Identification>- <FriendlyName>KDL-\d{2}([A-Z]X\d2\d|CX400).*</FriendlyName>+ <FriendlyName>KDL-[0-9]{2}([A-Z]X[0-9]2[0-9]|CX400).*</FriendlyName><Manufacturer>Sony</Manufacturer><Headers>- <HttpHeaderInfo name="X-AV-Client-Info" value=".*KDL-\d{2}([A-Z]X\d2\d|CX400).*" match="Regex" />+ <HttpHeaderInfo name="X-AV-Client-Info" value=".*KDL-[0-9]{2}([A-Z]X[0-9]2[0-9]|CX400).*" match="Regex" /></Headers></Identification><Manufacturer>Microsoft Corporation</Manufacturer>diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xmlindex 88bd1c2f53..842a8fba33 100644--- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml+++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml@@ -3,10 +3,10 @@xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Name>Sony Bravia (2012)</Name><Identification>- <FriendlyName>KDL-\d{2}[A-Z]X\d5(\d|G).*</FriendlyName>+ <FriendlyName>KDL-[0-9]{2}[A-Z]X[0-9]5([0-9]|G).*</FriendlyName><Manufacturer>Sony</Manufacturer><Headers>- <HttpHeaderInfo name="X-AV-Client-Info" value=".*KDL-\d{2}[A-Z]X\d5(\d|G).*" match="Regex" />+ <HttpHeaderInfo name="X-AV-Client-Info" value=".*KDL-[0-9]{2}[A-Z]X[0-9]5([0-9]|G).*" match="Regex" /></Headers></Identification><Manufacturer>Microsoft Corporation</Manufacturer>diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xmlindex 3ca9893cdc..f1135c3fe3 100644--- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml+++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml@@ -3,10 +3,10 @@xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Name>Sony Bravia (2013)</Name><Identification>- <FriendlyName>KDL-\d{2}[WR][5689]\d{2}A.*</FriendlyName>+ <FriendlyName>KDL-[0-9]{2}[WR][5689][0-9]{2}A.*</FriendlyName><Manufacturer>Sony</Manufacturer><Headers>- <HttpHeaderInfo name="X-AV-Client-Info" value=".*KDL-\d{2}[WR][5689]\d{2}A.*" match="Regex" />+ <HttpHeaderInfo name="X-AV-Client-Info" value=".*KDL-[0-9]{2}[WR][5689][0-9]{2}A.*" match="Regex" /></Headers></Identification><Manufacturer>Microsoft Corporation</Manufacturer>diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xmlindex 8804a75dfa..85c7868c66 100644--- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml+++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml@@ -3,10 +3,10 @@xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Name>Sony Bravia (2014)</Name><Identification>- <FriendlyName>(KDL-\d{2}W[5-9]\d{2}B|KDL-\d{2}R480|XBR-\d{2}X[89]\d{2}B|KD-\d{2}[SX][89]\d{3}B).*</FriendlyName>+ <FriendlyName>(KDL-[0-9]{2}W[5-9][0-9]{2}B|KDL-[0-9]{2}R480|XBR-[0-9]{2}X[89][0-9]{2}B|KD-[0-9]{2}[SX][89][0-9]{3}B).*</FriendlyName><Manufacturer>Sony</Manufacturer><Headers>- <HttpHeaderInfo name="X-AV-Client-Info" value=".*(KDL-\d{2}W[5-9]\d{2}B|KDL-\d{2}R480|XBR-\d{2}X[89]\d{2}B|KD-\d{2}[SX][89]\d{3}B).*" match="Regex" />+ <HttpHeaderInfo name="X-AV-Client-Info" value=".*(KDL-[0-9]{2}W[5-9][0-9]{2}B|KDL-[0-9]{2}R480|XBR-[0-9]{2}X[89][0-9]{2}B|KD-[0-9]{2}[SX][89][0-9]{3}B).*" match="Regex" /></Headers></Identification><Manufacturer>Microsoft Corporation</Manufacturer>diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.csindex 035d1b2280..365f1a9268 100644--- a/Emby.Naming/Common/NamingOptions.cs+++ b/Emby.Naming/Common/NamingOptions.cs@@ -587,7 +587,7 @@ namespace Emby.Naming.CommonAudioBookNamesExpressions = new[]{// Detect year usually in brackets after name Batman (2020)- @"^(?<name>.+?)\s*\(\s*(?<year>\d{4})\s*\)\s*$",+ @"^(?<name>.+?)\s*\(\s*(?<year>[0-9]{4})\s*\)\s*$",@"^\s*(?<name>[^ ].*?)\s*$"};diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.csindex cdc8c6870a..615eff2c4e 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs@@ -26,7 +26,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerunpublic LegacyHdHomerunChannelCommands(string url){// parse url for channel and program- var regExp = new Regex(@"\/ch(\d+)-?(\d*)");+ var regExp = new Regex(@"\/ch([0-9]+)-?([[0-9]*)");var match = regExp.Match(url);if (match.Success){diff --git a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs b/MediaBrowser.MediaEncoding/Subtitles/AssParser.csindex e0b7914fbe..3b46fdaf79 100644--- a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs@@ -57,7 +57,7 @@ namespace MediaBrowser.MediaEncoding.SubtitlessubEvent.Text = subEvent.Text.Replace("\\n", ParserValues.NewLine, StringComparison.OrdinalIgnoreCase);- subEvent.Text = Regex.Replace(subEvent.Text, @"\{(\\[\w]+\(?([\w\d]+,?)+\)?)+\}", string.Empty, RegexOptions.IgnoreCase);+ subEvent.Text = Regex.Replace(subEvent.Text, @"\{(\\[\w]+\(?([\w[0-9]]+,?)+\)?)+\}", string.Empty, RegexOptions.IgnoreCase);trackEvents.Add(subEvent);}diff --git a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SrtParser.csindex 4a87f87dc1..ccef7eeeae 100644--- a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs@@ -79,7 +79,7 @@ namespace MediaBrowser.MediaEncoding.SubtitlessubEvent.Text = string.Join(ParserValues.NewLine, multiline);subEvent.Text = subEvent.Text.Replace(@"\N", ParserValues.NewLine, StringComparison.OrdinalIgnoreCase);- subEvent.Text = Regex.Replace(subEvent.Text, @"\{(?:\\\d?[\w.-]+(?:\([^\)]*\)|&H?[0-9A-Fa-f]+&|))+\}", string.Empty, RegexOptions.IgnoreCase);+ subEvent.Text = Regex.Replace(subEvent.Text, @"\{(?:\\[0-9]?[\w.-]+(?:\([^\)]*\)|&H?[0-9A-Fa-f]+&|))+\}", string.Empty, RegexOptions.IgnoreCase);subEvent.Text = Regex.Replace(subEvent.Text, "<", "<", RegexOptions.IgnoreCase);subEvent.Text = Regex.Replace(subEvent.Text, ">", ">", RegexOptions.IgnoreCase);subEvent.Text = Regex.Replace(subEvent.Text, "<(\\/?(font|b|u|i|s))((\\s+(\\w|\\w[\\w\\-]*\\w)(\\s*=\\s*(?:\\\".*?\\\"|'.*?'|[^'\\\">\\s]+))?)+\\s*|\\s*)(\\/?)>", "<$1$3$7>", RegexOptions.IgnoreCase);