Skip to content

Commit

Permalink
Add new TVTypes for generic Audio and Podcast (#1442)
Browse files Browse the repository at this point in the history
* Add new TVTypes for generic Audio and Podcast

* Use when
  • Loading branch information
Luna712 authored Dec 31, 2024
1 parent 2d89cfa commit 05ca011
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down Expand Up @@ -650,6 +652,8 @@ class ResultViewModel2 : ViewModel() {
TvType.Music -> "Music"
TvType.AudioBook -> "AudioBooks"
TvType.CustomMedia -> "Media"
TvType.Audio -> "Audio"
TvType.Podcast -> "Podcasts"
}
}

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down

0 comments on commit 05ca011

Please sign in to comment.