Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new TVTypes for generic Audio and Podcast #1442

Merged
merged 2 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
Luna712 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading