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 500db454..e41e2c8a 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()) @@ -359,15 +361,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()) } }