From 2afdcf3d5cd709d73becd21aecb9810dd2cd0495 Mon Sep 17 00:00:00 2001 From: Kayos Date: Mon, 25 May 2026 12:38:50 -0700 Subject: [PATCH] =?UTF-8?q?vc=3D32=20fix:=20drop=20SearchItem.uploader=5Fa?= =?UTF-8?q?vatar=20=E2=80=94=20not=20on=20StreamInfoItem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- rust/strawcore/src/search.rs | 6 ------ .../com/sulkta/straw/feature/channel/ChannelViewModel.kt | 2 +- .../com/sulkta/straw/feature/detail/VideoDetailViewModel.kt | 3 +-- .../sulkta/straw/feature/feed/SubscriptionFeedViewModel.kt | 2 +- .../com/sulkta/straw/feature/search/SearchViewModel.kt | 1 - 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/rust/strawcore/src/search.rs b/rust/strawcore/src/search.rs index c7f573459..b85b7ce7f 100644 --- a/rust/strawcore/src/search.rs +++ b/rust/strawcore/src/search.rs @@ -15,7 +15,6 @@ pub struct SearchItem { pub title: String, pub uploader: String, pub uploader_url: Option, - pub uploader_avatar: Option, pub thumbnail: Option, /// 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 { diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelViewModel.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelViewModel.kt index fe3a38adc..027d0bfa9 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelViewModel.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelViewModel.kt @@ -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, diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailViewModel.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailViewModel.kt index 43eaceebb..e269b3f6c 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailViewModel.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailViewModel.kt @@ -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, diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/feed/SubscriptionFeedViewModel.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/feed/SubscriptionFeedViewModel.kt index b6fc0c49b..bb6ce845d 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/feed/SubscriptionFeedViewModel.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/feed/SubscriptionFeedViewModel.kt @@ -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, diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/search/SearchViewModel.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/search/SearchViewModel.kt index f44ce5f0f..40ff14603 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/search/SearchViewModel.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/search/SearchViewModel.kt @@ -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,