mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-04 08:56:59 +01:00
feat(core,meta,app,android,ios): title logos and runtimes
ani.zip sent each series' TVDB clear logo and every episode's running time from the start, and neither was kept. Enrichment now stores the logo in title_metadata.logo_url (kept across a refresh of the same entry, like the fanart) and episode runtimes in episode_metadata.runtime, TVDB's first and AniDB's length after it. AniList's duration lands in TitleDetails::runtime; TMDB episode runtimes are kept too. Schema v13 adds the two columns and marks AniList titles un-enriched without deleting anything. TitleDetails::revision lets details written before runtime existed refetch by id while the old ones stay on screen, instead of blanking them in the migration as v10 did. Clear logos are padded to a square, so each client crops them to their visible pixels before drawing. The logo replaces the name on the library's banner and the title page (not on a light theme's title page, where lettering made for dark art can vanish). Episode rows show how long they run, in place of the file size on Android and iOS; a film's runtime joins its line of facts.
This commit is contained in:
1 parent
b5ba59b41d
commit
bb5a6638c4
29 files changed
+845
-69
No files matched your search
@@ -147,7 +147,16 @@ struct TitleView: View {
|
||||
|
||||
@ViewBuilder private func heading(playlist: [EpisodeRecord], nextUp: Int, upNext: EpisodeRecord?) -> some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
Text(title.displayName).textStyle(.headlineMedium).foregroundStyle(scheme.onSurface)
|
||||
// A light page keeps the name: a clear logo is lettering made for
|
||||
// dark art, white as often as not.
|
||||
if scheme.light {
|
||||
Text(title.displayName).textStyle(.headlineMedium).foregroundStyle(scheme.onSurface)
|
||||
} else {
|
||||
RemoteLogo(title.logoUrl, title.displayName, maxWidth: 280, maxHeight: 88) {
|
||||
Text(title.displayName).textStyle(.headlineMedium).foregroundStyle(scheme.onSurface)
|
||||
}
|
||||
.padding(.bottom, 4)
|
||||
}
|
||||
// The other names it goes by: the share's when the shown one is the
|
||||
// provider's, and the original-language one.
|
||||
let names: [String?] = [
|
||||
@@ -219,7 +228,9 @@ struct TitleView: View {
|
||||
let year: String? = (title.metadataYear ?? title.year).map { String($0) }
|
||||
let rating: String? = title.rating.map { String(format: "★ %.1f", $0) }
|
||||
let watched: String? = title.episodeCount > 1 ? "\(title.watchedCount) of \(title.episodeCount) watched" : nil
|
||||
let parts: [String?] = [title.formatLabel, title.seasonLabel ?? year, rating, watched]
|
||||
// A series' running time is its episodes', which each row says.
|
||||
let runtime: String? = title.kind == .film ? title.runtime.map(formatRuntime) : nil
|
||||
let parts: [String?] = [title.formatLabel, title.seasonLabel ?? year, runtime, rating, watched]
|
||||
return parts.compactMap { $0 }.joined(separator: " · ")
|
||||
}
|
||||
|
||||
@@ -404,8 +415,10 @@ private struct EpisodeRow: View {
|
||||
@State private var holding = false
|
||||
|
||||
private var subline: String {
|
||||
let size: String? = episode.size.map { formatBytes($0) }
|
||||
let parts: [String?] = [numbering, size, episode.airDate]
|
||||
// How long it runs says more than how big it is; the size is what
|
||||
// there is when no provider said.
|
||||
let length: String? = episode.runtime.map(formatRuntime) ?? episode.size.map { formatBytes($0) }
|
||||
let parts: [String?] = [numbering, length, episode.airDate]
|
||||
return parts.compactMap { $0 }.joined(separator: " · ")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user