diff --git a/Plugins Store/Totoro.Plugins.Anime.AllAnime.dll b/Plugins Store/Totoro.Plugins.Anime.AllAnime.dll index dcba3df9..9a221868 100644 Binary files a/Plugins Store/Totoro.Plugins.Anime.AllAnime.dll and b/Plugins Store/Totoro.Plugins.Anime.AllAnime.dll differ diff --git a/Plugins/Anime/Totoro.Plugins.Anime.AllAnime.Tests/CatalogTests.cs b/Plugins/Anime/Totoro.Plugins.Anime.AllAnime.Tests/CatalogTests.cs index 241aa928..0baef328 100644 --- a/Plugins/Anime/Totoro.Plugins.Anime.AllAnime.Tests/CatalogTests.cs +++ b/Plugins/Anime/Totoro.Plugins.Anime.AllAnime.Tests/CatalogTests.cs @@ -5,19 +5,14 @@ namespace Totoro.Plugins.Anime.AllAnime.Tests; [ExcludeFromCodeCoverage] -public class CatalogTests +public class CatalogTests(ITestOutputHelper output) { - private readonly ITestOutputHelper _output; + private readonly ITestOutputHelper _output = output; private readonly JsonSerializerOptions _searializerOption = new() { WriteIndented = true }; - public CatalogTests(ITestOutputHelper output) - { - _output = output; - } - [Theory] [InlineData("hyouka")] - [InlineData("one pi")] + [InlineData("hyakkano")] public async Task Search(string query) { // arrange diff --git a/Plugins/Anime/Totoro.Plugins.Anime.AllAnime.Tests/StreamProviderTests.cs b/Plugins/Anime/Totoro.Plugins.Anime.AllAnime.Tests/StreamProviderTests.cs index 29d341ec..1d435208 100644 --- a/Plugins/Anime/Totoro.Plugins.Anime.AllAnime.Tests/StreamProviderTests.cs +++ b/Plugins/Anime/Totoro.Plugins.Anime.AllAnime.Tests/StreamProviderTests.cs @@ -6,25 +6,23 @@ namespace Totoro.Plugins.Anime.AllAnime.Tests; [ExcludeFromCodeCoverage] -public class StreamProviderTests +public class StreamProviderTests(ITestOutputHelper output) { public const string Hyouka = "hyouka"; + public const string Hyakkano = "hyakkano"; - private readonly ITestOutputHelper _output; + private readonly ITestOutputHelper _output = output; private readonly JsonSerializerOptions _searializerOption = new() { WriteIndented = true }; private readonly Dictionary _urlMap = new() { - { Hyouka, Url.Combine(Config.Url, "/anime/dxxqKsaMhdrdQxczP") } + { Hyouka, Url.Combine(Config.Url, "/anime/dxxqKsaMhdrdQxczP") }, + { Hyakkano, Url.Combine(Config.Url, "/anime/pp9g8Qt7iem4RMjbJ") } }; private readonly bool _allEpisodes = false; - public StreamProviderTests(ITestOutputHelper output) - { - _output = output; - } - [Theory] [InlineData(Hyouka, 22)] + [InlineData(Hyakkano, 12)] public async Task GetNumberOfEpisodes(string key, int expected) { // arrange @@ -40,6 +38,7 @@ public async Task GetNumberOfEpisodes(string key, int expected) [Theory] [InlineData(Hyouka)] + [InlineData(Hyakkano)] public async Task GetStreams(string key) { // arrange @@ -47,7 +46,7 @@ public async Task GetStreams(string key) var sut = new StreamProvider(); // act - var result = await sut.GetStreams(url, _allEpisodes ? Range.All : 1..1, Models.StreamType.EnglishSubbed).ToListAsync(); + var result = await sut.GetStreams(url, _allEpisodes ? Range.All : 12..12, Models.StreamType.EnglishSubbed).ToListAsync(); Assert.NotEmpty(result); foreach (var item in result) diff --git a/Plugins/Anime/Totoro.Plugins.Anime.AllAnime/StreamProvider.cs b/Plugins/Anime/Totoro.Plugins.Anime.AllAnime/StreamProvider.cs index 6e940f73..a5106df4 100644 --- a/Plugins/Anime/Totoro.Plugins.Anime.AllAnime/StreamProvider.cs +++ b/Plugins/Anime/Totoro.Plugins.Anime.AllAnime/StreamProvider.cs @@ -156,27 +156,32 @@ public async IAsyncEnumerable GetStreams(string url, Ran var sourceArray = jsonNode?["episode"]?["sourceUrls"]; var sourceObjs = sourceArray?.ToObject>() ?? []; sourceObjs.Sort((x, y) => y.priority.CompareTo(x.priority)); - var item = sourceObjs.First(); - item.sourceUrl = DecryptSourceUrl(item.sourceUrl); - if (item.type == "iframe") - { - var clockUrl = ClockRegex().Replace(apiEndPoint + item.sourceUrl, ".json"); - var stream = await Extract(clockUrl); - if (stream is not null) - { - stream.Episode = e; - yield return stream; - } - } - else + + foreach (var item in sourceObjs) { - if (await Unpack(item.sourceUrl) is { } stream) + item.sourceUrl = DecryptSourceUrl(item.sourceUrl); + + if (item.type == "iframe") { - stream.Episode = e; - yield return stream; + var clockUrl = ClockRegex().Replace(apiEndPoint + item.sourceUrl, ".json"); + var stream = await Extract(clockUrl); + if (stream is not null) + { + stream.Episode = e; + yield return stream; + yield break; + } } + //else + //{ + // if (await Unpack(item.sourceUrl) is { } stream) + // { + // stream.Episode = e; + // yield return stream; + // yield break; + // } + //} } - } } diff --git a/Plugins/Anime/Totoro.Plugins.Anime.AllAnime/Totoro.Plugins.Anime.AllAnime.csproj b/Plugins/Anime/Totoro.Plugins.Anime.AllAnime/Totoro.Plugins.Anime.AllAnime.csproj index 95e8adce..d00938ee 100644 --- a/Plugins/Anime/Totoro.Plugins.Anime.AllAnime/Totoro.Plugins.Anime.AllAnime.csproj +++ b/Plugins/Anime/Totoro.Plugins.Anime.AllAnime/Totoro.Plugins.Anime.AllAnime.csproj @@ -5,7 +5,7 @@ enable enable x64 - 2.5 + 2.6 ..\..\..\Plugins Store\ false false diff --git a/plugins.json b/plugins.json index cf85f45c..a44a183e 100644 --- a/plugins.json +++ b/plugins.json @@ -7,7 +7,7 @@ }, { "DisplayName": "Allanime", - "Version": "2.5.0.0", + "Version": "2.6.0.0", "FileName": "Totoro.Plugins.Anime.AllAnime.dll" }, {