File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/ui/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,5 +62,3 @@ class Playlist(
6262 item.streamCount
6363 )
6464}
65-
66- object Unknown : Info()
Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ import org.schabi.newpipe.info_list.ItemViewMode
3535import org.schabi.newpipe.ui.components.items.ItemList
3636import org.schabi.newpipe.ui.components.items.Playlist
3737import org.schabi.newpipe.ui.components.items.Stream
38- import org.schabi.newpipe.ui.components.items.Unknown
3938import org.schabi.newpipe.ui.theme.AppTheme
4039import org.schabi.newpipe.util.Localization
4140import org.schabi.newpipe.util.NO_SERVICE_ID
@@ -50,13 +49,11 @@ fun RelatedItems(info: StreamInfo) {
5049 var isAutoQueueEnabled by rememberSaveable {
5150 mutableStateOf(sharedPreferences.getBoolean(key, false ))
5251 }
53- val displayItems = info.relatedItems.map {
54- if (it is StreamInfoItem ) {
55- Stream (it, getStreamDetailText(context, it))
56- } else if (it is PlaylistInfoItem ) {
57- Playlist (it)
58- } else {
59- Unknown
52+ val displayItems = info.relatedItems.mapNotNull {
53+ when (it) {
54+ is StreamInfoItem -> Stream (it, getStreamDetailText(context, it))
55+ is PlaylistInfoItem -> Playlist (it)
56+ else -> null
6057 }
6158 }
6259
You can’t perform that action at this time.
0 commit comments