Address comments

This commit is contained in:
Bond_009 2020-04-25 15:29:59 +02:00
parent 851dda097e
commit a273ed9a57
2 changed files with 151 additions and 156 deletions

View File

@ -93,7 +93,7 @@ namespace Emby.Naming.Video
year = cleanDateTimeResult.Year;
if (extraResult.ExtraType == null
&& TryCleanString(cleanDateTimeResult.Name, out ReadOnlySpan<char> newName))
&& TryCleanString(name, out ReadOnlySpan<char> newName))
{
name = newName.ToString();
}

View File

@ -1,5 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using System.Collections.Generic;
using Emby.Naming.Common;
using Emby.Naming.Video;
using MediaBrowser.Model.Entities;
@ -11,9 +10,7 @@ namespace Jellyfin.Naming.Tests.Video
{
private readonly NamingOptions _namingOptions = new NamingOptions();
private class ResolveFileTestData : IEnumerable<object[]>
{
public IEnumerator<object[]> GetEnumerator()
public static IEnumerable<object[]> GetResolveFileTestData()
{
yield return new object[]
{
@ -179,11 +176,9 @@ namespace Jellyfin.Naming.Tests.Video
};
}
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
[Theory]
[ClassData(typeof(ResolveFileTestData))]
[MemberData(nameof(GetResolveFileTestData))]
public void ResolveFile_ValidFileName_Success(VideoFileInfo expectedResult)
{
var result = new VideoResolver(_namingOptions).ResolveFile(expectedResult.Path);