diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt index 1e8a98376b..1b973c4f25 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt @@ -50,7 +50,6 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.base.controller.DialogController @@ -64,17 +63,17 @@ import eu.kanade.tachiyomi.util.getUriCompat import eu.kanade.tachiyomi.util.snack import eu.kanade.tachiyomi.util.toast import eu.kanade.tachiyomi.util.truncateCenter -import java.io.File -import java.text.DecimalFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale import jp.wasabeef.glide.transformations.CropSquareTransformation import jp.wasabeef.glide.transformations.MaskTransformation import kotlinx.android.synthetic.main.main_activity.* import kotlinx.android.synthetic.main.manga_info_controller.* import timber.log.Timber import uy.kohesive.injekt.injectLazy +import java.io.File +import java.text.DecimalFormat +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale /** * Fragment that shows manga information. @@ -207,7 +206,7 @@ class MangaInfoController : NucleusController(), * @param manga manga object containing information about manga. * @param source the source of the manga. */ - fun onNextManga(manga: Manga, source: Source) { + fun onNextManga(manga: Manga) { if (manga.initialized) { // Update view. setMangaInfo(manga) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt index cd2c20288e..6697499704 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt @@ -14,10 +14,6 @@ import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter import eu.kanade.tachiyomi.util.DiskUtil -import java.io.File -import java.io.FileOutputStream -import java.io.OutputStream -import java.util.Date import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope @@ -29,6 +25,10 @@ import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get +import java.io.File +import java.io.FileOutputStream +import java.io.OutputStream +import java.util.Date /** * Presenter of MangaInfoFragment. @@ -74,7 +74,7 @@ class MangaInfoPresenter( * Sends the active manga to the view. */ fun sendMangaToView() { - view?.onNextManga(manga, source) + view?.onNextManga(manga) } /** @@ -89,10 +89,10 @@ class MangaInfoPresenter( job = launch(CoroutineExceptionHandler { _, _ -> GlobalScope.launch(Dispatchers.Main) { MangaInfoController::onFetchMangaError } }) { - coverCache.deleteFromCache(manga.thumbnail_url) val networkManga = source.fetchMangaDetails(manga) manga.copyFrom(networkManga) manga.initialized = true + coverCache.deleteFromCache(manga.thumbnail_url) db.insertManga(manga).executeAsBlocking() withContext(Dispatchers.Main) {