From 808f2f3095c18c18be7a6fd957ddeda2c4c97693 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 27 Nov 2017 14:08:55 -0500 Subject: [PATCH 1/4] update rssdp --- RSSDP/HttpRequestParser.cs | 9 ++++++--- RSSDP/HttpResponseParser.cs | 10 +++++++--- RSSDP/SsdpDevice.cs | 8 ++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/RSSDP/HttpRequestParser.cs b/RSSDP/HttpRequestParser.cs index 0923f291f..bedbbe675 100644 --- a/RSSDP/HttpRequestParser.cs +++ b/RSSDP/HttpRequestParser.cs @@ -64,7 +64,7 @@ namespace Rssdp.Infrastructure if (message == null) throw new ArgumentNullException("message"); var parts = data.Split(' '); - if (parts.Length < 3) throw new ArgumentException("Status line is invalid. Insufficient status parts.", "data"); + if (parts.Length < 2) throw new ArgumentException("Status line is invalid. Insufficient status parts.", "data"); message.Method = new HttpMethod(parts[0].Trim()); Uri requestUri; @@ -73,8 +73,11 @@ namespace Rssdp.Infrastructure else System.Diagnostics.Debug.WriteLine(parts[1]); - message.Version = ParseHttpVersion(parts[2].Trim()); - } + if (parts.Length >= 3) + { + message.Version = ParseHttpVersion(parts[2].Trim()); + } + } /// /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). diff --git a/RSSDP/HttpResponseParser.cs b/RSSDP/HttpResponseParser.cs index ba85a1657..5f297ca9a 100644 --- a/RSSDP/HttpResponseParser.cs +++ b/RSSDP/HttpResponseParser.cs @@ -75,7 +75,7 @@ namespace Rssdp.Infrastructure if (message == null) throw new ArgumentNullException("message"); var parts = data.Split(' '); - if (parts.Length < 3) throw new ArgumentException("data status line is invalid. Insufficient status parts.", "data"); + if (parts.Length < 2) throw new ArgumentException("data status line is invalid. Insufficient status parts.", "data"); message.Version = ParseHttpVersion(parts[0].Trim()); @@ -84,8 +84,12 @@ namespace Rssdp.Infrastructure throw new ArgumentException("data status line is invalid. Status code is not a valid integer.", "data"); message.StatusCode = (HttpStatusCode)statusCode; - message.ReasonPhrase = parts[2].Trim(); - } + + if (parts.Length >= 3) + { + message.ReasonPhrase = parts[2].Trim(); + } + } #endregion diff --git a/RSSDP/SsdpDevice.cs b/RSSDP/SsdpDevice.cs index cda11f0a4..65d9be139 100644 --- a/RSSDP/SsdpDevice.cs +++ b/RSSDP/SsdpDevice.cs @@ -743,6 +743,14 @@ namespace Rssdp private static void AddCustomProperty(XmlReader reader, SsdpDevice device) { + // If the property is an empty element, there is no value to read + // Advance the reader and return + if (reader.IsEmptyElement) + { + reader.Read(); + return; + } + var newProp = new SsdpDeviceProperty() { Namespace = reader.Prefix, Name = reader.LocalName }; int depth = reader.Depth; reader.Read(); From d06532c6029592e8fe1c0564b9286f086f438a7b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 27 Nov 2017 14:09:51 -0500 Subject: [PATCH 2/4] update rules for samples --- .../Library/CoreResolutionIgnoreRule.cs | 11 ---------- .../Library/Resolvers/Movies/MovieResolver.cs | 20 ------------------- 2 files changed, 31 deletions(-) diff --git a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index 961f9886c..5c3e1dab1 100644 --- a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -141,17 +141,6 @@ namespace Emby.Server.Implementations.Library return true; } } - - // Ignore samples - var sampleFilename = " " + filename.Replace(".", " ", StringComparison.OrdinalIgnoreCase) - .Replace("-", " ", StringComparison.OrdinalIgnoreCase) - .Replace("_", " ", StringComparison.OrdinalIgnoreCase) - .Replace("!", " ", StringComparison.OrdinalIgnoreCase); - - if (sampleFilename.IndexOf(" sample ", StringComparison.OrdinalIgnoreCase) != -1) - { - return true; - } } return false; diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 667616414..d74235ec7 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -125,10 +125,6 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies if (child.IsDirectory) { leftOver.Add(child); - } - else if (IsIgnored(child.Name)) - { - } else { @@ -298,22 +294,6 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies return item; } - private bool IsIgnored(string filename) - { - // Ignore samples - var sampleFilename = " " + filename.Replace(".", " ", StringComparison.OrdinalIgnoreCase) - .Replace("-", " ", StringComparison.OrdinalIgnoreCase) - .Replace("_", " ", StringComparison.OrdinalIgnoreCase) - .Replace("!", " ", StringComparison.OrdinalIgnoreCase); - - if (sampleFilename.IndexOf(" sample ", StringComparison.OrdinalIgnoreCase) != -1) - { - return true; - } - - return false; - } - /// /// Sets the initial item values. /// From 39f20fdb4e7bda153caf4450578d5f72a3049b1c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 27 Nov 2017 14:10:05 -0500 Subject: [PATCH 3/4] update dlna profiles --- Emby.Dlna/PlayTo/PlayToManager.cs | 2 ++ Emby.Dlna/Profiles/DishHopperJoeyProfile.cs | 2 +- Emby.Dlna/Profiles/LinksysDMA2100Profile.cs | 2 +- Emby.Dlna/Profiles/PanasonicVieraProfile.cs | 4 ++-- Emby.Dlna/Profiles/PopcornHourProfile.cs | 2 +- Emby.Dlna/Profiles/SamsungSmartTvProfile.cs | 7 +++++-- Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs | 6 +++--- Emby.Dlna/Profiles/SonyBravia2010Profile.cs | 12 ++++++------ Emby.Dlna/Profiles/SonyBravia2011Profile.cs | 12 ++++++------ Emby.Dlna/Profiles/SonyBravia2012Profile.cs | 12 ++++++------ Emby.Dlna/Profiles/SonyBravia2013Profile.cs | 12 ++++++------ Emby.Dlna/Profiles/SonyBravia2014Profile.cs | 12 ++++++------ Emby.Dlna/Profiles/SonyPs3Profile.cs | 2 +- Emby.Dlna/Profiles/SonyPs4Profile.cs | 2 +- Emby.Dlna/Profiles/WdtvLiveProfile.cs | 4 ++-- Emby.Dlna/Profiles/XboxOneProfile.cs | 2 +- Emby.Dlna/Profiles/Xml/Default.xml | 2 +- Emby.Dlna/Profiles/Xml/Denon AVR.xml | 2 +- Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml | 2 +- Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml | 4 ++-- Emby.Dlna/Profiles/Xml/LG Smart TV.xml | 2 +- Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml | 4 ++-- Emby.Dlna/Profiles/Xml/Marantz.xml | 2 +- Emby.Dlna/Profiles/Xml/MediaMonkey.xml | 2 +- Emby.Dlna/Profiles/Xml/Panasonic Viera.xml | 6 +++--- Emby.Dlna/Profiles/Xml/Popcorn Hour.xml | 4 ++-- Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml | 8 ++++---- Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml | 2 +- .../Profiles/Xml/Sony Blu-ray Player 2013.xml | 2 +- .../Profiles/Xml/Sony Blu-ray Player 2014.xml | 2 +- .../Profiles/Xml/Sony Blu-ray Player 2015.xml | 2 +- .../Profiles/Xml/Sony Blu-ray Player 2016.xml | 2 +- Emby.Dlna/Profiles/Xml/Sony Blu-ray Player.xml | 8 ++++---- Emby.Dlna/Profiles/Xml/Sony Bravia (2010).xml | 14 +++++++------- Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml | 14 +++++++------- Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml | 14 +++++++------- Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml | 14 +++++++------- Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml | 14 +++++++------- Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml | 4 ++-- Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml | 4 ++-- Emby.Dlna/Profiles/Xml/WDTV Live.xml | 6 +++--- Emby.Dlna/Profiles/Xml/Xbox One.xml | 4 ++-- Emby.Dlna/Profiles/Xml/foobar2000.xml | 2 +- MediaBrowser.Common/Updates/GithubUpdater.cs | 13 +------------ 44 files changed, 124 insertions(+), 130 deletions(-) diff --git a/Emby.Dlna/PlayTo/PlayToManager.cs b/Emby.Dlna/PlayTo/PlayToManager.cs index f1b7181dd..84094d906 100644 --- a/Emby.Dlna/PlayTo/PlayToManager.cs +++ b/Emby.Dlna/PlayTo/PlayToManager.cs @@ -93,6 +93,7 @@ namespace Emby.Dlna.PlayTo if (usn.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1 && nt.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1) { + //_logger.Debug("Upnp device {0} does not contain a MediaRenderer device (0).", location); return; } @@ -149,6 +150,7 @@ namespace Emby.Dlna.PlayTo if (device.RendererCommands == null) { + //_logger.Debug("Upnp device {0} does not contain a MediaRenderer device (1).", location); _nonRendererUrls.Add(location); return; } diff --git a/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs b/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs index 331312bec..3f779c679 100644 --- a/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs +++ b/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs @@ -208,7 +208,7 @@ namespace Emby.Dlna.Profiles { new ResponseProfile { - Container = "mkv,ts", + Container = "mkv,ts,mpegts", Type = DlnaProfileType.Video, MimeType = "video/mp4" } diff --git a/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs b/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs index d2f5fef76..83236c594 100644 --- a/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs +++ b/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs @@ -26,7 +26,7 @@ namespace Emby.Dlna.Profiles new DirectPlayProfile { - Container = "avi,mp4,mkv,ts,m4v", + Container = "avi,mp4,mkv,ts,mpegts,m4v", Type = DlnaProfileType.Video } }; diff --git a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs b/Emby.Dlna/Profiles/PanasonicVieraProfile.cs index eb9cf9528..a267158c9 100644 --- a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs +++ b/Emby.Dlna/Profiles/PanasonicVieraProfile.cs @@ -72,7 +72,7 @@ namespace Emby.Dlna.Profiles new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "h264,mpeg2video", AudioCodec = "aac,mp3,mp2", Type = DlnaProfileType.Video @@ -205,7 +205,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { Type = DlnaProfileType.Video, - Container = "ts", + Container = "ts,mpegts", OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", MimeType = "video/vnd.dlna.mpeg-tts" }, diff --git a/Emby.Dlna/Profiles/PopcornHourProfile.cs b/Emby.Dlna/Profiles/PopcornHourProfile.cs index ac8fba84c..33270e72a 100644 --- a/Emby.Dlna/Profiles/PopcornHourProfile.cs +++ b/Emby.Dlna/Profiles/PopcornHourProfile.cs @@ -46,7 +46,7 @@ namespace Emby.Dlna.Profiles new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", Type = DlnaProfileType.Video, VideoCodec = "h264", AudioCodec = "aac,ac3,eac3,mp3,mp2,pcm" diff --git a/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs b/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs index c582cb52e..cd9056632 100644 --- a/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs +++ b/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs @@ -12,6 +12,9 @@ namespace Emby.Dlna.Profiles EnableAlbumArtInDidl = true; + // Without this, older samsungs fail to browse + EnableSingleAlbumArtLimit = true; + Identification = new DeviceIdentification { ModelUrl = "samsung.com", @@ -39,7 +42,7 @@ namespace Emby.Dlna.Profiles }, new TranscodingProfile { - Container = "ts", + Container = "ts,mpegts", AudioCodec = "ac3", VideoCodec = "h264", Type = DlnaProfileType.Video, @@ -300,7 +303,7 @@ namespace Emby.Dlna.Profiles new CodecProfile { Type = CodecType.VideoAudio, - Codec = "ac3,wmav2,dca,aac,mp3,dts", + Codec = "wmav2,dca,aac,mp3,dts", Conditions = new[] { diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs b/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs index d9eab28e1..ddda638ed 100644 --- a/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs +++ b/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs @@ -69,7 +69,7 @@ namespace Emby.Dlna.Profiles { new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "mpeg1video,mpeg2video,h264", AudioCodec = "ac3,aac,mp3,pcm", Type = DlnaProfileType.Video @@ -212,7 +212,7 @@ namespace Emby.Dlna.Profiles { new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "h264,mpeg4,vc1", AudioCodec = "ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -236,7 +236,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", MimeType = "video/vnd.dlna.mpeg-tts", Type = DlnaProfileType.Video }, diff --git a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs b/Emby.Dlna/Profiles/SonyBravia2010Profile.cs index 60a99561f..0986ebdcb 100644 --- a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2010Profile.cs @@ -69,14 +69,14 @@ namespace Emby.Dlna.Profiles { new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "h264", AudioCodec = "ac3,aac,mp3", Type = DlnaProfileType.Video }, new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "mpeg1video,mpeg2video", AudioCodec = "mp3,mp2", Type = DlnaProfileType.Video @@ -100,7 +100,7 @@ namespace Emby.Dlna.Profiles { new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -126,7 +126,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/mpeg", @@ -146,7 +146,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -156,7 +156,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="mpeg2video", MimeType = "video/vnd.dlna.mpeg-tts", OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", diff --git a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs b/Emby.Dlna/Profiles/SonyBravia2011Profile.cs index 346845d9d..ff8316d9b 100644 --- a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2011Profile.cs @@ -66,14 +66,14 @@ namespace Emby.Dlna.Profiles { new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "h264", AudioCodec = "ac3,aac,mp3", Type = DlnaProfileType.Video }, new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "mpeg2video", AudioCodec = "mp3", Type = DlnaProfileType.Video @@ -141,7 +141,7 @@ namespace Emby.Dlna.Profiles { new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -167,7 +167,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/mpeg", @@ -187,7 +187,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -197,7 +197,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="mpeg2video", MimeType = "video/vnd.dlna.mpeg-tts", OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", diff --git a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs b/Emby.Dlna/Profiles/SonyBravia2012Profile.cs index 23a39a922..c592fae5c 100644 --- a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2012Profile.cs @@ -66,14 +66,14 @@ namespace Emby.Dlna.Profiles { new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "h264", AudioCodec = "ac3,aac,mp3", Type = DlnaProfileType.Video }, new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "mpeg2video", AudioCodec = "mp3,mp2", Type = DlnaProfileType.Video @@ -129,7 +129,7 @@ namespace Emby.Dlna.Profiles { new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -155,7 +155,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/mpeg", @@ -175,7 +175,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -185,7 +185,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="mpeg2video", MimeType = "video/vnd.dlna.mpeg-tts", OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", diff --git a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs b/Emby.Dlna/Profiles/SonyBravia2013Profile.cs index 2d36d3414..8580c744d 100644 --- a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2013Profile.cs @@ -65,14 +65,14 @@ namespace Emby.Dlna.Profiles { new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "h264", AudioCodec = "ac3,eac3,aac,mp3", Type = DlnaProfileType.Video }, new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "mpeg2video", AudioCodec = "mp3,mp2", Type = DlnaProfileType.Video @@ -185,7 +185,7 @@ namespace Emby.Dlna.Profiles { new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -211,7 +211,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/mpeg", @@ -231,7 +231,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -241,7 +241,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="mpeg2video", MimeType = "video/vnd.dlna.mpeg-tts", OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", diff --git a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs b/Emby.Dlna/Profiles/SonyBravia2014Profile.cs index 2c871a5d6..8f871dee7 100644 --- a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2014Profile.cs @@ -65,14 +65,14 @@ namespace Emby.Dlna.Profiles { new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "h264", AudioCodec = "ac3,eac3,aac,mp3", Type = DlnaProfileType.Video }, new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "mpeg2video", AudioCodec = "mp3,mp2", Type = DlnaProfileType.Video @@ -185,7 +185,7 @@ namespace Emby.Dlna.Profiles { new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -211,7 +211,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/mpeg", @@ -231,7 +231,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="h264", AudioCodec="ac3,aac,mp3", MimeType = "video/vnd.dlna.mpeg-tts", @@ -241,7 +241,7 @@ namespace Emby.Dlna.Profiles new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec="mpeg2video", MimeType = "video/vnd.dlna.mpeg-tts", OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", diff --git a/Emby.Dlna/Profiles/SonyPs3Profile.cs b/Emby.Dlna/Profiles/SonyPs3Profile.cs index 2a0490f9a..69b0f81ee 100644 --- a/Emby.Dlna/Profiles/SonyPs3Profile.cs +++ b/Emby.Dlna/Profiles/SonyPs3Profile.cs @@ -49,7 +49,7 @@ namespace Emby.Dlna.Profiles }, new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", Type = DlnaProfileType.Video, VideoCodec = "mpeg1video,mpeg2video,h264", AudioCodec = "ac3,mp2,mp3,aac" diff --git a/Emby.Dlna/Profiles/SonyPs4Profile.cs b/Emby.Dlna/Profiles/SonyPs4Profile.cs index c7f70f989..4c4c1f676 100644 --- a/Emby.Dlna/Profiles/SonyPs4Profile.cs +++ b/Emby.Dlna/Profiles/SonyPs4Profile.cs @@ -49,7 +49,7 @@ namespace Emby.Dlna.Profiles }, new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", Type = DlnaProfileType.Video, VideoCodec = "mpeg1video,mpeg2video,h264", AudioCodec = "ac3,mp2,mp3,aac" diff --git a/Emby.Dlna/Profiles/WdtvLiveProfile.cs b/Emby.Dlna/Profiles/WdtvLiveProfile.cs index 61819c57d..b4ca5a3d9 100644 --- a/Emby.Dlna/Profiles/WdtvLiveProfile.cs +++ b/Emby.Dlna/Profiles/WdtvLiveProfile.cs @@ -79,7 +79,7 @@ namespace Emby.Dlna.Profiles new DirectPlayProfile { - Container = "ts,m2ts", + Container = "ts,m2ts,mpegts", Type = DlnaProfileType.Video, VideoCodec = "mpeg1video,mpeg2video,h264,vc1", AudioCodec = "ac3,eac3,dca,mp2,mp3,aac,dts" @@ -155,7 +155,7 @@ namespace Emby.Dlna.Profiles { new ResponseProfile { - Container = "ts", + Container = "ts,mpegts", OrgPn = "MPEG_TS_SD_NA", Type = DlnaProfileType.Video } diff --git a/Emby.Dlna/Profiles/XboxOneProfile.cs b/Emby.Dlna/Profiles/XboxOneProfile.cs index 99e52510f..d497ee161 100644 --- a/Emby.Dlna/Profiles/XboxOneProfile.cs +++ b/Emby.Dlna/Profiles/XboxOneProfile.cs @@ -59,7 +59,7 @@ namespace Emby.Dlna.Profiles { new DirectPlayProfile { - Container = "ts", + Container = "ts,mpegts", VideoCodec = "h264,mpeg2video,hevc", AudioCodec = "ac3,aac,mp3", Type = DlnaProfileType.Video diff --git a/Emby.Dlna/Profiles/Xml/Default.xml b/Emby.Dlna/Profiles/Xml/Default.xml index 133f4abf1..77392d9ce 100644 --- a/Emby.Dlna/Profiles/Xml/Default.xml +++ b/Emby.Dlna/Profiles/Xml/Default.xml @@ -1,5 +1,5 @@ - + Generic Device Emby http://emby.media/ diff --git a/Emby.Dlna/Profiles/Xml/Denon AVR.xml b/Emby.Dlna/Profiles/Xml/Denon AVR.xml index 9c7276f81..3ab20c330 100644 --- a/Emby.Dlna/Profiles/Xml/Denon AVR.xml +++ b/Emby.Dlna/Profiles/Xml/Denon AVR.xml @@ -1,5 +1,5 @@ - + Denon AVR Denon:\[AVR:.* diff --git a/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml b/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml index 381a9f641..f022191a3 100644 --- a/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml +++ b/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml @@ -1,5 +1,5 @@ - + DirecTV HD-DVR ^DIRECTV.*$ diff --git a/Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml b/Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml index 4eb67ae81..fa8fd0e74 100644 --- a/Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml +++ b/Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml @@ -1,5 +1,5 @@ - + Dish Hopper-Joey Echostar Technologies LLC @@ -86,7 +86,7 @@ - + diff --git a/Emby.Dlna/Profiles/Xml/LG Smart TV.xml b/Emby.Dlna/Profiles/Xml/LG Smart TV.xml index ac8c8194c..845ff0415 100644 --- a/Emby.Dlna/Profiles/Xml/LG Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/LG Smart TV.xml @@ -1,5 +1,5 @@ - + LG Smart TV LG.* diff --git a/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml b/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml index bd20112a8..410a79432 100644 --- a/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml +++ b/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml @@ -1,5 +1,5 @@ - + Linksys DMA2100 DMA2100us @@ -34,7 +34,7 @@ - + diff --git a/Emby.Dlna/Profiles/Xml/Marantz.xml b/Emby.Dlna/Profiles/Xml/Marantz.xml index ae843e34a..7d2d53ee4 100644 --- a/Emby.Dlna/Profiles/Xml/Marantz.xml +++ b/Emby.Dlna/Profiles/Xml/Marantz.xml @@ -1,5 +1,5 @@ - + Marantz Marantz diff --git a/Emby.Dlna/Profiles/Xml/MediaMonkey.xml b/Emby.Dlna/Profiles/Xml/MediaMonkey.xml index 94606a93c..944b80f71 100644 --- a/Emby.Dlna/Profiles/Xml/MediaMonkey.xml +++ b/Emby.Dlna/Profiles/Xml/MediaMonkey.xml @@ -1,5 +1,5 @@ - + MediaMonkey MediaMonkey diff --git a/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml b/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml index 1c58ab0c9..0b842fe2a 100644 --- a/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml +++ b/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml @@ -1,5 +1,5 @@ - + Panasonic Viera VIERA @@ -40,7 +40,7 @@ - + @@ -73,7 +73,7 @@ - + diff --git a/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml b/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml index 69bf74a98..c49184a4c 100644 --- a/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml +++ b/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml @@ -1,5 +1,5 @@ - + Popcorn Hour Emby http://emby.media/ @@ -30,7 +30,7 @@ - + diff --git a/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml b/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml index 6fbed0590..361d7660b 100644 --- a/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml @@ -1,5 +1,5 @@ - + Samsung Smart TV samsung.com @@ -14,7 +14,7 @@ Emby http://emby.media/ true - false + true false Audio,Photo,Video JPEG_SM @@ -51,7 +51,7 @@ - + @@ -100,7 +100,7 @@ - + diff --git a/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml b/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml index ae2e686b8..9043330ec 100644 --- a/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml @@ -1,5 +1,5 @@ - + Sharp Smart TV Sharp diff --git a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml index 576f5ca50..2734aec9d 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml +++ b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml @@ -1,5 +1,5 @@ - + Sony Blu-ray Player 2013 BDP-2013 diff --git a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2014.xml b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2014.xml index 5a04afb3e..8c5e0a90e 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2014.xml +++ b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2014.xml @@ -1,5 +1,5 @@ - + Sony Blu-ray Player 2014 BDP-2014 diff --git a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2015.xml b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2015.xml index 97f0e3790..6d55ef980 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2015.xml +++ b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2015.xml @@ -1,5 +1,5 @@ - + Sony Blu-ray Player 2015 BDP-2015 diff --git a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2016.xml b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2016.xml index 052bc80d8..58312c1c6 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2016.xml +++ b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player 2016.xml @@ -1,5 +1,5 @@ - + Sony Blu-ray Player 2016 BDP-2016 diff --git a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player.xml b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player.xml index 084fa9df0..011ba08ea 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player.xml +++ b/Emby.Dlna/Profiles/Xml/Sony Blu-ray Player.xml @@ -1,5 +1,5 @@ - + Sony Blu-ray Player Blu-ray Disc Player @@ -39,7 +39,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -93,7 +93,7 @@ - + diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2010).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2010).xml index 046282ba3..c99e21a34 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2010).xml +++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2010).xml @@ -1,5 +1,5 @@ - + Sony Bravia (2010) KDL-\d{2}[EHLNPB]X\d[01]\d.* @@ -39,8 +39,8 @@ - - + + @@ -106,21 +106,21 @@ - + - + - + - + diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml index e30afa2af..6defa3c22 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml +++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml @@ -1,5 +1,5 @@ - + Sony Bravia (2011) KDL-\d{2}([A-Z]X\d2\d|CX400).* @@ -39,8 +39,8 @@ - - + + @@ -109,21 +109,21 @@ - + - + - + - + diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml index cff07f04c..d90f02a55 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml +++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml @@ -1,5 +1,5 @@ - + Sony Bravia (2012) KDL-\d{2}[A-Z]X\d5(\d|G).* @@ -39,8 +39,8 @@ - - + + @@ -85,21 +85,21 @@ - + - + - + - + diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml index 2d5794087..ad5d1a676 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml +++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml @@ -1,5 +1,5 @@ - + Sony Bravia (2013) KDL-\d{2}[WR][5689]\d{2}A.* @@ -39,8 +39,8 @@ - - + + @@ -84,21 +84,21 @@ - + - + - + - + diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml index d61b986c2..f654982cb 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml +++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml @@ -1,5 +1,5 @@ - + Sony Bravia (2014) (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).* @@ -39,8 +39,8 @@ - - + + @@ -84,21 +84,21 @@ - + - + - + - + diff --git a/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml b/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml index 966ecc2c8..8da880951 100644 --- a/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml +++ b/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml @@ -1,5 +1,5 @@ - + Sony PlayStation 3 PLAYSTATION 3 @@ -38,7 +38,7 @@ - + diff --git a/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml b/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml index 6a818193b..c192d082e 100644 --- a/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml +++ b/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml @@ -1,5 +1,5 @@ - + Sony PlayStation 4 PLAYSTATION 4 @@ -38,7 +38,7 @@ - + diff --git a/Emby.Dlna/Profiles/Xml/WDTV Live.xml b/Emby.Dlna/Profiles/Xml/WDTV Live.xml index 44d130e92..0fc8b9973 100644 --- a/Emby.Dlna/Profiles/Xml/WDTV Live.xml +++ b/Emby.Dlna/Profiles/Xml/WDTV Live.xml @@ -1,5 +1,5 @@ - + WDTV Live WD TV @@ -39,7 +39,7 @@ - + @@ -80,7 +80,7 @@ - + diff --git a/Emby.Dlna/Profiles/Xml/Xbox One.xml b/Emby.Dlna/Profiles/Xml/Xbox One.xml index 635423234..0b095b2d0 100644 --- a/Emby.Dlna/Profiles/Xml/Xbox One.xml +++ b/Emby.Dlna/Profiles/Xml/Xbox One.xml @@ -1,5 +1,5 @@ - + Xbox One Xbox One @@ -36,7 +36,7 @@ false - + diff --git a/Emby.Dlna/Profiles/Xml/foobar2000.xml b/Emby.Dlna/Profiles/Xml/foobar2000.xml index b22a0ee16..82ffc916c 100644 --- a/Emby.Dlna/Profiles/Xml/foobar2000.xml +++ b/Emby.Dlna/Profiles/Xml/foobar2000.xml @@ -1,5 +1,5 @@ - + foobar2000 foobar diff --git a/MediaBrowser.Common/Updates/GithubUpdater.cs b/MediaBrowser.Common/Updates/GithubUpdater.cs index 30abdc5da..4275799a9 100644 --- a/MediaBrowser.Common/Updates/GithubUpdater.cs +++ b/MediaBrowser.Common/Updates/GithubUpdater.cs @@ -184,20 +184,9 @@ namespace MediaBrowser.Common.Updates private bool IsAsset(Asset asset, string assetFilename, string version) { - var downloadFilename = Path.GetFileNameWithoutExtension(asset.browser_download_url) ?? string.Empty; - var assetExtension = Path.GetExtension(assetFilename); + var downloadFilename = Path.GetFileName(asset.browser_download_url) ?? string.Empty; assetFilename = assetFilename.Replace("{version}", version); - assetFilename = Path.GetFileNameWithoutExtension(assetFilename); - - var zipExtensions = new[] { ".zip", ".7z" }; - var extensionMatch = zipExtensions.Contains(Path.GetExtension(asset.browser_download_url) ?? string.Empty, StringComparer.OrdinalIgnoreCase) && - zipExtensions.Contains(assetExtension ?? string.Empty, StringComparer.OrdinalIgnoreCase); - - if (!extensionMatch) - { - return false; - } if (downloadFilename.IndexOf(assetFilename, StringComparison.OrdinalIgnoreCase) != -1) { From 26edcfefbb031a98f2d6f64b692bba07587614b7 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 27 Nov 2017 15:16:41 -0500 Subject: [PATCH 4/4] cache network data longer --- .../Networking/NetworkManager.cs | 37 +++++++++++++++++-- .../MediaEncoding/EncodingHelper.cs | 4 ++ SharedVersion.cs | 2 +- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/Emby.Server.Implementations/Networking/NetworkManager.cs b/Emby.Server.Implementations/Networking/NetworkManager.cs index d938359e9..50e9135b0 100644 --- a/Emby.Server.Implementations/Networking/NetworkManager.cs +++ b/Emby.Server.Implementations/Networking/NetworkManager.cs @@ -19,10 +19,43 @@ namespace Emby.Server.Implementations.Networking { protected ILogger Logger { get; private set; } private DateTime _lastRefresh; + private int NetworkCacheMinutes = 360; public NetworkManager(ILogger logger) { Logger = logger; + + try + { + NetworkChange.NetworkAddressChanged += NetworkChange_NetworkAddressChanged; + } + catch (Exception ex) + { + NetworkCacheMinutes = 15; + Logger.ErrorException("Error binding to NetworkAddressChanged event", ex); + } + + try + { + NetworkChange.NetworkAvailabilityChanged += NetworkChange_NetworkAvailabilityChanged; + } + catch (Exception ex) + { + NetworkCacheMinutes = 15; + Logger.ErrorException("Error binding to NetworkChange_NetworkAvailabilityChanged event", ex); + } + } + + private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) + { + Logger.Debug("NetworkAvailabilityChanged"); + _lastRefresh = DateTime.MinValue; + } + + private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e) + { + Logger.Debug("NetworkAddressChanged"); + _lastRefresh = DateTime.MinValue; } private List _localIpAddresses; @@ -30,11 +63,9 @@ namespace Emby.Server.Implementations.Networking public List GetLocalIpAddresses() { - const int cacheMinutes = 10; - lock (_localIpAddressSyncLock) { - var forceRefresh = (DateTime.UtcNow - _lastRefresh).TotalMinutes >= cacheMinutes; + var forceRefresh = (DateTime.UtcNow - _lastRefresh).TotalMinutes >= NetworkCacheMinutes; if (_localIpAddresses == null || forceRefresh) { diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 8f8791922..1fab6defc 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -393,6 +393,10 @@ namespace MediaBrowser.Controller.MediaEncoding { return "wmav2"; } + if (string.Equals(codec, "opus", StringComparison.OrdinalIgnoreCase)) + { + return "libopus"; + } return codec.ToLower(); } diff --git a/SharedVersion.cs b/SharedVersion.cs index 90e6929e2..14968dfa5 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.40.3")] +[assembly: AssemblyVersion("3.2.40.4")]