mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 01:41:48 +01:00
A few fixes and dependency updates
This commit is contained in:
parent
e3259f39f1
commit
c437a33f2a
@ -156,7 +156,7 @@ dependencies {
|
|||||||
|
|
||||||
// Job scheduling
|
// Job scheduling
|
||||||
implementation 'com.evernote:android-job:1.2.0'
|
implementation 'com.evernote:android-job:1.2.0'
|
||||||
implementation 'com.google.android.gms:play-services-gcm:11.4.2'
|
implementation 'com.google.android.gms:play-services-gcm:11.6.0'
|
||||||
|
|
||||||
// Changelog
|
// Changelog
|
||||||
implementation 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
|
implementation 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
|
||||||
@ -173,7 +173,7 @@ dependencies {
|
|||||||
implementation "uy.kohesive.injekt:injekt-core:1.16.1"
|
implementation "uy.kohesive.injekt:injekt-core:1.16.1"
|
||||||
|
|
||||||
// Image library
|
// Image library
|
||||||
final glide_version = '4.2.0'
|
final glide_version = '4.3.1'
|
||||||
implementation "com.github.bumptech.glide:glide:$glide_version"
|
implementation "com.github.bumptech.glide:glide:$glide_version"
|
||||||
implementation "com.github.bumptech.glide:okhttp3-integration:$glide_version"
|
implementation "com.github.bumptech.glide:okhttp3-integration:$glide_version"
|
||||||
kapt "com.github.bumptech.glide:compiler:$glide_version"
|
kapt "com.github.bumptech.glide:compiler:$glide_version"
|
||||||
@ -182,7 +182,7 @@ dependencies {
|
|||||||
implementation 'jp.wasabeef:glide-transformations:3.0.1'
|
implementation 'jp.wasabeef:glide-transformations:3.0.1'
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
implementation 'com.jakewharton.timber:timber:4.5.1'
|
implementation 'com.jakewharton.timber:timber:4.6.0'
|
||||||
|
|
||||||
// Crash reports
|
// Crash reports
|
||||||
implementation 'ch.acra:acra:4.9.2'
|
implementation 'ch.acra:acra:4.9.2'
|
||||||
|
@ -182,29 +182,33 @@ class BackupRestoreService : Service() {
|
|||||||
private fun getRestoreObservable(uri: Uri): Observable<List<Manga>> {
|
private fun getRestoreObservable(uri: Uri): Observable<List<Manga>> {
|
||||||
val startTime = System.currentTimeMillis()
|
val startTime = System.currentTimeMillis()
|
||||||
|
|
||||||
val reader = JsonReader(contentResolver.openInputStream(uri).bufferedReader())
|
return Observable.just(Unit)
|
||||||
val json = JsonParser().parse(reader).asJsonObject
|
.map {
|
||||||
|
val reader = JsonReader(contentResolver.openInputStream(uri).bufferedReader())
|
||||||
|
val json = JsonParser().parse(reader).asJsonObject
|
||||||
|
|
||||||
// Get parser version
|
// Get parser version
|
||||||
val version = json.get(VERSION)?.asInt ?: 1
|
val version = json.get(VERSION)?.asInt ?: 1
|
||||||
|
|
||||||
// Initialize manager
|
// Initialize manager
|
||||||
backupManager = BackupManager(this, version)
|
backupManager = BackupManager(this, version)
|
||||||
|
|
||||||
val mangasJson = json.get(MANGAS).asJsonArray
|
val mangasJson = json.get(MANGAS).asJsonArray
|
||||||
|
|
||||||
restoreAmount = mangasJson.size() + 1 // +1 for categories
|
restoreAmount = mangasJson.size() + 1 // +1 for categories
|
||||||
restoreProgress = 0
|
restoreProgress = 0
|
||||||
errors.clear()
|
errors.clear()
|
||||||
|
|
||||||
// Restore categories
|
// Restore categories
|
||||||
json.get(CATEGORIES)?.let {
|
json.get(CATEGORIES)?.let {
|
||||||
backupManager.restoreCategories(it.asJsonArray)
|
backupManager.restoreCategories(it.asJsonArray)
|
||||||
restoreProgress += 1
|
restoreProgress += 1
|
||||||
showRestoreProgress(restoreProgress, restoreAmount, "Categories added", errors.size)
|
showRestoreProgress(restoreProgress, restoreAmount, "Categories added", errors.size)
|
||||||
}
|
}
|
||||||
|
|
||||||
return Observable.from(mangasJson)
|
mangasJson
|
||||||
|
}
|
||||||
|
.flatMap { Observable.from(it) }
|
||||||
.concatMap {
|
.concatMap {
|
||||||
val obj = it.asJsonObject
|
val obj = it.asJsonObject
|
||||||
val manga = backupManager.parser.fromJson<MangaImpl>(obj.get(MANGA))
|
val manga = backupManager.parser.fromJson<MangaImpl>(obj.get(MANGA))
|
||||||
|
@ -234,5 +234,5 @@ class CatalogueMainController : NucleusController<CatalogueMainPresenter>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SettingsSourcesFadeChangeHandler : FadeChangeHandler()
|
class SettingsSourcesFadeChangeHandler : FadeChangeHandler()
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user