Skip to content

Commit

Permalink
Adapt to breaking changes made by Jellyfin 10.9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jwueller committed May 13, 2024
1 parent 6aeac52 commit 478ad2c
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<ProjectVersion>1.4.0.0</ProjectVersion>
<ProjectVersion>1.5.0.0</ProjectVersion>
<Version>$(ProjectVersion)</Version>
<AssemblyVersion>$(ProjectVersion)</AssemblyVersion>
<FileVersion>$(ProjectVersion)</FileVersion>
Expand Down
8 changes: 4 additions & 4 deletions JWueller.Jellyfin.OnePace.Tests/ArcIdentifierTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public ArcIdentifierTests()
[InlineData("clkso3n3l000008l751pk86u4", "Romance Dawn")]
[InlineData("clkso3uwi000108l724rj9vc0", "Orange Town")]
[InlineData("clkso3zi6000208l7bhq7dtn6", "Syrup Village")]
public async void ShouldIdentifyArcByProviderId(string id, string expectedInvariantTitle)
public async Task ShouldIdentifyArcByProviderId(string id, string expectedInvariantTitle)
{
var itemLookupInfo = new ItemLookupInfo();
itemLookupInfo.SetOnePaceId(id);
Expand All @@ -119,7 +119,7 @@ public async void ShouldIdentifyArcByProviderId(string id, string expectedInvari
[InlineData("/path/to/One Pace/001", "Romance Dawn")] // rank (padded)
[InlineData("/path/to/One Pace/[One Pace][8-21] Orange Town [1080p]", "Orange Town")] // release name
[InlineData("/path/to/One Pace/[One Pace][23-41] Syrup Village [480p]", "Syrup Village")] // release name
public async void ShouldIdentifyArcByPath(string path, string expectedInvariantTitle)
public async Task ShouldIdentifyArcByPath(string path, string expectedInvariantTitle)
{
var itemLookupInfo = new ItemLookupInfo
{
Expand All @@ -139,7 +139,7 @@ public async void ShouldIdentifyArcByPath(string path, string expectedInvariantT
[Theory]
[InlineData("/path/to/One Pace/Enies Lobby", "Enies Lobby")]
[InlineData("/path/to/One Pace/Post-Enies Lobby", "Post-Enies Lobby")]
public async void ShouldPreferLongerTitles(string path, string expectedInvariantTitle)
public async Task ShouldPreferLongerTitles(string path, string expectedInvariantTitle)
{
var itemLookupInfo = new ItemLookupInfo
{
Expand All @@ -156,7 +156,7 @@ public async void ShouldPreferLongerTitles(string path, string expectedInvariant
/// It's 'Whisky Peak', not 'Whiskey Peak', but its such a common typo that we need to handle it.
/// </summary>
[Fact]
public async void ShouldIdentifyWhiskyPeakDespiteTypo()
public async Task ShouldIdentifyWhiskyPeakDespiteTypo()
{
var itemLookupInfo = new ItemLookupInfo
{
Expand Down
8 changes: 4 additions & 4 deletions JWueller.Jellyfin.OnePace.Tests/EpisodeIdentifierTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public EpisodeIdentifierTests()
[InlineData("clkso9t8u000108jk5lbu2409", "Romance Dawn 02")]
[InlineData("clkso9z6n000208jk069u63ih", "Orange Town 01")]
[InlineData("clksoa57k000308jkb3cu73n8", "Orange Town 02")]
public async void ShouldIdentifyEpisodeByProviderId(string episodeId, string expectedInvariantTitle)
public async Task ShouldIdentifyEpisodeByProviderId(string episodeId, string expectedInvariantTitle)
{
var itemLookupInfo = new ItemLookupInfo();
itemLookupInfo.SetOnePaceId(episodeId);
Expand All @@ -152,7 +152,7 @@ public async void ShouldIdentifyEpisodeByProviderId(string episodeId, string exp
[InlineData("/path/to/One Pace/Orange Town 01.mkv", "Orange Town 01")] // invariant title only
[InlineData("/path/to/One Pace/D767799C.mkv", "Romance Dawn 01")] // uppercase CRC-32 only
[InlineData("/path/to/One Pace/c7ca5080.mkv", "Orange Town 01")] // lowercase CRC-32 only
public async void ShouldIdentifyEpisodeByPath(string path, string expectedInvariantTitle)
public async Task ShouldIdentifyEpisodeByPath(string path, string expectedInvariantTitle)
{
var itemLookupInfo = new ItemLookupInfo
{
Expand All @@ -172,7 +172,7 @@ public async void ShouldIdentifyEpisodeByPath(string path, string expectedInvari
[Theory]
[InlineData("/path/to/One Pace/Enies Lobby 01.mkv", "Enies Lobby 01")]
[InlineData("/path/to/One Pace/Post-Enies Lobby 01.mkv", "Post-Enies Lobby 01")]
public async void ShouldPreferLongerTitles(string path, string expectedInvariantTitle)
public async Task ShouldPreferLongerTitles(string path, string expectedInvariantTitle)
{
var itemLookupInfo = new ItemLookupInfo
{
Expand All @@ -189,7 +189,7 @@ public async void ShouldPreferLongerTitles(string path, string expectedInvariant
/// It's 'Whisky Peak', not 'Whiskey Peak', but its such a common typo that we need to handle it.
/// </summary>
[Fact]
public async void ShouldIdentifyWhiskyPeakDespiteTypo()
public async Task ShouldIdentifyWhiskyPeakDespiteTypo()
{
var itemLookupInfo = new ItemLookupInfo
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
6 changes: 3 additions & 3 deletions JWueller.Jellyfin.OnePace.Tests/SeriesIdentifierTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public SeriesIdentifierTests()
}

[Fact]
public async void ShouldIdentifySeriesByProviderId()
public async Task ShouldIdentifySeriesByProviderId()
{
var itemLookupInfo = new ItemLookupInfo();
itemLookupInfo.SetOnePaceId(Plugin.DummySeriesId);
Expand All @@ -47,7 +47,7 @@ public async void ShouldIdentifySeriesByProviderId()
[Theory]
[InlineData("/path/to/One Pace")]
[InlineData("/path/to/One Piece [One Pace]")]
public async void ShouldIdentifySeriesByPath(string path)
public async Task ShouldIdentifySeriesByPath(string path)
{
var itemLookupInfo = new ItemLookupInfo
{
Expand All @@ -63,7 +63,7 @@ public async void ShouldIdentifySeriesByPath(string path)
[Theory]
[InlineData("One Pace")]
[InlineData("One Piece [One Pace]")]
public async void ShouldIdentifySeriesByName(string name)
public async Task ShouldIdentifySeriesByName(string name)
{
var itemLookupInfo = new ItemLookupInfo
{
Expand Down
26 changes: 13 additions & 13 deletions JWueller.Jellyfin.OnePace.Tests/WebRepositoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public WebRepositoryTests()
}

[Fact]
public async void ShouldFindSeries()
public async Task ShouldFindSeries()
{
var result = await _webRepository.FindSeriesAsync(CancellationToken.None);

Expand All @@ -247,7 +247,7 @@ public async void ShouldFindSeries()
}

[Fact]
public async void ShouldFindAllArcs()
public async Task ShouldFindAllArcs()
{
var result = await _webRepository.FindAllArcsAsync(CancellationToken.None);

Expand All @@ -258,7 +258,7 @@ public async void ShouldFindAllArcs()
}

[Fact]
public async void ShouldFindAllEpisodes()
public async Task ShouldFindAllEpisodes()
{
var result = await _webRepository.FindAllEpisodesAsync(CancellationToken.None);

Expand All @@ -273,7 +273,7 @@ public async void ShouldFindAllEpisodes()
[Theory]
[InlineData("clksypeix000008jw066ye7lo", "Romance Dawn")]
[InlineData("clksyq4q5000108jwgihd6jud", "Orange Town")]
public async void ShouldFindArcById(string arcId, string expectedInvariantTitle)
public async Task ShouldFindArcById(string arcId, string expectedInvariantTitle)
{
var result = await _webRepository.FindArcByIdAsync(arcId, CancellationToken.None);

Expand All @@ -286,7 +286,7 @@ public async void ShouldFindArcById(string arcId, string expectedInvariantTitle)
[InlineData("clksys3c2000308jwa08325o7", "Romance Dawn 02")]
[InlineData("clksysvim000408jw6anzden8", "Romance Dawn 03")]
[InlineData("clksytlbt000508jw6r9x1jb1", "Orange Town 01")]
public async void ShouldFindEpisodeById(string episodeId, string expectedInvariantTitle)
public async Task ShouldFindEpisodeById(string episodeId, string expectedInvariantTitle)
{
var result = await _webRepository.FindEpisodeByIdAsync(episodeId, CancellationToken.None);

Expand All @@ -300,7 +300,7 @@ public async void ShouldFindEpisodeById(string episodeId, string expectedInvaria
/// <see href="https://github.com/jwueller/jellyfin-plugin-onepace/issues/12"/>
/// <see href="https://github.com/jwueller/jellyfin-plugin-onepace/issues/28"/>
[Fact]
public async void ShouldFindEpisodeWithMatchingArcById()
public async Task ShouldFindEpisodeWithMatchingArcById()
{
var result = await _webRepository.FindEpisodeByIdAsync("clksyqwxl000208jw82wh3y0g", CancellationToken.None);

Expand All @@ -313,7 +313,7 @@ public async void ShouldFindEpisodeWithMatchingArcById()
[InlineData("en", "One Pace en", "English description")]
[InlineData("de", "One Pace de", "Deutsche Beschreibung")]
[InlineData("invalid", "One Pace en", "English description")] // fallback
public async void ShouldFindBestSeriesLocalization(string languageCode, string expectedTitle,
public async Task ShouldFindBestSeriesLocalization(string languageCode, string expectedTitle,
string expectedDescription)
{
var result = await _webRepository.FindBestLocalizationBySeriesAsync(languageCode, CancellationToken.None);
Expand All @@ -328,7 +328,7 @@ public async void ShouldFindBestSeriesLocalization(string languageCode, string e
[InlineData("clksyq4q5000108jwgihd6jud", "en", "Orange Town en", "English description for Orange Town")]
[InlineData("clksyq4q5000108jwgihd6jud", "de", "Orange Town de", "Deutsche Beschreibung für Orange Town")]
[InlineData("clksyq4q5000108jwgihd6jud", "invalid", "Orange Town en", "English description for Orange Town")] // fallback
public async void ShouldFindBestArcLocalization(
public async Task ShouldFindBestArcLocalization(
string arcId,
string languageCode,
string expectedTitle,
Expand All @@ -345,7 +345,7 @@ public async void ShouldFindBestArcLocalization(
[InlineData("clksyqwxl000208jw82wh3y0g", "de", "Romance Dawn 01 de", "Deutsche Beschreibung für Romance Dawn 01")]
[InlineData("clksyqwxl000208jw82wh3y0g", "en", "Romance Dawn 01 en", "English description for Romance Dawn 01")]
[InlineData("clksyqwxl000208jw82wh3y0g", "invalid", "Romance Dawn 01 en", "English description for Romance Dawn 01")] // fallback
public async void ShouldFindBestEpisodeLocalization(
public async Task ShouldFindBestEpisodeLocalization(
string episodeId,
string languageCode,
string expectedTitle,
Expand All @@ -360,7 +360,7 @@ public async void ShouldFindBestEpisodeLocalization(
}

[Fact]
public async void ShouldFindSeriesLogoArt()
public async Task ShouldFindSeriesLogoArt()
{
var result = await _webRepository.FindAllLogoArtBySeriesAsync(CancellationToken.None);

Expand All @@ -369,7 +369,7 @@ public async void ShouldFindSeriesLogoArt()
}

[Fact]
public async void ShouldFindSeriesCoverArt()
public async Task ShouldFindSeriesCoverArt()
{
var result = await _webRepository.FindAllCoverArtBySeriesAsync(CancellationToken.None);

Expand All @@ -379,7 +379,7 @@ public async void ShouldFindSeriesCoverArt()
[Theory]
[InlineData("clksypeix000008jw066ye7lo", 4)]
[InlineData("clksyq4q5000108jwgihd6jud", 1)]
public async void ShouldFindAllArcCoverArt(string arcId, int expectedCoverArtCount)
public async Task ShouldFindAllArcCoverArt(string arcId, int expectedCoverArtCount)
{
var result = await _webRepository.FindAllCoverArtByArcIdAsync(arcId, CancellationToken.None);

Expand All @@ -391,7 +391,7 @@ public async void ShouldFindAllArcCoverArt(string arcId, int expectedCoverArtCou
[InlineData("clksyqwxl000208jw82wh3y0g", 3)]
[InlineData("clksys3c2000308jwa08325o7", 1)]
[InlineData("clksytlbt000508jw6r9x1jb1", 2)]
public async void ShouldFindAllEpisodeCoverArt(string episodeId, int expectedCoverArtCount)
public async Task ShouldFindAllEpisodeCoverArt(string episodeId, int expectedCoverArtCount)
{
var result = await _webRepository.FindAllCoverArtByEpisodeIdAsync(episodeId, CancellationToken.None);

Expand Down
2 changes: 1 addition & 1 deletion JWueller.Jellyfin.OnePace/JWueller.Jellyfin.OnePace.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>JWueller.Jellyfin.OnePace</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
5 changes: 3 additions & 2 deletions JWueller.Jellyfin.OnePace/ServiceRegistrator.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
using Microsoft.Extensions.DependencyInjection;

namespace JWueller.Jellyfin.OnePace;
Expand All @@ -9,7 +10,7 @@ namespace JWueller.Jellyfin.OnePace;
public class ServiceRegistrator : IPluginServiceRegistrator
{
/// <inheritdoc/>
public void RegisterServices(IServiceCollection serviceCollection)
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{
serviceCollection.AddSingleton<IRepository, WebRepository>();
}
Expand Down
1 change: 1 addition & 0 deletions changelogs/1.5.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adapt to breaking changes by Jellyfin 10.9.x
4 changes: 2 additions & 2 deletions meta.template.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: "One Pace"
guid: "1c0bf35e-3df4-47cc-8a4e-e3865de60d2f"
targetAbi: "10.8.0.0"
framework: "net6.0"
targetAbi: "10.9.1.0"
framework: "net8.0"
overview: "Metadata and cover art integration for the One Pace project"
description: >-
Please report bugs at https://github.com/jwueller/jellyfin-plugin-onepace
Expand Down

0 comments on commit 478ad2c

Please sign in to comment.