Removed source from the remove cached chapters method

This commit is contained in:
Jay 2020-01-08 23:40:40 -08:00
parent 7edc47f24e
commit a3d03835f6
2 changed files with 2 additions and 2 deletions

View File

@ -204,7 +204,7 @@ class DownloadCache(
* @param manga the manga of the chapter.
*/
@Synchronized
fun removeChapters(chapters: List<Chapter>, manga: Manga, source: Source) {
fun removeChapters(chapters: List<Chapter>, manga: Manga) {
val sourceDir = rootDir.files[manga.source] ?: return
val mangaDir = sourceDir.files[provider.getMangaDirName(manga)] ?: return
for (chapter in chapters) {

View File

@ -206,7 +206,7 @@ class DownloadManager(val context: Context) {
queue.remove(chapters)
val chapterDirs = provider.findChapterDirs(chapters, manga, source) + provider.findTempChapterDirs(chapters, manga, source)
chapterDirs.forEach { it.delete() }
cache.removeChapters(chapters, manga, source)
cache.removeChapters(chapters, manga)
if (cache.getDownloadCount(manga) == 0) { // Delete manga directory if empty
chapterDirs.firstOrNull()?.parentFile?.delete()
}