Decouple Cache and Download behaviour (#493)

* Separate cache dir from download dir

* Move downloader logic outside of caching/image download logic

* remove unnecessary method duplication

* moved download logic inside download provider

* optimize and handle partial downloads

* made code review changes
This commit is contained in:
akabhirav
2023-02-12 20:26:26 +05:30
committed by GitHub
parent a027d6df1b
commit b10062c73d
9 changed files with 188 additions and 62 deletions

View File

@@ -327,9 +327,7 @@ object Chapter {
ChapterTable.select { (ChapterTable.manga eq mangaId) and (ChapterTable.sourceOrder eq chapterIndex) }
.first()[ChapterTable.id].value
val chapterDir = getChapterDir(mangaId, chapterId)
File(chapterDir).deleteRecursively()
ChapterDownloadHelper.delete(mangaId, chapterId)
ChapterTable.update({ (ChapterTable.manga eq mangaId) and (ChapterTable.sourceOrder eq chapterIndex) }) {
it[isDownloaded] = false