Browse Source

more missing metadata fixes (#354)

* more missing metadata fixes

* update mudblazor
pull/356/head
Jason Dove 5 years ago committed by GitHub
parent
commit
0638ac8a5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 47
      ErsatzTV.Core/Scheduling/MultiPartEpisodeGrouper.cs
  2. 2
      ErsatzTV/ErsatzTV.csproj

47
ErsatzTV.Core/Scheduling/MultiPartEpisodeGrouper.cs

@ -121,32 +121,35 @@ namespace ErsatzTV.Core.Scheduling @@ -121,32 +121,35 @@ namespace ErsatzTV.Core.Scheduling
private static Option<int> FindPartNumber(Episode e)
{
const string PATTERN = @"^.*\((\d+)\)( - .*)?$";
Match match = Regex.Match(e.EpisodeMetadata.Head().Title, PATTERN);
if (match.Success && int.TryParse(match.Groups[1].Value, out int value1))
foreach (EpisodeMetadata metadata in e.EpisodeMetadata.HeadOrNone())
{
return value1;
}
const string PATTERN = @"^.*\((\d+)\)( - .*)?$";
Match match = Regex.Match(metadata.Title ?? string.Empty, PATTERN);
if (match.Success && int.TryParse(match.Groups[1].Value, out int value1))
{
return value1;
}
const string PATTERN_2 = @"^.*\(?Part (\d+)\)?$";
Match match2 = Regex.Match(e.EpisodeMetadata.Head().Title, PATTERN_2);
if (match2.Success && int.TryParse(match2.Groups[1].Value, out int value2))
{
return value2;
}
const string PATTERN_2 = @"^.*\(?Part (\d+)\)?$";
Match match2 = Regex.Match(metadata.Title ?? string.Empty, PATTERN_2);
if (match2.Success && int.TryParse(match2.Groups[1].Value, out int value2))
{
return value2;
}
const string PATTERN_3 = @"^.*\(([MDCLXVI]+)\)( - .*)?$";
Match match3 = Regex.Match(e.EpisodeMetadata.Head().Title, PATTERN_3);
if (match3.Success && TryParseRoman(match3.Groups[1].Value, out int value3))
{
return value3;
}
const string PATTERN_3 = @"^.*\(([MDCLXVI]+)\)( - .*)?$";
Match match3 = Regex.Match(metadata.Title ?? string.Empty, PATTERN_3);
if (match3.Success && TryParseRoman(match3.Groups[1].Value, out int value3))
{
return value3;
}
const string PATTERN_4 = @"^.*Part (\w+)$";
Match match4 = Regex.Match(e.EpisodeMetadata.Head().Title, PATTERN_4);
if (match4.Success && TryParseEnglish(match4.Groups[1].Value, out int value4))
{
return value4;
const string PATTERN_4 = @"^.*Part (\w+)$";
Match match4 = Regex.Match(metadata.Title ?? string.Empty, PATTERN_4);
if (match4.Success && TryParseEnglish(match4.Groups[1].Value, out int value4))
{
return value4;
}
}
return None;

2
ErsatzTV/ErsatzTV.csproj

@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MudBlazor" Version="5.1.2" />
<PackageReference Include="MudBlazor" Version="5.1.3" />
<PackageReference Include="NaturalSort.Extension" Version="3.1.0" />
<PackageReference Include="PPioli.FluentValidation.Blazor" Version="5.0.0" />
<PackageReference Include="Refit.HttpClientFactory" Version="6.0.94" />

Loading…
Cancel
Save