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 uploader: String,
|
||||
pub uploader_url: Option<String>,
|
||||
pub uploader_avatar: Option<String>,
|
||||
pub thumbnail: Option<String>,
|
||||
/// Duration in seconds. 0 = live/unknown.
|
||||
pub duration_seconds: i64,
|
||||
|
|
@ -37,16 +36,11 @@ pub(crate) fn from_core(item: StreamInfoItem) -> SearchItem {
|
|||
.thumbnails
|
||||
.last()
|
||||
.map(|i| i.url().to_string());
|
||||
let uploader_avatar = item
|
||||
.uploader_avatars
|
||||
.last()
|
||||
.map(|i| i.url().to_string());
|
||||
SearchItem {
|
||||
url: item.url,
|
||||
title: item.name,
|
||||
uploader: item.uploader_name,
|
||||
uploader_url,
|
||||
uploader_avatar,
|
||||
thumbnail,
|
||||
duration_seconds: item.duration_seconds,
|
||||
view_count: if item.view_count < 0 {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ChannelViewModel : ViewModel() {
|
|||
title = v.title.ifBlank { "(no title)" },
|
||||
uploader = v.uploader,
|
||||
uploaderUrl = v.uploaderUrl,
|
||||
uploaderAvatar = v.uploaderAvatar ?: ch.avatar,
|
||||
uploaderAvatar = ch.avatar,
|
||||
thumbnail = v.thumbnail,
|
||||
durationSeconds = v.durationSeconds,
|
||||
viewCount = v.viewCount,
|
||||
|
|
|
|||
|
|
@ -129,7 +129,6 @@ class VideoDetailViewModel : ViewModel() {
|
|||
title = r.title.ifBlank { "(no title)" },
|
||||
uploader = r.uploader,
|
||||
uploaderUrl = r.uploaderUrl,
|
||||
uploaderAvatar = r.uploaderAvatar,
|
||||
thumbnail = r.thumbnail,
|
||||
durationSeconds = r.durationSeconds,
|
||||
viewCount = r.viewCount,
|
||||
|
|
@ -153,7 +152,7 @@ class VideoDetailViewModel : ViewModel() {
|
|||
title = v.title.ifBlank { "(no title)" },
|
||||
uploader = v.uploader.ifBlank { uploader },
|
||||
uploaderUrl = v.uploaderUrl ?: uploaderUrl,
|
||||
uploaderAvatar = v.uploaderAvatar ?: ch.avatar,
|
||||
uploaderAvatar = ch.avatar,
|
||||
thumbnail = v.thumbnail,
|
||||
durationSeconds = v.durationSeconds,
|
||||
viewCount = v.viewCount,
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ class SubscriptionFeedViewModel : ViewModel() {
|
|||
title = v.title.ifBlank { "(no title)" },
|
||||
uploader = v.uploader.ifBlank { ch.name },
|
||||
uploaderUrl = v.uploaderUrl ?: ch.url,
|
||||
uploaderAvatar = v.uploaderAvatar ?: freshAvatar ?: ch.avatar,
|
||||
uploaderAvatar = freshAvatar ?: ch.avatar,
|
||||
thumbnail = v.thumbnail,
|
||||
durationSeconds = v.durationSeconds,
|
||||
viewCount = v.viewCount,
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ class SearchViewModel : ViewModel() {
|
|||
title = r.title.ifBlank { "(no title)" },
|
||||
uploader = r.uploader,
|
||||
uploaderUrl = r.uploaderUrl,
|
||||
uploaderAvatar = r.uploaderAvatar,
|
||||
thumbnail = r.thumbnail,
|
||||
durationSeconds = r.durationSeconds,
|
||||
viewCount = r.viewCount,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue