feat: resolve AniList episodes through ZokoAnime
This commit is contained in:
@@ -302,6 +302,30 @@ int main(int argc, char **argv) {
|
||||
[row[@"completion_eligible"] boolValue], "Miruro retains terminal snapshot semantics");
|
||||
}
|
||||
|
||||
require(ProgressReporter::validMediaIdentity("anilist:1:1") &&
|
||||
ProgressReporter::validMediaIdentity("anilist:2147483647:2147483647"), "canonical AniList identities accepted");
|
||||
for (const char *invalid : {"anilist:01:1", "anilist:0:1", "anilist:-1:1", "anilist:a:1",
|
||||
"anilist:1:01", "anilist:1:0", "anilist:1:2147483648", "anilist:2147483648:1",
|
||||
"anilist:1:1:sub", "anilist:1:1?token=secret"})
|
||||
require(!ProgressReporter::validMediaIdentity(invalid), "noncanonical AniList identities rejected");
|
||||
const auto anilistPath = root + "/anilist.jsonl";
|
||||
{
|
||||
ProgressReporter reporter(anilistPath, [] { return 0.; });
|
||||
reporter.begin("anilist:1:1");
|
||||
reporter.observe(sample(PLAYER_PAUSED, 42));
|
||||
reporter.finish();
|
||||
require(reporter.error().empty(), "AniList progress drains successfully");
|
||||
}
|
||||
rows = records(anilistPath);
|
||||
require(rows.count == 2, "AniList initial and closed snapshots");
|
||||
for (NSDictionary *row in rows) {
|
||||
require([row[@"version"] intValue] == 2 && row[@"media_url"] == nil &&
|
||||
[row[@"media_identity"][@"provider"] isEqual:@"anilist"] &&
|
||||
[row[@"media_identity"][@"media_id"] isEqual:@"1"] &&
|
||||
[row[@"media_identity"][@"episode"] intValue] == 1 &&
|
||||
[row[@"position_seconds"] doubleValue] == 42, "AniList v2 schema remains separate from Miruro");
|
||||
}
|
||||
|
||||
const auto clockFailurePath = root + "/clock-failure.jsonl";
|
||||
{
|
||||
ProgressReporter reporter(clockFailurePath, []() -> double { throw std::runtime_error("clock failure"); });
|
||||
|
||||
Reference in New Issue
Block a user