Skip to content

Commit

Permalink
Remove Unknown class
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Feb 9, 2025
1 parent 695c05b commit dbe3011
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,3 @@ class Playlist(
item.streamCount
)
}

object Unknown : Info()
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import org.schabi.newpipe.info_list.ItemViewMode
import org.schabi.newpipe.ui.components.items.ItemList
import org.schabi.newpipe.ui.components.items.Playlist
import org.schabi.newpipe.ui.components.items.Stream
import org.schabi.newpipe.ui.components.items.Unknown
import org.schabi.newpipe.ui.theme.AppTheme
import org.schabi.newpipe.util.Localization
import org.schabi.newpipe.util.NO_SERVICE_ID
Expand All @@ -50,13 +49,11 @@ fun RelatedItems(info: StreamInfo) {
var isAutoQueueEnabled by rememberSaveable {
mutableStateOf(sharedPreferences.getBoolean(key, false))
}
val displayItems = info.relatedItems.map {
if (it is StreamInfoItem) {
Stream(it, getStreamDetailText(context, it))
} else if (it is PlaylistInfoItem) {
Playlist(it)
} else {
Unknown
val displayItems = info.relatedItems.mapNotNull {
when (it) {
is StreamInfoItem -> Stream(it, getStreamDetailText(context, it))
is PlaylistInfoItem -> Playlist(it)
else -> null
}
}

Expand Down

0 comments on commit dbe3011

Please sign in to comment.