feat(core,meta,app,android,ios,cli): TVmaze for the shows AniList does not have

With AniList chosen, a title AniList has no match for is now searched on
TVmaze, keyless, before it is given up on. One provider for the whole library
left live-action shows in a share of anime unmatched, and switching to TMDB
would have dropped every AniList match, chain and shelf.

The service holds a chain of providers. A match is stored under the provider
that gave it, and enrichment and refreshes go to that provider; a miss is
stored under the last provider asked, and is_fresh only trusts a miss from the
end of the chain, so AniList misses stored before this are asked again at once.
A provider failure still ends the lookup instead of falling through.

The hand matcher searches every provider in the chain and labels each result
with its source. TVmaze is never offered in the settings and is not asked
about titles known to be films.
This commit is contained in:
nvrl committed 2026-10-29 16:33:16 +01:00
1 parent bb5a6638c4
commit 3ca431feca
18 files changed
+892 -195

No files matched your search

+9 -3
View File
@@ -376,10 +376,16 @@ extension MetadataProvider {
switch self {
case .aniList: "AniList"
case .tmdb: "TMDB"
case .tvMaze: "TVmaze"
}
}
}
extension MatchRecord {
/// Unique across one search: the same id can come back from two providers.
var choiceId: String { "\(provider.displayName):\(remoteId)" }
}
extension EpisodeRecord {
/// `S03E38`, `E38`, or the row's place in the season.
///
@@ -515,7 +521,7 @@ struct ChangeMatchSheet: View {
var body: some View {
DialogSheet("Change match") {
Text("Search the configured metadata provider. Nothing is stored until you choose an entry.")
Text("Search the configured metadata providers. Nothing is stored until you choose an entry.")
Field(label: "Title", text: $term, submit: .search)
.onSubmit(search)
Button(searching ? "Searching…" : "Search", action: search)
@@ -534,11 +540,11 @@ struct ChangeMatchSheet: View {
if !searching, options.isEmpty, searched {
Text("Nothing found. Try the title's original or English name.").textStyle(.bodySmall)
}
ForEach(options, id: \.remoteId) { option in
ForEach(options, id: \.choiceId) { option in
Button { choose(option) } label: {
VStack(alignment: .leading, spacing: 2) {
Text(option.name).textStyle(.labelLarge, semibold: true)
Text([option.year.map(String.init), option.originalName].compactMap { $0 }.joined(separator: " · "))
Text([option.year.map(String.init), option.originalName, option.provider.displayName].compactMap { $0 }.joined(separator: " · "))
.textStyle(.labelLarge)
}
.frame(maxWidth: .infinity, alignment: .leading)