Various crash fixes on older Android versions
This commit is contained in:
parent
a427401d66
commit
78b2045b14
@ -149,7 +149,7 @@ dependencies {
|
|||||||
implementation 'com.github.pwittchen:reactivenetwork:0.7.0'
|
implementation 'com.github.pwittchen:reactivenetwork:0.7.0'
|
||||||
|
|
||||||
// Network client
|
// Network client
|
||||||
implementation "com.squareup.okhttp3:okhttp:3.13.1"
|
implementation "com.squareup.okhttp3:okhttp:3.12.2" // DO NOT UPGRADE TO 3.13.X+, it requires minSdk 21
|
||||||
implementation 'com.squareup.okio:okio:1.17.2'
|
implementation 'com.squareup.okio:okio:1.17.2'
|
||||||
|
|
||||||
// REST
|
// REST
|
||||||
|
@ -35,7 +35,7 @@ import uy.kohesive.injekt.injectLazy
|
|||||||
import java.net.URLEncoder
|
import java.net.URLEncoder
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import exh.metadata.metadata.base.RaisedTag
|
import exh.metadata.metadata.base.RaisedTag
|
||||||
import exh.eh.EHentaiUpdateWorker
|
import exh.eh.EHentaiUpdateWorkerConstants
|
||||||
import exh.eh.GalleryEntry
|
import exh.eh.GalleryEntry
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import org.jsoup.nodes.TextNode
|
import org.jsoup.nodes.TextNode
|
||||||
@ -404,7 +404,7 @@ class EHentai(override val id: Long,
|
|||||||
|
|
||||||
lastUpdateCheck = System.currentTimeMillis()
|
lastUpdateCheck = System.currentTimeMillis()
|
||||||
if(datePosted != null
|
if(datePosted != null
|
||||||
&& lastUpdateCheck - datePosted!! > EHentaiUpdateWorker.GALLERY_AGE_TIME) {
|
&& lastUpdateCheck - datePosted!! > EHentaiUpdateWorkerConstants.GALLERY_AGE_TIME) {
|
||||||
aged = true
|
aged = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import eu.kanade.tachiyomi.util.toast
|
|||||||
import exh.EH_SOURCE_ID
|
import exh.EH_SOURCE_ID
|
||||||
import exh.EXH_SOURCE_ID
|
import exh.EXH_SOURCE_ID
|
||||||
import exh.eh.EHentaiUpdateWorker
|
import exh.eh.EHentaiUpdateWorker
|
||||||
|
import exh.eh.EHentaiUpdateWorkerConstants
|
||||||
import exh.eh.EHentaiUpdaterStats
|
import exh.eh.EHentaiUpdaterStats
|
||||||
import exh.favorites.FavoritesIntroDialog
|
import exh.favorites.FavoritesIntroDialog
|
||||||
import exh.favorites.LocalFavoritesStorage
|
import exh.favorites.LocalFavoritesStorage
|
||||||
@ -234,8 +235,8 @@ class SettingsEhController : SettingsController() {
|
|||||||
"${context.getString(R.string.app_name)} will currently never check galleries in your library for updates."
|
"${context.getString(R.string.app_name)} will currently never check galleries in your library for updates."
|
||||||
} else {
|
} else {
|
||||||
"${context.getString(R.string.app_name)} checks/updates galleries in batches. " +
|
"${context.getString(R.string.app_name)} checks/updates galleries in batches. " +
|
||||||
"This means it will wait $newVal hour(s), check ${EHentaiUpdateWorker.UPDATES_PER_ITERATION} galleries," +
|
"This means it will wait $newVal hour(s), check ${EHentaiUpdateWorkerConstants.UPDATES_PER_ITERATION} galleries," +
|
||||||
" wait $newVal hour(s), check ${EHentaiUpdateWorker.UPDATES_PER_ITERATION} and so on..."
|
" wait $newVal hour(s), check ${EHentaiUpdateWorkerConstants.UPDATES_PER_ITERATION} and so on..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import eu.kanade.tachiyomi.util.jobScheduler
|
|||||||
import eu.kanade.tachiyomi.util.syncChaptersWithSource
|
import eu.kanade.tachiyomi.util.syncChaptersWithSource
|
||||||
import exh.EH_SOURCE_ID
|
import exh.EH_SOURCE_ID
|
||||||
import exh.EXH_SOURCE_ID
|
import exh.EXH_SOURCE_ID
|
||||||
|
import exh.eh.EHentaiUpdateWorkerConstants.UPDATES_PER_ITERATION
|
||||||
import exh.metadata.metadata.EHentaiSearchMetadata
|
import exh.metadata.metadata.EHentaiSearchMetadata
|
||||||
import exh.metadata.metadata.base.*
|
import exh.metadata.metadata.base.*
|
||||||
import exh.util.await
|
import exh.util.await
|
||||||
@ -249,13 +250,10 @@ class EHentaiUpdateWorker: JobService(), CoroutineScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val UPDATES_PER_ITERATION = 50
|
|
||||||
private const val MAX_UPDATE_FAILURES = 5
|
private const val MAX_UPDATE_FAILURES = 5
|
||||||
|
|
||||||
private val MIN_BACKGROUND_UPDATE_FREQ = 1.days.inMilliseconds.longValue
|
private val MIN_BACKGROUND_UPDATE_FREQ = 1.days.inMilliseconds.longValue
|
||||||
|
|
||||||
val GALLERY_AGE_TIME = 365.days.inMilliseconds.longValue
|
|
||||||
|
|
||||||
private const val JOB_ID_UPDATE_BACKGROUND = 0
|
private const val JOB_ID_UPDATE_BACKGROUND = 0
|
||||||
private const val JOB_ID_UPDATE_BACKGROUND_TEST = 1
|
private const val JOB_ID_UPDATE_BACKGROUND_TEST = 1
|
||||||
|
|
||||||
@ -342,3 +340,8 @@ class EHentaiUpdateWorker: JobService(), CoroutineScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data class UpdateEntry(val manga: Manga, val meta: EHentaiSearchMetadata, val rootChapter: Chapter?)
|
data class UpdateEntry(val manga: Manga, val meta: EHentaiSearchMetadata, val rootChapter: Chapter?)
|
||||||
|
|
||||||
|
object EHentaiUpdateWorkerConstants {
|
||||||
|
const val UPDATES_PER_ITERATION = 50
|
||||||
|
val GALLERY_AGE_TIME = 365.days.inMilliseconds.longValue
|
||||||
|
}
|
||||||
|
@ -6,8 +6,12 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { url 'https://maven.fabric.io/public' }
|
maven { url 'https://maven.fabric.io/public' }
|
||||||
|
maven { url 'http://storage.googleapis.com/r8-releases/raw' }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
|
// Temp workaround for: https://issuetracker.google.com/issues/129730297
|
||||||
|
classpath 'com.android.tools:r8:1.4.88' // Must be before the Gradle Plugin for Android.
|
||||||
|
|
||||||
classpath 'com.android.tools.build:gradle:3.4.0'
|
classpath 'com.android.tools.build:gradle:3.4.0'
|
||||||
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
|
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
|
||||||
classpath 'com.github.zellius:android-shortcut-gradle-plugin:0.1.2'
|
classpath 'com.github.zellius:android-shortcut-gradle-plugin:0.1.2'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user