update naming project to target .net standard

This commit is contained in:
Luke Pulverenti 2017-09-10 16:40:31 -04:00
parent 3badff870b
commit b8834be83c
9 changed files with 35 additions and 32 deletions

View File

@ -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<string, DateTime>(originalImagePath, dateModified);
}
if (!_imageEncoder.SupportedInputFormats.Contains(inputFormat, StringComparer.OrdinalIgnoreCase))
{
try

View File

@ -654,16 +654,15 @@
<Project>{1d74413b-e7cf-455b-b021-f52bdf881542}</Project>
<Name>SocketHttpListener</Name>
</ProjectReference>
<Reference Include="Emby.Naming">
<HintPath>..\ThirdParty\emby\Emby.Naming.dll</HintPath>
</Reference>
<Reference Include="Emby.Server.MediaEncoding">
<HintPath>..\ThirdParty\emby\Emby.Server.MediaEncoding.dll</HintPath>
</Reference>
<Reference Include="Emby.XmlTv, Version=1.0.6387.29335, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Emby.XmlTv.1.0.10\lib\portable-net45+netstandard2.0+win8\Emby.XmlTv.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Naming, Version=1.0.6447.2217, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Naming.1.0.7\lib\portable-net45+netstandard2.0+win8\MediaBrowser.Naming.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
<Private>True</Private>

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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
{

View File

@ -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)
{

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Emby.XmlTv" version="1.0.10" targetFramework="net46" />
<package id="MediaBrowser.Naming" version="1.0.7" targetFramework="net46" />
<package id="ServiceStack.Text" version="4.5.8" targetFramework="net46" />
<package id="SharpCompress" version="0.14.0" targetFramework="net46" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net46" />