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),
|
AsianDrama(9),
|
||||||
Live(10),
|
Live(10),
|
||||||
NSFW(11),
|
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) {
|
public enum class AutoDownloadMode(val value: Int) {
|
||||||
|
|
|
@ -85,7 +85,7 @@ abstract class BaseAdapter<
|
||||||
AsyncDifferConfig.Builder(diffCallback).build()
|
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
|
// deep copy at least the top list, because otherwise adapter can go crazy
|
||||||
mDiffer.submitList(list?.let { CopyOnWriteArrayList(it) })
|
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(
|
override fun onUpdateContent(
|
||||||
holder: ViewHolderState<Bundle>,
|
holder: ViewHolderState<Bundle>,
|
||||||
item: HomeViewModel.ExpandableHomepageList,
|
item: HomeViewModel.ExpandableHomepageList,
|
||||||
|
|
|
@ -246,6 +246,9 @@ fun LoadResponse.toResultData(repo: APIRepository): ResultData {
|
||||||
TvType.Live -> R.string.live_singular
|
TvType.Live -> R.string.live_singular
|
||||||
TvType.Others -> R.string.other_singular
|
TvType.Others -> R.string.other_singular
|
||||||
TvType.NSFW -> R.string.nsfw_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()),
|
yearText = txt(year?.toString()),
|
||||||
|
@ -1759,20 +1762,28 @@ class ResultViewModel2 : ViewModel() {
|
||||||
val data = currentResponse?.syncData?.toList() ?: emptyList()
|
val data = currentResponse?.syncData?.toList() ?: emptyList()
|
||||||
val list =
|
val list =
|
||||||
HashMap<String, String>().apply { putAll(data) }
|
HashMap<String, String>().apply { putAll(data) }
|
||||||
|
generator?.also {
|
||||||
activity?.navigate(
|
it.getAll() // I know kinda shit to iterate all, but it is 100% sure to work
|
||||||
R.id.global_to_navigation_player,
|
?.indexOfFirst { value -> value is ResultEpisode && value.id == click.data.id }
|
||||||
GeneratorPlayer.newInstance(
|
?.let { index ->
|
||||||
generator?.also {
|
if (index >= 0)
|
||||||
it.getAll() // I know kinda shit to iterate all, but it is 100% sure to work
|
it.goto(index)
|
||||||
?.indexOfFirst { value -> value is ResultEpisode && value.id == click.data.id }
|
}
|
||||||
?.let { index ->
|
}
|
||||||
if (index >= 0)
|
if (currentResponse?.type == TvType.CustomMedia) {
|
||||||
it.goto(index)
|
generator?.generateLinks(
|
||||||
}
|
clearCache = true,
|
||||||
} ?: return, list
|
LoadType.Unknown,
|
||||||
|
callback = {},
|
||||||
|
subtitleCallback = {})
|
||||||
|
} else {
|
||||||
|
activity?.navigate(
|
||||||
|
R.id.global_to_navigation_player,
|
||||||
|
GeneratorPlayer.newInstance(
|
||||||
|
generator ?: return, list
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ACTION_MARK_AS_WATCHED -> {
|
ACTION_MARK_AS_WATCHED -> {
|
||||||
|
|
|
@ -764,4 +764,7 @@
|
||||||
<string name="biometric_setting_summary">Unlock the app with Fingerprint, Face ID, PIN, Pattern and Password.</string>
|
<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_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="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>
|
</resources>
|
Loading…
Reference in a new issue