From b8834be83c4aaad7a47953f2d33be371d24095e8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 10 Sep 2017 16:40:31 -0400 Subject: [PATCH] update naming project to target .net standard --- Emby.Drawing/ImageProcessor.cs | 6 +++++ .../Emby.Server.Implementations.csproj | 7 +++-- .../Library/LibraryManager.cs | 27 +++++++++---------- .../Resolvers/Audio/MusicAlbumResolver.cs | 4 +-- .../Library/Resolvers/BaseVideoResolver.cs | 6 ++--- .../Library/Resolvers/Movies/MovieResolver.cs | 6 ++--- .../Library/Resolvers/TV/SeasonResolver.cs | 4 +-- .../Library/Resolvers/TV/SeriesResolver.cs | 6 ++--- Emby.Server.Implementations/packages.config | 1 - 9 files changed, 35 insertions(+), 32 deletions(-) diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 9e941b38c..c519d4e21 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -724,6 +724,12 @@ namespace Emby.Drawing .TrimStart('.') .Replace("jpeg", "jpg", StringComparison.OrdinalIgnoreCase); + // These are just jpg files renamed as tbn + if (string.Equals(inputFormat, "tbn", StringComparison.OrdinalIgnoreCase)) + { + return new Tuple(originalImagePath, dateModified); + } + if (!_imageEncoder.SupportedInputFormats.Contains(inputFormat, StringComparer.OrdinalIgnoreCase)) { try diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index bcda149d6..ccff29eef 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -654,16 +654,15 @@ {1d74413b-e7cf-455b-b021-f52bdf881542} SocketHttpListener + + ..\ThirdParty\emby\Emby.Naming.dll + ..\ThirdParty\emby\Emby.Server.MediaEncoding.dll ..\packages\Emby.XmlTv.1.0.10\lib\portable-net45+netstandard2.0+win8\Emby.XmlTv.dll - - ..\packages\MediaBrowser.Naming.1.0.7\lib\portable-net45+netstandard2.0+win8\MediaBrowser.Naming.dll - True - ..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll True diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 510ecee76..139435faa 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -14,10 +14,10 @@ using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Querying; -using MediaBrowser.Naming.Audio; -using MediaBrowser.Naming.Common; -using MediaBrowser.Naming.TV; -using MediaBrowser.Naming.Video; +using Emby.Naming.Audio; +using Emby.Naming.Common; +using Emby.Naming.TV; +using Emby.Naming.Video; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -38,7 +38,7 @@ using MediaBrowser.Model.Extensions; using MediaBrowser.Model.Library; using MediaBrowser.Model.Net; using SortOrder = MediaBrowser.Model.Entities.SortOrder; -using VideoResolver = MediaBrowser.Naming.Video.VideoResolver; +using VideoResolver = Emby.Naming.Video.VideoResolver; using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Dto; @@ -2346,7 +2346,7 @@ namespace Emby.Server.Implementations.Library public bool IsVideoFile(string path, LibraryOptions libraryOptions) { - var resolver = new VideoResolver(GetNamingOptions(), new NullLogger()); + var resolver = new VideoResolver(GetNamingOptions()); return resolver.IsVideoFile(path); } @@ -2373,8 +2373,7 @@ namespace Emby.Server.Implementations.Library public bool FillMissingEpisodeNumbersFromPath(Episode episode) { - var resolver = new EpisodeResolver(GetNamingOptions(), - new NullLogger()); + var resolver = new EpisodeResolver(GetNamingOptions()); var isFolder = episode.VideoType == VideoType.BluRay || episode.VideoType == VideoType.Dvd; @@ -2382,11 +2381,11 @@ namespace Emby.Server.Implementations.Library var episodeInfo = locationType == LocationType.FileSystem || locationType == LocationType.Offline ? resolver.Resolve(episode.Path, isFolder) : - new MediaBrowser.Naming.TV.EpisodeInfo(); + new Emby.Naming.TV.EpisodeInfo(); if (episodeInfo == null) { - episodeInfo = new MediaBrowser.Naming.TV.EpisodeInfo(); + episodeInfo = new Emby.Naming.TV.EpisodeInfo(); } var changed = false; @@ -2557,7 +2556,7 @@ namespace Emby.Server.Implementations.Library public ItemLookupInfo ParseName(string name) { - var resolver = new VideoResolver(GetNamingOptions(), new NullLogger()); + var resolver = new VideoResolver(GetNamingOptions()); var result = resolver.CleanDateTime(name); var cleanName = resolver.CleanString(result.Name); @@ -2578,7 +2577,7 @@ namespace Emby.Server.Implementations.Library .SelectMany(i => _fileSystem.GetFiles(i.FullName, _videoFileExtensions, false, false)) .ToList(); - var videoListResolver = new VideoListResolver(namingOptions, new NullLogger()); + var videoListResolver = new VideoListResolver(namingOptions); var videos = videoListResolver.Resolve(fileSystemChildren); @@ -2626,7 +2625,7 @@ namespace Emby.Server.Implementations.Library .SelectMany(i => _fileSystem.GetFiles(i.FullName, _videoFileExtensions, false, false)) .ToList(); - var videoListResolver = new VideoListResolver(namingOptions, new NullLogger()); + var videoListResolver = new VideoListResolver(namingOptions); var videos = videoListResolver.Resolve(fileSystemChildren); @@ -2752,7 +2751,7 @@ namespace Emby.Server.Implementations.Library private void SetExtraTypeFromFilename(Video item) { - var resolver = new ExtraResolver(GetNamingOptions(), new NullLogger(), new RegexProvider()); + var resolver = new ExtraResolver(GetNamingOptions(), new RegexProvider()); var result = resolver.GetExtraInfo(item.Path); diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs index 70fe8d9ef..b8ec41805 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs @@ -4,7 +4,7 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Resolvers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; -using MediaBrowser.Naming.Audio; +using Emby.Naming.Audio; using System; using System.Collections.Generic; using System.IO; @@ -165,7 +165,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio { var namingOptions = ((LibraryManager)_libraryManager).GetNamingOptions(); - var parser = new AlbumParser(namingOptions, new NullLogger()); + var parser = new AlbumParser(namingOptions); var result = parser.ParseMultiPart(path); return result.IsMultiPart; diff --git a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs index fa4f026f4..e3200a099 100644 --- a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs @@ -1,7 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Entities; -using MediaBrowser.Naming.Video; +using Emby.Naming.Video; using System; using System.IO; using System.Linq; @@ -50,7 +50,7 @@ namespace Emby.Server.Implementations.Library.Resolvers var namingOptions = ((LibraryManager)LibraryManager).GetNamingOptions(); // If the path is a file check for a matching extensions - var parser = new MediaBrowser.Naming.Video.VideoResolver(namingOptions, new NullLogger()); + var parser = new Emby.Naming.Video.VideoResolver(namingOptions); if (args.IsDirectory) { @@ -258,7 +258,7 @@ namespace Emby.Server.Implementations.Library.Resolvers { var namingOptions = ((LibraryManager)LibraryManager).GetNamingOptions(); - var resolver = new Format3DParser(namingOptions, new NullLogger()); + var resolver = new Format3DParser(namingOptions); var result = resolver.Parse(video.Path); Set3DFormat(video, result.Is3D, result.Format3D); diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 1e5c0beed..cd1264754 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -6,7 +6,7 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Resolvers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Extensions; -using MediaBrowser.Naming.Video; +using Emby.Naming.Video; using System; using System.Collections.Generic; using System.IO; @@ -138,7 +138,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies var namingOptions = ((LibraryManager)LibraryManager).GetNamingOptions(); - var resolver = new VideoListResolver(namingOptions, new NullLogger()); + var resolver = new VideoListResolver(namingOptions); var resolverResult = resolver.Resolve(files, suppportMultiEditions).ToList(); var result = new MultiItemResolverResult @@ -490,7 +490,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies } var namingOptions = ((LibraryManager)LibraryManager).GetNamingOptions(); - var resolver = new StackResolver(namingOptions, new NullLogger()); + var resolver = new StackResolver(namingOptions); var result = resolver.ResolveDirectories(folderPaths); diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs index 830bd9d85..bbe1bba85 100644 --- a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs @@ -3,8 +3,8 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Globalization; -using MediaBrowser.Naming.Common; -using MediaBrowser.Naming.TV; +using Emby.Naming.Common; +using Emby.Naming.TV; namespace Emby.Server.Implementations.Library.Resolvers.TV { diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs index e1c18c913..9f982f9ce 100644 --- a/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs @@ -4,8 +4,8 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Resolvers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; -using MediaBrowser.Naming.Common; -using MediaBrowser.Naming.TV; +using Emby.Naming.Common; +using Emby.Naming.TV; using System; using System.Collections.Generic; using System.IO; @@ -163,7 +163,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV var allowOptimisticEpisodeDetection = isTvContentType; var namingOptions = ((LibraryManager)libraryManager).GetNamingOptions(allowOptimisticEpisodeDetection); - var episodeResolver = new MediaBrowser.Naming.TV.EpisodeResolver(namingOptions, new NullLogger()); + var episodeResolver = new Emby.Naming.TV.EpisodeResolver(namingOptions); var episodeInfo = episodeResolver.Resolve(fullName, false, false); if (episodeInfo != null && episodeInfo.EpisodeNumber.HasValue) { diff --git a/Emby.Server.Implementations/packages.config b/Emby.Server.Implementations/packages.config index 5b869221a..c27b8ac26 100644 --- a/Emby.Server.Implementations/packages.config +++ b/Emby.Server.Implementations/packages.config @@ -1,7 +1,6 @@  -