Handle more deprecated items
This commit is contained in:
@@ -20,7 +20,7 @@ enum class DebugToggles(val default: Boolean) {
|
||||
// Pretend that all galleries only have a single version
|
||||
INCLUDE_ONLY_ROOT_WHEN_LOADING_EXH_VERSIONS(false);
|
||||
|
||||
val prefKey = "eh_debug_toggle_${name.toLowerCase(Locale.getDefault())}"
|
||||
val prefKey = "eh_debug_toggle_${name.lowercase(Locale.US)}"
|
||||
|
||||
var enabled: Boolean
|
||||
get() = prefs.flowPrefs.getBoolean(prefKey, default).get()
|
||||
|
||||
@@ -15,6 +15,7 @@ import eu.kanade.tachiyomi.util.preference.onClick
|
||||
import eu.kanade.tachiyomi.util.preference.preference
|
||||
import eu.kanade.tachiyomi.util.preference.preferenceCategory
|
||||
import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||
import exh.util.capitalize
|
||||
import java.util.Locale
|
||||
import kotlin.reflect.KVisibility
|
||||
import kotlin.reflect.full.declaredFunctions
|
||||
|
||||
@@ -28,7 +28,9 @@ import exh.metadata.metadata.base.getFlatMetadataForManga
|
||||
import exh.metadata.metadata.base.insertFlatMetadataAsync
|
||||
import exh.source.isEhBasedManga
|
||||
import exh.util.cancellable
|
||||
import exh.util.days
|
||||
import exh.util.executeOnIO
|
||||
import exh.util.hours
|
||||
import exh.util.jobScheduler
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -46,9 +48,6 @@ import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.ArrayList
|
||||
import kotlin.time.ExperimentalTime
|
||||
import kotlin.time.days
|
||||
import kotlin.time.hours
|
||||
|
||||
class EHentaiUpdateWorker : JobService() {
|
||||
private val scope = CoroutineScope(Dispatchers.Default + Job())
|
||||
@@ -289,8 +288,7 @@ class EHentaiUpdateWorker : JobService() {
|
||||
companion object {
|
||||
private const val MAX_UPDATE_FAILURES = 5
|
||||
|
||||
@OptIn(ExperimentalTime::class)
|
||||
private val MIN_BACKGROUND_UPDATE_FREQ = 1.days.toLongMilliseconds()
|
||||
private val MIN_BACKGROUND_UPDATE_FREQ = 1.days.inWholeMilliseconds
|
||||
|
||||
private const val JOB_ID_UPDATE_BACKGROUND = 700000
|
||||
private const val JOB_ID_UPDATE_BACKGROUND_TEST = 700001
|
||||
@@ -356,9 +354,8 @@ class EHentaiUpdateWorker : JobService() {
|
||||
val acRestriction = "ac" in restrictions
|
||||
val wifiRestriction = "wifi" in restrictions
|
||||
|
||||
@OptIn(ExperimentalTime::class)
|
||||
val jobInfo = context.periodicBackgroundJobInfo(
|
||||
duration.hours.toLongMilliseconds(),
|
||||
duration.hours.inWholeMilliseconds,
|
||||
acRestriction,
|
||||
wifiRestriction
|
||||
)
|
||||
@@ -382,6 +379,5 @@ data class UpdateEntry(val manga: Manga, val meta: EHentaiSearchMetadata, val ro
|
||||
object EHentaiUpdateWorkerConstants {
|
||||
const val UPDATES_PER_ITERATION = 50
|
||||
|
||||
@OptIn(ExperimentalTime::class)
|
||||
val GALLERY_AGE_TIME = 365.days.toLongMilliseconds()
|
||||
val GALLERY_AGE_TIME = 365.days.inWholeMilliseconds
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import exh.metadata.metadata.MangaDexSearchMetadata
|
||||
import exh.metadata.metadata.base.RaisedTag
|
||||
import exh.metadata.metadata.base.getFlatMetadataForManga
|
||||
import exh.metadata.metadata.base.insertFlatMetadata
|
||||
import exh.util.capitalize
|
||||
import exh.util.dropEmpty
|
||||
import exh.util.executeOnIO
|
||||
import exh.util.floor
|
||||
|
||||
@@ -13,6 +13,7 @@ import rx.Observable
|
||||
import tachiyomi.source.model.ChapterInfo
|
||||
import tachiyomi.source.model.MangaInfo
|
||||
|
||||
@Suppress("OverridingDeprecatedMember", "DEPRECATION")
|
||||
abstract class DelegatedHttpSource(val delegate: HttpSource) : HttpSource() {
|
||||
/**
|
||||
* Returns the request for the popular manga given the page.
|
||||
|
||||
@@ -12,6 +12,7 @@ import tachiyomi.source.model.ChapterInfo
|
||||
import tachiyomi.source.model.MangaInfo
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
@Suppress("OverridingDeprecatedMember", "DEPRECATION")
|
||||
class EnhancedHttpSource(
|
||||
val originalSource: HttpSource,
|
||||
val enhancedSource: HttpSource
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package exh.util
|
||||
|
||||
import kotlin.time.DurationUnit
|
||||
import kotlin.time.toDuration
|
||||
|
||||
val Int.nanoseconds get() = toDuration(DurationUnit.NANOSECONDS)
|
||||
val Long.nanoseconds get() = toDuration(DurationUnit.NANOSECONDS)
|
||||
val Double.nanoseconds get() = toDuration(DurationUnit.NANOSECONDS)
|
||||
val Int.microseconds get() = toDuration(DurationUnit.MICROSECONDS)
|
||||
val Long.microseconds get() = toDuration(DurationUnit.MICROSECONDS)
|
||||
val Double.microseconds get() = toDuration(DurationUnit.MICROSECONDS)
|
||||
val Int.milliseconds get() = toDuration(DurationUnit.MILLISECONDS)
|
||||
val Long.milliseconds get() = toDuration(DurationUnit.MILLISECONDS)
|
||||
val Double.milliseconds get() = toDuration(DurationUnit.MILLISECONDS)
|
||||
val Int.seconds get() = toDuration(DurationUnit.SECONDS)
|
||||
val Long.seconds get() = toDuration(DurationUnit.SECONDS)
|
||||
val Double.seconds get() = toDuration(DurationUnit.SECONDS)
|
||||
val Int.minutes get() = toDuration(DurationUnit.MINUTES)
|
||||
val Long.minutes get() = toDuration(DurationUnit.MINUTES)
|
||||
val Double.minutes get() = toDuration(DurationUnit.MINUTES)
|
||||
val Int.hours get() = toDuration(DurationUnit.HOURS)
|
||||
val Long.hours get() = toDuration(DurationUnit.HOURS)
|
||||
val Double.hours get() = toDuration(DurationUnit.HOURS)
|
||||
val Int.days get() = toDuration(DurationUnit.DAYS)
|
||||
val Long.days get() = toDuration(DurationUnit.DAYS)
|
||||
val Double.days get() = toDuration(DurationUnit.DAYS)
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package exh.util
|
||||
|
||||
import java.util.Locale
|
||||
|
||||
fun String.capitalize(locale: Locale = Locale.getDefault()) =
|
||||
replaceFirstChar { if (it.isLowerCase()) it.titlecase(locale) else it.toString() }
|
||||
Reference in New Issue
Block a user