mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
New TvTypes + General fixes
This commit is contained in:
parent
51d91bf9a7
commit
ed2bdf44fb
5 changed files with 37 additions and 15 deletions
|
@ -865,7 +865,11 @@ enum class TvType(value: Int?) {
|
|||
AsianDrama(9),
|
||||
Live(10),
|
||||
NSFW(11),
|
||||
Others(12)
|
||||
Others(12),
|
||||
Music(13),
|
||||
AudioBook(14),
|
||||
/** Wont load the built in player, make your own interaction */
|
||||
CustomMedia(15),
|
||||
}
|
||||
|
||||
public enum class AutoDownloadMode(val value: Int) {
|
||||
|
|
|
@ -85,7 +85,7 @@ abstract class BaseAdapter<
|
|||
AsyncDifferConfig.Builder(diffCallback).build()
|
||||
)
|
||||
|
||||
fun submitList(list: List<T>?) {
|
||||
open fun submitList(list: List<T>?) {
|
||||
// deep copy at least the top list, because otherwise adapter can go crazy
|
||||
mDiffer.submitList(list?.let { CopyOnWriteArrayList(it) })
|
||||
}
|
||||
|
|
|
@ -63,6 +63,10 @@ open class ParentItemAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
override fun submitList(list: List<HomeViewModel.ExpandableHomepageList>?) {
|
||||
super.submitList(list?.sortedBy { it.list.list.isEmpty() })
|
||||
}
|
||||
|
||||
override fun onUpdateContent(
|
||||
holder: ViewHolderState<Bundle>,
|
||||
item: HomeViewModel.ExpandableHomepageList,
|
||||
|
|
|
@ -246,6 +246,9 @@ fun LoadResponse.toResultData(repo: APIRepository): ResultData {
|
|||
TvType.Live -> R.string.live_singular
|
||||
TvType.Others -> R.string.other_singular
|
||||
TvType.NSFW -> R.string.nsfw_singular
|
||||
TvType.Music -> R.string.music_singlar
|
||||
TvType.AudioBook -> R.string.audio_book_singular
|
||||
TvType.CustomMedia -> R.string.custom_media_singluar
|
||||
}
|
||||
),
|
||||
yearText = txt(year?.toString()),
|
||||
|
@ -1759,10 +1762,6 @@ class ResultViewModel2 : ViewModel() {
|
|||
val data = currentResponse?.syncData?.toList() ?: emptyList()
|
||||
val list =
|
||||
HashMap<String, String>().apply { putAll(data) }
|
||||
|
||||
activity?.navigate(
|
||||
R.id.global_to_navigation_player,
|
||||
GeneratorPlayer.newInstance(
|
||||
generator?.also {
|
||||
it.getAll() // I know kinda shit to iterate all, but it is 100% sure to work
|
||||
?.indexOfFirst { value -> value is ResultEpisode && value.id == click.data.id }
|
||||
|
@ -1770,10 +1769,22 @@ class ResultViewModel2 : ViewModel() {
|
|||
if (index >= 0)
|
||||
it.goto(index)
|
||||
}
|
||||
} ?: return, list
|
||||
}
|
||||
if (currentResponse?.type == TvType.CustomMedia) {
|
||||
generator?.generateLinks(
|
||||
clearCache = true,
|
||||
LoadType.Unknown,
|
||||
callback = {},
|
||||
subtitleCallback = {})
|
||||
} else {
|
||||
activity?.navigate(
|
||||
R.id.global_to_navigation_player,
|
||||
GeneratorPlayer.newInstance(
|
||||
generator ?: return, list
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
ACTION_MARK_AS_WATCHED -> {
|
||||
val isWatched =
|
||||
|
|
|
@ -764,4 +764,7 @@
|
|||
<string name="biometric_setting_summary">Unlock the app with Fingerprint, Face ID, PIN, Pattern and Password.</string>
|
||||
<string name="biometric_prompt_description">This screen was closed due to multiple failed attempts. Please restart the application.</string>
|
||||
<string name="biometric_warning">Your CloudStream data has been backed up now. Although the possibility of this is very low, all devices can behave differently. In the rare case, that you get locked out from accessing the app, clear the app data completely and restore from a backup. We are very sorry for any inconvenience arising from this.</string>
|
||||
<string name="music_singlar">Music</string>
|
||||
<string name="audio_book_singular">Audio Book</string>
|
||||
<string name="custom_media_singluar">Media</string>
|
||||
</resources>
|
Loading…
Reference in a new issue