From 9caac0ad59c377222bf7f32b1b829dfc21ec5a8d Mon Sep 17 00:00:00 2001 From: Ken Date: Tue, 23 Jul 2024 11:00:30 +0700 Subject: [PATCH 1/2] Fix spacer below recommended album --- .../simpmusic/data/parser/HomeParser.kt | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/maxrave/simpmusic/data/parser/HomeParser.kt b/app/src/main/java/com/maxrave/simpmusic/data/parser/HomeParser.kt index b3e0bb0f..9ef480f7 100644 --- a/app/src/main/java/com/maxrave/simpmusic/data/parser/HomeParser.kt +++ b/app/src/main/java/com/maxrave/simpmusic/data/parser/HomeParser.kt @@ -28,24 +28,26 @@ fun parseMixedContent(data: List?, context: Context if (results != null) { val title = results.header?.runs?.get(0)?.text ?: "" val content = results.description.runs?.get(0)?.text ?: "" - list.add( - HomeItem( - contents = listOf( - Content( - album = null, - artists = listOf(), - description = content, - isExplicit = null, - playlistId = null, - browseId = null, - thumbnails = listOf(), - title = content, - videoId = null, - views = null - ) - ), title = title + if (title.isNotEmpty()) { + list.add( + HomeItem( + contents = listOf( + Content( + album = null, + artists = listOf(), + description = content, + isExplicit = null, + playlistId = null, + browseId = null, + thumbnails = listOf(), + title = content, + videoId = null, + views = null + ) + ), title = title + ) ) - ) + } } else { val results1 = row.musicCarouselShelfRenderer Log.w("parse_mixed_content", results1.toString()) From b96758cd258ca6574f818ef23a633a4bebd55320 Mon Sep 17 00:00:00 2001 From: Ken Date: Tue, 23 Jul 2024 11:25:04 +0700 Subject: [PATCH 2/2] Fix spacer below recommended album --- .../simpmusic/data/parser/HomeParser.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/maxrave/simpmusic/data/parser/HomeParser.kt b/app/src/main/java/com/maxrave/simpmusic/data/parser/HomeParser.kt index 9ef480f7..7216f68c 100644 --- a/app/src/main/java/com/maxrave/simpmusic/data/parser/HomeParser.kt +++ b/app/src/main/java/com/maxrave/simpmusic/data/parser/HomeParser.kt @@ -347,15 +347,17 @@ fun parseMixedContent(data: List?, context: Context } } } - list.add( - HomeItem( - contents = listContent, - title = title, - subtitle = subtitle, - thumbnail = thumbnail, - channelId = if (artistChannelId?.contains("UC") == true) artistChannelId else null + if (title.isNotEmpty()) { + list.add( + HomeItem( + contents = listContent, + title = title, + subtitle = subtitle, + thumbnail = thumbnail, + channelId = if (artistChannelId?.contains("UC") == true) artistChannelId else null + ) ) - ) + } Log.w("parse_mixed_content", list.toString()) } }