From 6a30a75e3ede91175e9065114d129bf31c931ea5 Mon Sep 17 00:00:00 2001 From: len Date: Thu, 8 Sep 2016 18:30:29 +0200 Subject: [PATCH] Upgrade dependencies, use new Timber's overloaded method for errors --- app/build.gradle | 8 ++++---- .../kanade/tachiyomi/data/download/DownloadManager.kt | 10 +++++----- .../tachiyomi/data/updater/UpdateDownloaderService.kt | 4 ++-- .../eu/kanade/tachiyomi/ui/backup/BackupFragment.kt | 6 +++--- .../kanade/tachiyomi/ui/catalogue/CatalogueFragment.kt | 2 +- .../tachiyomi/ui/catalogue/CataloguePresenter.kt | 4 ++-- .../kanade/tachiyomi/ui/download/DownloadPresenter.kt | 2 +- .../eu/kanade/tachiyomi/ui/library/LibraryFragment.kt | 2 +- .../tachiyomi/ui/manga/chapter/ChaptersFragment.kt | 2 +- .../tachiyomi/ui/manga/chapter/ChaptersPresenter.kt | 2 +- .../ui/manga/myanimelist/MyAnimeListPresenter.kt | 2 +- .../eu/kanade/tachiyomi/ui/reader/ChapterLoader.kt | 6 +++--- .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 2 +- .../ui/recent_updates/RecentChaptersFragment.kt | 2 +- .../ui/recent_updates/RecentChaptersPresenter.kt | 2 +- .../ui/recently_read/RecentlyReadPresenter.kt | 2 +- .../tachiyomi/ui/setting/SettingsAboutFragment.kt | 2 +- 17 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a60ef1f046..5c9fd56d1f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -83,7 +83,7 @@ android { dependencies { // Modified dependencies - compile 'com.github.inorichi:subsampling-scale-image-view:421fb81' + compile 'com.github.inorichi:subsampling-scale-image-view:2d9c854' compile 'com.github.inorichi:ReactiveNetwork:69092ed' // Android support library @@ -100,7 +100,7 @@ dependencies { // ReactiveX compile 'io.reactivex:rxandroid:1.2.1' - compile 'io.reactivex:rxjava:1.1.8' + compile 'io.reactivex:rxjava:1.1.10' compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2' // Network client @@ -113,7 +113,7 @@ dependencies { compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" // IO - compile 'com.squareup.okio:okio:1.9.0' + compile 'com.squareup.okio:okio:1.10.0' // JSON compile 'com.google.code.gson:gson:2.7' @@ -151,7 +151,7 @@ dependencies { compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar' // Logging - compile 'com.jakewharton.timber:timber:4.1.2' + compile 'com.jakewharton.timber:timber:4.3.0' // Crash reports compile 'ch.acra:acra:4.9.0' diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt index 483f06ba6b..1661d6a444 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt @@ -80,10 +80,10 @@ class DownloadManager( if (areAllDownloadsFinished()) { DownloadService.stop(context) } - }, { e -> + }, { error -> DownloadService.stop(context) - Timber.e(e, e.message) - downloadNotifier.onError(e.message) + Timber.e(error) + downloadNotifier.onError(error.message) }) if (!isRunning) { @@ -369,8 +369,8 @@ class DownloadManager( try { it.write(gson.toJson(pages).toByteArray()) it.flush() - } catch (e: Exception) { - Timber.e(e, e.message) + } catch (error: Exception) { + Timber.e(error) } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdateDownloaderService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdateDownloaderService.kt index 3cd50c152d..562277a30b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdateDownloaderService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdateDownloaderService.kt @@ -121,8 +121,8 @@ class UpdateDownloaderService : IntentService(UpdateDownloaderService::class.jav UpdateNotificationReceiver.cancelNotificationIntent(ctx)) } - } catch (e: Exception) { - Timber.e(e, e.message) + } catch (error: Exception) { + Timber.e(error) // Prompt the user to retry the download. NotificationCompat.Builder(this).update { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/backup/BackupFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/backup/BackupFragment.kt index 8f06b2cbc6..28d4c01c7d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/backup/BackupFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/backup/BackupFragment.kt @@ -121,9 +121,9 @@ class BackupFragment : BaseRxFragment() { .observeOn(AndroidSchedulers.mainThread()) .subscribe({ presenter.restoreBackup(it) - }, { - context.toast(it.message) - Timber.e(it, it.message) + }, { error -> + context.toast(error.message) + Timber.e(error) }) .apply { subscriptions.add(this) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.kt index e50bb26f41..42c073b025 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.kt @@ -332,7 +332,7 @@ class CatalogueFragment : BaseRxFragment(), FlexibleViewHold */ fun onAddPageError(error: Throwable) { hideProgressBar() - Timber.e(error, error.message) + Timber.e(error) catalogue_view.snack(error.message ?: "", Snackbar.LENGTH_INDEFINITE) { setAction(R.string.action_retry) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.kt index e4818f12a9..ec81d486d9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.kt @@ -143,7 +143,7 @@ class CataloguePresenter : BasePresenter() { .subscribeReplay({ view, page -> view.onAddPage(page.page, page.mangas) }, { view, error -> - Timber.e(error, error.message) + Timber.e(error) }) // Request first page. @@ -211,7 +211,7 @@ class CataloguePresenter : BasePresenter() { @Suppress("DEPRECATION") view?.onMangaInitialized(manga) }, { error -> - Timber.e(error, error.message) + Timber.e(error) }) .apply { add(this) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadPresenter.kt index ca6b312697..d02582a5cc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadPresenter.kt @@ -35,7 +35,7 @@ class DownloadPresenter : BasePresenter() { .subscribeLatestCache({ view, downloads -> view.onNextDownloads(downloads) }, { view, error -> - Timber.e(error, error.message) + Timber.e(error) }) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt index 62d441e882..62c783dcca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt @@ -427,7 +427,7 @@ class LibraryFragment : BaseRxFragment(), ActionMode.Callback } } catch (error: IOException) { context.toast(R.string.notification_manga_update_failed) - Timber.e(error, error.message) + Timber.e(error) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt index 577f96fa04..8180f37b50 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt @@ -376,7 +376,7 @@ class ChaptersFragment : BaseRxFragment(), ActionMode.Callbac fun onChaptersDeletedError(error: Throwable) { dismissDeletingDialog() - Timber.e(error, error.message) + Timber.e(error) } fun dismissDeletingDialog() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt index 3eb6e2ff4b..df212d13f0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt @@ -111,7 +111,7 @@ class ChaptersPresenter : BasePresenter() { startableLatestCache(CHAPTER_STATUS_CHANGES, { getChapterStatusObservable() }, { view, download -> view.onChapterStatusChange(download) }, - { view, error -> Timber.e(error.cause, error.message) }) + { view, error -> Timber.e(error) }) // Find the active manga from the shared data or return. manga = SharedData.get(MangaEvent::class.java)?.manga ?: return diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/myanimelist/MyAnimeListPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/myanimelist/MyAnimeListPresenter.kt index f9d26b33a8..248d04a963 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/myanimelist/MyAnimeListPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/myanimelist/MyAnimeListPresenter.kt @@ -102,7 +102,7 @@ class MyAnimeListPresenter : BasePresenter() { .observeOn(AndroidSchedulers.mainThread()) .subscribe({ next -> }, { error -> - Timber.e(error, error.message) + Timber.e(error) // Restart on error to set old values start(GET_MANGA_SYNC) })) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ChapterLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ChapterLoader.kt index 225a48aa5f..e7c8a35b9b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ChapterLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ChapterLoader.kt @@ -42,9 +42,9 @@ class ChapterLoader( .repeat() .subscribeOn(Schedulers.io()) .subscribe({ - }, { - if (it !is InterruptedException) { - Timber.e(it, it.message) + }, { error -> + if (error !is InterruptedException) { + Timber.e(error) } }) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index a87a895961..be9f9e735c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -213,7 +213,7 @@ class ReaderActivity : BaseRxActivity() { } fun onChapterError(error: Throwable) { - Timber.e(error, error.message) + Timber.e(error) finish() toast(error.message) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersFragment.kt index 8734456f99..c59cd7f71d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersFragment.kt @@ -253,7 +253,7 @@ class RecentChaptersFragment */ fun onChaptersDeletedError(error: Throwable) { dismissDeletingDialog() - Timber.e(error, error.message) + Timber.e(error) } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersPresenter.kt index f08af45996..219b6b8071 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersPresenter.kt @@ -71,7 +71,7 @@ class RecentChaptersPresenter : BasePresenter() { // Set chapter status view.onChapterStatusChange(download) }, - { view, error -> Timber.e(error.cause, error.message) } + { view, error -> Timber.e(error) } ) if (savedState == null) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadPresenter.kt index bcae72c1a5..9f50473a4e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadPresenter.kt @@ -115,7 +115,7 @@ class RecentlyReadPresenter : BasePresenter() { .subscribeFirst({ view, chapter -> view.onOpenNextChapter(chapter, manga) }, { view, error -> - Timber.e(error, error.message) + Timber.e(error) }) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutFragment.kt index 7a74634782..aa8b97b94f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutFragment.kt @@ -133,7 +133,7 @@ class SettingsAboutFragment : SettingsFragment() { } } }, { error -> - Timber.e(error, error.message) + Timber.e(error) }) }