mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-03 16:41:26 +01:00
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:
1 parent
bb5a6638c4
commit
3ca431feca
18 files changed
+892
-195
No files matched your search
@@ -321,7 +321,7 @@ private struct MetadataSettingsSheet: View {
|
||||
|
||||
var body: some View {
|
||||
DialogSheet("Metadata enrichment") {
|
||||
Text("Off by default: enabling sends the titles in your library to a third party, associated with your IP address and subject to their privacy policy. With AniList, the matched ids also go to ani.zip for episode names and wide artwork.")
|
||||
Text("Off by default: enabling sends the titles in your library to a third party, associated with your IP address and subject to their privacy policy. With AniList, a title it has nothing for is then sent to TVmaze, and the matched ids go to ani.zip for episode names and wide artwork.")
|
||||
Toggle("Enable enrichment", isOn: $enabled).tint(scheme.primary).foregroundStyle(scheme.onSurface).padding(.vertical, 6)
|
||||
HStack(spacing: 8) {
|
||||
ForEach([MetadataProvider.aniList, .tmdb], id: \.self) { option in
|
||||
@@ -329,7 +329,7 @@ private struct MetadataSettingsSheet: View {
|
||||
.buttonStyle(option == provider ? ProtonButtonStyle(kind: .accent) : ProtonButtonStyle(kind: .edged))
|
||||
}
|
||||
}
|
||||
Text(provider == .aniList ? "Anime; no account or API key required." : "Film and television; requires a free TMDB API key.")
|
||||
Text(provider == .aniList ? "Anime, and television from TVmaze; no account or API key required." : "Film and television; requires a free TMDB API key.")
|
||||
.textStyle(.bodySmall)
|
||||
if provider == .tmdb {
|
||||
Field(label: "Language", text: $language)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user