Skip to content

Commit

Permalink
Error screen improve (#462)
Browse files Browse the repository at this point in the history
- A dedicated screen in Settings for error list when updating library
- Allow to jump to Error screen if click on notification
- Allow to migrate error entry
- Create error on each entry updated instead of waiting for the whole updating list to finished
- Overwrite entry's error if new error happens after updating
- Clear entry's error if it successfully updated
- Clear un-relevant errors (entry which was removed from Library) on next update
- List of errors can jump to top/bottom or next/previous errors group
- Won't create error file anymore

* Added library update errors screen

(cherry picked from commit 7cf37d52f959ac65f53cf7657563fb4428bd9188)

* Open library update errors screen on clicking library update error notification

(cherry picked from commit d2d22f437a1d61b086f1e19dfbcd2c0a2bc125f4)

* LibraryUpdateErrorScreen's bottom UI with scroll to top/bottom buttons

(cherry picked from commit 859ce54474d456232510e21f4f6795af65489be2)

* migrate to AppBar

* sticky header

* scroll to next/previous group of errors

* insert error entry one by one

* delete error from DB when successfully updated

* clean un-relevant errors from DB on every updates

* fix errors & clean up

* catch exception & fix notification intent

---------

Co-authored-by: ImaginaryDesignation <[email protected]>
  • Loading branch information
cuong-tran and ImaginaryDesignation authored Oct 26, 2024
1 parent 454249d commit bc460dd
Show file tree
Hide file tree
Showing 27 changed files with 579 additions and 230 deletions.
28 changes: 0 additions & 28 deletions app/src/main/java/eu/kanade/domain/DomainModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ import mihon.domain.upcoming.interactor.GetUpcomingManga
import tachiyomi.data.category.CategoryRepositoryImpl
import tachiyomi.data.chapter.ChapterRepositoryImpl
import tachiyomi.data.history.HistoryRepositoryImpl
import tachiyomi.data.libraryUpdateError.LibraryUpdateErrorRepositoryImpl
import tachiyomi.data.libraryUpdateError.LibraryUpdateErrorWithRelationsRepositoryImpl
import tachiyomi.data.libraryUpdateErrorMessage.LibraryUpdateErrorMessageRepositoryImpl
import tachiyomi.data.manga.MangaRepositoryImpl
import tachiyomi.data.release.ReleaseServiceImpl
import tachiyomi.data.source.SourceRepositoryImpl
Expand Down Expand Up @@ -70,16 +67,6 @@ import tachiyomi.domain.history.interactor.GetTotalReadDuration
import tachiyomi.domain.history.interactor.RemoveHistory
import tachiyomi.domain.history.interactor.UpsertHistory
import tachiyomi.domain.history.repository.HistoryRepository
import tachiyomi.domain.libraryUpdateError.interactor.DeleteLibraryUpdateErrors
import tachiyomi.domain.libraryUpdateError.interactor.GetLibraryUpdateErrorWithRelations
import tachiyomi.domain.libraryUpdateError.interactor.GetLibraryUpdateErrors
import tachiyomi.domain.libraryUpdateError.interactor.InsertLibraryUpdateErrors
import tachiyomi.domain.libraryUpdateError.repository.LibraryUpdateErrorRepository
import tachiyomi.domain.libraryUpdateError.repository.LibraryUpdateErrorWithRelationsRepository
import tachiyomi.domain.libraryUpdateErrorMessage.interactor.DeleteLibraryUpdateErrorMessages
import tachiyomi.domain.libraryUpdateErrorMessage.interactor.GetLibraryUpdateErrorMessages
import tachiyomi.domain.libraryUpdateErrorMessage.interactor.InsertLibraryUpdateErrorMessages
import tachiyomi.domain.libraryUpdateErrorMessage.repository.LibraryUpdateErrorMessageRepository
import tachiyomi.domain.manga.interactor.FetchInterval
import tachiyomi.domain.manga.interactor.GetDuplicateLibraryManga
import tachiyomi.domain.manga.interactor.GetFavorites
Expand Down Expand Up @@ -183,21 +170,6 @@ class DomainModule : InjektModule {
addSingletonFactory<UpdatesRepository> { UpdatesRepositoryImpl(get()) }
addFactory { GetUpdates(get()) }

addSingletonFactory<LibraryUpdateErrorWithRelationsRepository> {
LibraryUpdateErrorWithRelationsRepositoryImpl(get())
}
addFactory { GetLibraryUpdateErrorWithRelations(get()) }

addSingletonFactory<LibraryUpdateErrorMessageRepository> { LibraryUpdateErrorMessageRepositoryImpl(get()) }
addFactory { GetLibraryUpdateErrorMessages(get()) }
addFactory { DeleteLibraryUpdateErrorMessages(get()) }
addFactory { InsertLibraryUpdateErrorMessages(get()) }

addSingletonFactory<LibraryUpdateErrorRepository> { LibraryUpdateErrorRepositoryImpl(get()) }
addFactory { GetLibraryUpdateErrors(get()) }
addFactory { DeleteLibraryUpdateErrors(get()) }
addFactory { InsertLibraryUpdateErrors(get()) }

addSingletonFactory<SourceRepository> { SourceRepositoryImpl(get(), get()) }
addSingletonFactory<StubSourceRepository> { StubSourceRepositoryImpl(get()) }
addFactory { GetEnabledSources(get(), get()) }
Expand Down
40 changes: 40 additions & 0 deletions app/src/main/java/eu/kanade/domain/KMKDomainModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package eu.kanade.domain

import tachiyomi.data.libraryUpdateError.LibraryUpdateErrorRepositoryImpl
import tachiyomi.data.libraryUpdateError.LibraryUpdateErrorWithRelationsRepositoryImpl
import tachiyomi.data.libraryUpdateErrorMessage.LibraryUpdateErrorMessageRepositoryImpl
import tachiyomi.domain.libraryUpdateError.interactor.DeleteLibraryUpdateErrors
import tachiyomi.domain.libraryUpdateError.interactor.GetLibraryUpdateErrorWithRelations
import tachiyomi.domain.libraryUpdateError.interactor.GetLibraryUpdateErrors
import tachiyomi.domain.libraryUpdateError.interactor.InsertLibraryUpdateErrors
import tachiyomi.domain.libraryUpdateError.repository.LibraryUpdateErrorRepository
import tachiyomi.domain.libraryUpdateError.repository.LibraryUpdateErrorWithRelationsRepository
import tachiyomi.domain.libraryUpdateErrorMessage.interactor.DeleteLibraryUpdateErrorMessages
import tachiyomi.domain.libraryUpdateErrorMessage.interactor.GetLibraryUpdateErrorMessages
import tachiyomi.domain.libraryUpdateErrorMessage.interactor.InsertLibraryUpdateErrorMessages
import tachiyomi.domain.libraryUpdateErrorMessage.repository.LibraryUpdateErrorMessageRepository
import uy.kohesive.injekt.api.InjektModule
import uy.kohesive.injekt.api.InjektRegistrar
import uy.kohesive.injekt.api.addFactory
import uy.kohesive.injekt.api.addSingletonFactory
import uy.kohesive.injekt.api.get

class KMKDomainModule : InjektModule {

override fun InjektRegistrar.registerInjectables() {
addSingletonFactory<LibraryUpdateErrorWithRelationsRepository> {
LibraryUpdateErrorWithRelationsRepositoryImpl(get())
}
addFactory { GetLibraryUpdateErrorWithRelations(get()) }

addSingletonFactory<LibraryUpdateErrorMessageRepository> { LibraryUpdateErrorMessageRepositoryImpl(get()) }
addFactory { GetLibraryUpdateErrorMessages(get()) }
addFactory { DeleteLibraryUpdateErrorMessages(get()) }
addFactory { InsertLibraryUpdateErrorMessages(get()) }

addSingletonFactory<LibraryUpdateErrorRepository> { LibraryUpdateErrorRepositoryImpl(get()) }
addFactory { GetLibraryUpdateErrors(get()) }
addFactory { DeleteLibraryUpdateErrors(get()) }
addFactory { InsertLibraryUpdateErrors(get()) }
}
}
Loading

0 comments on commit bc460dd

Please sign in to comment.