mirror of
https://github.com/recloudstream/cloudstream.git
synced 2025-05-17 19:25:55 +08:00
Add new TVTypes for generic Audio and Podcast (#1442)
* Add new TVTypes for generic Audio and Podcast * Use when
This commit is contained in:
@ -249,6 +249,8 @@ fun LoadResponse.toResultData(repo: APIRepository): ResultData {
|
||||
TvType.Music -> R.string.music_singlar
|
||||
TvType.AudioBook -> R.string.audio_book_singular
|
||||
TvType.CustomMedia -> R.string.custom_media_singluar
|
||||
TvType.Audio -> R.string.audio_singluar
|
||||
TvType.Podcast -> R.string.podcast_singluar
|
||||
}
|
||||
),
|
||||
yearText = txt(year?.toString()),
|
||||
@ -650,6 +652,8 @@ class ResultViewModel2 : ViewModel() {
|
||||
TvType.Music -> "Music"
|
||||
TvType.AudioBook -> "AudioBooks"
|
||||
TvType.CustomMedia -> "Media"
|
||||
TvType.Audio -> "Audio"
|
||||
TvType.Podcast -> "Podcasts"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -373,6 +373,8 @@
|
||||
<string name="music_singlar">Music</string>
|
||||
<string name="audio_book_singular">Audio Book</string>
|
||||
<string name="custom_media_singluar">Media</string>
|
||||
<string name="audio_singluar">Audio</string>
|
||||
<string name="podcast_singluar">Podcast</string>
|
||||
<string name="source_error">Source error</string>
|
||||
<string name="remote_error">Remote error</string>
|
||||
<string name="render_error">Renderer error</string>
|
||||
|
@ -681,8 +681,11 @@ enum class TvType(value: Int?) {
|
||||
Music(13),
|
||||
AudioBook(14),
|
||||
|
||||
/** Wont load the built in player, make your own interaction */
|
||||
/** Won't load the built in player, make your own interaction */
|
||||
CustomMedia(15),
|
||||
|
||||
Audio(16),
|
||||
Podcast(17),
|
||||
}
|
||||
|
||||
public enum class AutoDownloadMode(val value: Int) {
|
||||
@ -698,9 +701,24 @@ public enum class AutoDownloadMode(val value: Int) {
|
||||
}
|
||||
}
|
||||
|
||||
// IN CASE OF FUTURE ANIME MOVIE OR SMTH
|
||||
fun TvType.isMovieType(): Boolean {
|
||||
return this == TvType.Movie || this == TvType.AnimeMovie || this == TvType.Torrent || this == TvType.Live
|
||||
return when (this) {
|
||||
TvType.AnimeMovie,
|
||||
TvType.Live,
|
||||
TvType.Movie,
|
||||
TvType.Torrent -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
fun TvType.isAudioType(): Boolean {
|
||||
return when (this) {
|
||||
TvType.Audio,
|
||||
TvType.AudioBook,
|
||||
TvType.Music,
|
||||
TvType.Podcast -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
fun TvType.isLiveStream(): Boolean {
|
||||
|
Reference in New Issue
Block a user