Skip to content

Commit e5882af

Browse files
Remove Unknown class, update some dependencies
1 parent 695c05b commit e5882af

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

app/src/main/java/org/schabi/newpipe/ui/components/items/Info.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,3 @@ class Playlist(
6262
item.streamCount
6363
)
6464
}
65-
66-
object Unknown : Info()

app/src/main/java/org/schabi/newpipe/ui/components/video/RelatedItems.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import org.schabi.newpipe.info_list.ItemViewMode
3535
import org.schabi.newpipe.ui.components.items.ItemList
3636
import org.schabi.newpipe.ui.components.items.Playlist
3737
import org.schabi.newpipe.ui.components.items.Stream
38-
import org.schabi.newpipe.ui.components.items.Unknown
3938
import org.schabi.newpipe.ui.theme.AppTheme
4039
import org.schabi.newpipe.util.Localization
4140
import 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

0 commit comments

Comments
 (0)