vc=32 fix: drop SearchItem.uploader_avatar — not on StreamInfoItem
I confused StreamInfo (the big single-video struct, has uploader_avatars: ImageSet) with StreamInfoItem (the card struct used in search results / channel video lists / related streams — no uploader_avatars field). cargoBuildHost caught it: E0609 no field `uploader_avatars`. Drop the field from SearchItem (and from the Kotlin construction sites). For the subs feed and "more from this channel" we already use the channel-level avatar from ChannelInfo.avatar, which is the right granularity anyway (every video from one channel shares one avatar). Per-card uploader avatars on search/related stay null until strawcore-core extracts them on StreamInfoItem too.
This commit is contained in:
parent
544035b30c
commit
2afdcf3d5c
5 changed files with 3 additions and 11 deletions
|
|
@ -15,7 +15,6 @@ pub struct SearchItem {
|
||||||
pub title: String,
|
pub title: String,
|
||||||
pub uploader: String,
|
pub uploader: String,
|
||||||
pub uploader_url: Option<String>,
|
pub uploader_url: Option<String>,
|
||||||
pub uploader_avatar: Option<String>,
|
|
||||||
pub thumbnail: Option<String>,
|
pub thumbnail: Option<String>,
|
||||||
/// Duration in seconds. 0 = live/unknown.
|
/// Duration in seconds. 0 = live/unknown.
|
||||||
pub duration_seconds: i64,
|
pub duration_seconds: i64,
|
||||||
|
|
@ -37,16 +36,11 @@ pub(crate) fn from_core(item: StreamInfoItem) -> SearchItem {
|
||||||
.thumbnails
|
.thumbnails
|
||||||
.last()
|
.last()
|
||||||
.map(|i| i.url().to_string());
|
.map(|i| i.url().to_string());
|
||||||
let uploader_avatar = item
|
|
||||||
.uploader_avatars
|
|
||||||
.last()
|
|
||||||
.map(|i| i.url().to_string());
|
|
||||||
SearchItem {
|
SearchItem {
|
||||||
url: item.url,
|
url: item.url,
|
||||||
title: item.name,
|
title: item.name,
|
||||||
uploader: item.uploader_name,
|
uploader: item.uploader_name,
|
||||||
uploader_url,
|
uploader_url,
|
||||||
uploader_avatar,
|
|
||||||
thumbnail,
|
thumbnail,
|
||||||
duration_seconds: item.duration_seconds,
|
duration_seconds: item.duration_seconds,
|
||||||
view_count: if item.view_count < 0 {
|
view_count: if item.view_count < 0 {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class ChannelViewModel : ViewModel() {
|
||||||
title = v.title.ifBlank { "(no title)" },
|
title = v.title.ifBlank { "(no title)" },
|
||||||
uploader = v.uploader,
|
uploader = v.uploader,
|
||||||
uploaderUrl = v.uploaderUrl,
|
uploaderUrl = v.uploaderUrl,
|
||||||
uploaderAvatar = v.uploaderAvatar ?: ch.avatar,
|
uploaderAvatar = ch.avatar,
|
||||||
thumbnail = v.thumbnail,
|
thumbnail = v.thumbnail,
|
||||||
durationSeconds = v.durationSeconds,
|
durationSeconds = v.durationSeconds,
|
||||||
viewCount = v.viewCount,
|
viewCount = v.viewCount,
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,6 @@ class VideoDetailViewModel : ViewModel() {
|
||||||
title = r.title.ifBlank { "(no title)" },
|
title = r.title.ifBlank { "(no title)" },
|
||||||
uploader = r.uploader,
|
uploader = r.uploader,
|
||||||
uploaderUrl = r.uploaderUrl,
|
uploaderUrl = r.uploaderUrl,
|
||||||
uploaderAvatar = r.uploaderAvatar,
|
|
||||||
thumbnail = r.thumbnail,
|
thumbnail = r.thumbnail,
|
||||||
durationSeconds = r.durationSeconds,
|
durationSeconds = r.durationSeconds,
|
||||||
viewCount = r.viewCount,
|
viewCount = r.viewCount,
|
||||||
|
|
@ -153,7 +152,7 @@ class VideoDetailViewModel : ViewModel() {
|
||||||
title = v.title.ifBlank { "(no title)" },
|
title = v.title.ifBlank { "(no title)" },
|
||||||
uploader = v.uploader.ifBlank { uploader },
|
uploader = v.uploader.ifBlank { uploader },
|
||||||
uploaderUrl = v.uploaderUrl ?: uploaderUrl,
|
uploaderUrl = v.uploaderUrl ?: uploaderUrl,
|
||||||
uploaderAvatar = v.uploaderAvatar ?: ch.avatar,
|
uploaderAvatar = ch.avatar,
|
||||||
thumbnail = v.thumbnail,
|
thumbnail = v.thumbnail,
|
||||||
durationSeconds = v.durationSeconds,
|
durationSeconds = v.durationSeconds,
|
||||||
viewCount = v.viewCount,
|
viewCount = v.viewCount,
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ class SubscriptionFeedViewModel : ViewModel() {
|
||||||
title = v.title.ifBlank { "(no title)" },
|
title = v.title.ifBlank { "(no title)" },
|
||||||
uploader = v.uploader.ifBlank { ch.name },
|
uploader = v.uploader.ifBlank { ch.name },
|
||||||
uploaderUrl = v.uploaderUrl ?: ch.url,
|
uploaderUrl = v.uploaderUrl ?: ch.url,
|
||||||
uploaderAvatar = v.uploaderAvatar ?: freshAvatar ?: ch.avatar,
|
uploaderAvatar = freshAvatar ?: ch.avatar,
|
||||||
thumbnail = v.thumbnail,
|
thumbnail = v.thumbnail,
|
||||||
durationSeconds = v.durationSeconds,
|
durationSeconds = v.durationSeconds,
|
||||||
viewCount = v.viewCount,
|
viewCount = v.viewCount,
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ class SearchViewModel : ViewModel() {
|
||||||
title = r.title.ifBlank { "(no title)" },
|
title = r.title.ifBlank { "(no title)" },
|
||||||
uploader = r.uploader,
|
uploader = r.uploader,
|
||||||
uploaderUrl = r.uploaderUrl,
|
uploaderUrl = r.uploaderUrl,
|
||||||
uploaderAvatar = r.uploaderAvatar,
|
|
||||||
thumbnail = r.thumbnail,
|
thumbnail = r.thumbnail,
|
||||||
durationSeconds = r.durationSeconds,
|
durationSeconds = r.durationSeconds,
|
||||||
viewCount = r.viewCount,
|
viewCount = r.viewCount,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue