remove unnecessary context (build failing)
This commit is contained in:
parent
025d31102e
commit
97d062ffc2
11 changed files with 23 additions and 20 deletions
|
@ -43,7 +43,7 @@ class MediaDetailsViewModel : ViewModel() {
|
|||
|
||||
|
||||
fun loadSelected(media: Media, isDownload: Boolean = false): Selected {
|
||||
val data = PrefManager.getNullableCustomVal<Selected?>("Selected-${media.id}", null)
|
||||
val data = PrefManager.getNullableCustomVal("Selected-${media.id}", null, Selected::class.java)
|
||||
?: Selected().let {
|
||||
it.sourceIndex = 0
|
||||
it.preferDub = PrefManager.getVal(PrefName.SettingsPreferDub)
|
||||
|
|
|
@ -356,7 +356,7 @@ class AnimeWatchAdapter(
|
|||
val episodes = media.anime.episodes!!.keys.toTypedArray()
|
||||
|
||||
val anilistEp = (media.userProgress ?: 0).plus(1)
|
||||
val appEp = PrefManager.getNullableCustomVal<String?>("${media.id}_current_ep", null)?.toIntOrNull() ?: 1
|
||||
val appEp = PrefManager.getCustomVal<String?>("${media.id}_current_ep", "")?.toIntOrNull() ?: 1
|
||||
|
||||
var continueEp = (if (anilistEp > appEp) anilistEp else appEp).toString()
|
||||
if (episodes.contains(continueEp)) {
|
||||
|
|
|
@ -29,8 +29,8 @@ import kotlin.math.ln
|
|||
import kotlin.math.pow
|
||||
|
||||
fun handleProgress(cont: LinearLayout, bar: View, empty: View, mediaId: Int, ep: String) {
|
||||
val curr = PrefManager.getNullableCustomVal("${mediaId}_${ep}", null as Long?)
|
||||
val max = PrefManager.getNullableCustomVal("${mediaId}_${ep}_max", null as Long?)
|
||||
val curr = PrefManager.getNullableCustomVal("${mediaId}_${ep}", null, Long::class.java)
|
||||
val max = PrefManager.getNullableCustomVal("${mediaId}_${ep}_max", null, Long::class.java)
|
||||
if (curr != null && max != null) {
|
||||
cont.visibility = View.VISIBLE
|
||||
val div = curr.toFloat() / max.toFloat()
|
||||
|
|
|
@ -389,7 +389,7 @@ class MangaReadAdapter(
|
|||
if (media.manga?.chapters != null) {
|
||||
val chapters = media.manga.chapters!!.keys.toTypedArray()
|
||||
val anilistEp = (media.userProgress ?: 0).plus(1)
|
||||
val appEp = PrefManager.getNullableCustomVal<String?>("${media.id}_current_chp", null)?.toIntOrNull() ?: 1
|
||||
val appEp = PrefManager.getCustomVal<String?>("${media.id}_current_chp", null)?.toIntOrNull() ?: 1
|
||||
var continueEp = (if (anilistEp > appEp) anilistEp else appEp).toString()
|
||||
val filteredChapters = chapters.filter { chapterKey ->
|
||||
val chapter = media.manga.chapters!![chapterKey]!!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue