From 7156208c3c3c391040182b6d4e9424fd6359f458 Mon Sep 17 00:00:00 2001 From: Kayos Date: Tue, 26 May 2026 13:09:23 -0700 Subject: [PATCH] vc=65: metadata consistency across ChannelScreen + SearchScreen rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vc=64 fixed RelatedRow's empty-metadata bug. ChannelVideoRow and ResultRow had the same shape problem AND duplicated duration: - ChannelVideoRow: showed 'N views · 0:42' which doubled with the VideoThumbnail's bottom-right duration badge. Stripped the duration text, added uploadDateRelative. Now reads 'N views · 2 days ago' matching YT's channel page format. - ResultRow: same duplicate-duration. Same fix. Search results now show 'N views · 2 days ago' under the uploader line. All four video-row composables (FeedRow, RelatedRow, ChannelVideoRow, ResultRow) now use the same leading-separator buildString pattern: 'piece [· piece]*' that gracefully composes whatever fields are populated. No more empty metadata lines, no more duplicate duration. --- buildSrc/src/main/kotlin/ProjectConfig.kt | 4 +-- .../straw/feature/channel/ChannelScreen.kt | 32 ++++++++++++------- .../straw/feature/search/SearchScreen.kt | 20 ++++++++---- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/buildSrc/src/main/kotlin/ProjectConfig.kt b/buildSrc/src/main/kotlin/ProjectConfig.kt index df9a9cfd5..75e693f5e 100644 --- a/buildSrc/src/main/kotlin/ProjectConfig.kt +++ b/buildSrc/src/main/kotlin/ProjectConfig.kt @@ -55,6 +55,6 @@ const val NEWPIPE_APPLICATION_ID_NEW = "net.newpipe.app" // vc=19 / 0.1.0-AE — rust pipeline cutover. Extraction via // strawcore-core (Sulkta-Coop/strawcore) via the UniFFI wrapper; no // NewPipeExtractor in the runtime path. -const val STRAW_VERSION_CODE = 64 -const val STRAW_VERSION_NAME = "0.1.0-BX" +const val STRAW_VERSION_CODE = 65 +const val STRAW_VERSION_NAME = "0.1.0-BY" const val STRAW_APPLICATION_ID = "com.sulkta.straw" diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelScreen.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelScreen.kt index bca2e6641..1618fc2a9 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelScreen.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelScreen.kt @@ -205,18 +205,26 @@ private fun ChannelVideoRow( overflow = TextOverflow.Ellipsis, ) Spacer(modifier = Modifier.height(2.dp)) - Text( - text = buildString { - if (item.viewCount > 0) append("${formatCount(item.viewCount)} views") - if (item.durationSeconds > 0) { - if (isNotEmpty()) append(" · ") - append(formatDuration(item.durationSeconds)) - } - }, - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - maxLines = 1, - ) + // Don't repeat duration here — VideoThumbnail's + // bottom-right badge already shows it. Add the upload + // date so the row reads 'N views · 2 days ago' the way + // YT renders it. vc=65 — Cobb caught the duplicate + // duration + missing date on the channel page. + val meta = buildString { + if (item.viewCount > 0) append("${formatCount(item.viewCount)} views") + if (item.uploadDateRelative.isNotBlank()) { + if (isNotEmpty()) append(" · ") + append(item.uploadDateRelative) + } + } + if (meta.isNotEmpty()) { + Text( + text = meta, + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + maxLines = 1, + ) + } } } } diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/search/SearchScreen.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/search/SearchScreen.kt index 4f4adebfa..17d804b12 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/search/SearchScreen.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/search/SearchScreen.kt @@ -247,13 +247,21 @@ private fun ResultRow( else Modifier.padding(vertical = 4.dp), ) - if (item.viewCount > 0 || item.durationSeconds > 0) { + // Drop the duration here — VideoThumbnail's badge already + // renders it on the bottom-right of the thumbnail. Add the + // upload date instead so search results read like YT's + // own format. vc=65 — caught with the + // channel-page + related-row consistency pass. + val meta = buildString { + if (item.viewCount > 0) append(formatViews(item.viewCount)) + if (item.uploadDateRelative.isNotBlank()) { + if (isNotEmpty()) append(" · ") + append(item.uploadDateRelative) + } + } + if (meta.isNotEmpty()) { Text( - text = buildString { - if (item.viewCount > 0) append(formatViews(item.viewCount)) - if (item.viewCount > 0 && item.durationSeconds > 0) append(" · ") - if (item.durationSeconds > 0) append(formatDuration(item.durationSeconds)) - }, + text = meta, style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant, maxLines = 1,