From 992ad9c2d93e6d2ec33af670929db6e4d2cb3bcf Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:54:44 -0400 Subject: [PATCH 1/8] fix plugin uninstall --- Emby.Server.Implementations/Updates/InstallationManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index e7aa402f25..eed17fb66d 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -668,7 +668,7 @@ namespace Emby.Server.Implementations.Updates _logger.Info("Deleting plugin file {0}", path); // Make this case-insensitive to account for possible incorrect assembly naming - var file = _fileSystem.GetFilePaths(path) + var file = _fileSystem.GetFilePaths(_fileSystem.GetDirectoryName(path)) .FirstOrDefault(i => string.Equals(i, path, StringComparison.OrdinalIgnoreCase)); if (!string.IsNullOrWhiteSpace(file)) From 00507972be8a1ab4faefe6fbed110cde3516d0ae Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:55:05 -0400 Subject: [PATCH 2/8] dispose stream in PhotoProvider --- Emby.Photos/PhotoProvider.cs | 157 ++++++++++++++++++----------------- 1 file changed, 80 insertions(+), 77 deletions(-) diff --git a/Emby.Photos/PhotoProvider.cs b/Emby.Photos/PhotoProvider.cs index 006f29c2fa..57047cf81e 100644 --- a/Emby.Photos/PhotoProvider.cs +++ b/Emby.Photos/PhotoProvider.cs @@ -35,110 +35,113 @@ namespace Emby.Photos try { - using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(item.Path), _fileSystem.OpenRead(item.Path), null))) + using (var fileStream = _fileSystem.OpenRead(item.Path)) { - var image = file as TagLib.Image.File; - - var tag = file.GetTag(TagTypes.TiffIFD) as IFDTag; - - if (tag != null) + using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(item.Path), fileStream, null))) { - var structure = tag.Structure; + var image = file as TagLib.Image.File; + + var tag = file.GetTag(TagTypes.TiffIFD) as IFDTag; - if (structure != null) + if (tag != null) { - var exif = structure.GetEntry(0, (ushort)IFDEntryTag.ExifIFD) as SubIFDEntry; + var structure = tag.Structure; - if (exif != null) + if (structure != null) { - var exifStructure = exif.Structure; + var exif = structure.GetEntry(0, (ushort)IFDEntryTag.ExifIFD) as SubIFDEntry; - if (exifStructure != null) + if (exif != null) { - var entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ApertureValue) as RationalIFDEntry; - - if (entry != null) - { - double val = entry.Value.Numerator; - val /= entry.Value.Denominator; - item.Aperture = val; - } - - entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ShutterSpeedValue) as RationalIFDEntry; + var exifStructure = exif.Structure; - if (entry != null) + if (exifStructure != null) { - double val = entry.Value.Numerator; - val /= entry.Value.Denominator; - item.ShutterSpeed = val; + var entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ApertureValue) as RationalIFDEntry; + + if (entry != null) + { + double val = entry.Value.Numerator; + val /= entry.Value.Denominator; + item.Aperture = val; + } + + entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ShutterSpeedValue) as RationalIFDEntry; + + if (entry != null) + { + double val = entry.Value.Numerator; + val /= entry.Value.Denominator; + item.ShutterSpeed = val; + } } } } } - } - item.CameraMake = image.ImageTag.Make; - item.CameraModel = image.ImageTag.Model; + item.CameraMake = image.ImageTag.Make; + item.CameraModel = image.ImageTag.Model; - item.Width = image.Properties.PhotoWidth; - item.Height = image.Properties.PhotoHeight; + item.Width = image.Properties.PhotoWidth; + item.Height = image.Properties.PhotoHeight; - var rating = image.ImageTag.Rating; - if (rating.HasValue) - { - item.CommunityRating = rating; - } - else - { - item.CommunityRating = null; - } + var rating = image.ImageTag.Rating; + if (rating.HasValue) + { + item.CommunityRating = rating; + } + else + { + item.CommunityRating = null; + } - item.Overview = image.ImageTag.Comment; + item.Overview = image.ImageTag.Comment; - if (!string.IsNullOrWhiteSpace(image.ImageTag.Title)) - { - item.Name = image.ImageTag.Title; - } + if (!string.IsNullOrWhiteSpace(image.ImageTag.Title)) + { + item.Name = image.ImageTag.Title; + } - var dateTaken = image.ImageTag.DateTime; - if (dateTaken.HasValue) - { - item.DateCreated = dateTaken.Value; - item.PremiereDate = dateTaken.Value; - item.ProductionYear = dateTaken.Value.Year; - } + var dateTaken = image.ImageTag.DateTime; + if (dateTaken.HasValue) + { + item.DateCreated = dateTaken.Value; + item.PremiereDate = dateTaken.Value; + item.ProductionYear = dateTaken.Value.Year; + } - item.Genres = image.ImageTag.Genres.ToList(); - item.Tags = image.ImageTag.Keywords.ToList(); - item.Software = image.ImageTag.Software; + item.Genres = image.ImageTag.Genres.ToList(); + item.Tags = image.ImageTag.Keywords.ToList(); + item.Software = image.ImageTag.Software; - if (image.ImageTag.Orientation == TagLib.Image.ImageOrientation.None) - { - item.Orientation = null; - } - else - { - MediaBrowser.Model.Drawing.ImageOrientation orientation; - if (Enum.TryParse(image.ImageTag.Orientation.ToString(), true, out orientation)) + if (image.ImageTag.Orientation == TagLib.Image.ImageOrientation.None) { - item.Orientation = orientation; + item.Orientation = null; + } + else + { + MediaBrowser.Model.Drawing.ImageOrientation orientation; + if (Enum.TryParse(image.ImageTag.Orientation.ToString(), true, out orientation)) + { + item.Orientation = orientation; + } } - } - item.ExposureTime = image.ImageTag.ExposureTime; - item.FocalLength = image.ImageTag.FocalLength; + item.ExposureTime = image.ImageTag.ExposureTime; + item.FocalLength = image.ImageTag.FocalLength; - item.Latitude = image.ImageTag.Latitude; - item.Longitude = image.ImageTag.Longitude; - item.Altitude = image.ImageTag.Altitude; + item.Latitude = image.ImageTag.Latitude; + item.Longitude = image.ImageTag.Longitude; + item.Altitude = image.ImageTag.Altitude; - if (image.ImageTag.ISOSpeedRatings.HasValue) - { - item.IsoSpeedRating = Convert.ToInt32(image.ImageTag.ISOSpeedRatings.Value); - } - else - { - item.IsoSpeedRating = null; + if (image.ImageTag.ISOSpeedRatings.HasValue) + { + item.IsoSpeedRating = Convert.ToInt32(image.ImageTag.ISOSpeedRatings.Value); + } + else + { + item.IsoSpeedRating = null; + } } } } From 4acaeecca4227380f2a1432ac682543223ec9b9e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:55:40 -0400 Subject: [PATCH 3/8] update GetImageSize --- Emby.Drawing/ImageProcessor.cs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 82181238bb..ad6ca7d70b 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -513,20 +513,25 @@ namespace Emby.Drawing /// ImageSize. private ImageSize GetImageSizeInternal(string path, bool allowSlowMethod) { - // Can't use taglib because it keeps a lock on the file //try //{ - // using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(path), _fileSystem.OpenRead(path), null))) + // using (var fileStream = _fileSystem.OpenRead(path)) // { - // var image = file as TagLib.Image.File; - - // var properties = image.Properties; - - // return new ImageSize + // using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(path), fileStream, null))) // { - // Height = properties.PhotoHeight, - // Width = properties.PhotoWidth - // }; + // var image = file as TagLib.Image.File; + + // if (image != null) + // { + // var properties = image.Properties; + + // return new ImageSize + // { + // Height = properties.PhotoHeight, + // Width = properties.PhotoWidth + // }; + // } + // } // } //} //catch From bcf28f3e9ca8fd136c2a278efc9ed6c1fd873a9c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:56:06 -0400 Subject: [PATCH 4/8] update file options --- MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index fcf57cebe2..7e4e90924d 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -234,11 +234,11 @@ namespace MediaBrowser.Api.Playback.Hls try { - return FileSystem.GetFileStream(tmpPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, true); + return FileSystem.GetFileStream(tmpPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, FileOpenOptions.Asynchronous | FileOpenOptions.SequentialScan); } catch (IOException) { - return FileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, true); + return FileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, FileOpenOptions.Asynchronous | FileOpenOptions.SequentialScan); } } From cd4d170267a2489eb9ed736e786b71d6d1347772 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:56:29 -0400 Subject: [PATCH 5/8] add property --- MediaBrowser.Model/Dto/MediaSourceInfo.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs index d0655d90bc..c93eca0e79 100644 --- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs +++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs @@ -31,6 +31,7 @@ namespace MediaBrowser.Model.Dto public bool ReadAtNativeFramerate { get; set; } public bool IgnoreDts { get; set; } public bool IgnoreIndex { get; set; } + public bool GenPtsInput { get; set; } public bool SupportsTranscoding { get; set; } public bool SupportsDirectStream { get; set; } public bool SupportsDirectPlay { get; set; } From f2284af82ab56cfbef7679a1ae6ecb8ebcb4ea89 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 15:17:35 -0400 Subject: [PATCH 6/8] update GenPtsInput --- MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index 409dec482c..f25b4ba3d2 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -59,7 +59,7 @@ namespace MediaBrowser.Controller.MediaEncoding { get { - return false; + return MediaSource.GenPtsInput; } } From 6a628e8d2e711b7f7dccc20629fdac37de41a5a8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 15:20:31 -0400 Subject: [PATCH 7/8] update vsync --- .../MediaEncoding/EncodingJobInfo.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index f25b4ba3d2..9b89e8f5aa 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -93,11 +93,13 @@ namespace MediaBrowser.Controller.MediaEncoding { get { - // For live tv + recordings - if (string.Equals(InputContainer, "mpegts", StringComparison.OrdinalIgnoreCase) || - string.Equals(InputContainer, "ts", StringComparison.OrdinalIgnoreCase)) + // For live tv + in progress recordings + if (string.Equals(InputContainer, "mpegts", StringComparison.OrdinalIgnoreCase) || string.Equals(InputContainer, "ts", StringComparison.OrdinalIgnoreCase)) { - return "cfr"; + if (!MediaSource.RunTimeTicks.HasValue) + { + return "cfr"; + } } return "-1"; From bdc546ed85dfb8389184234ac74c6cc7b4046515 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 15:30:49 -0400 Subject: [PATCH 8/8] 3.2.16.3 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index cf3eee5469..45d6445ff8 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.16.2")] +[assembly: AssemblyVersion("3.2.16.3")]