Inline the foreach functions
This commit is contained in:
parent
135f0bdd95
commit
646aeb66c5
@ -191,8 +191,7 @@ class DownloadCache(
|
|||||||
fun removeChapter(chapter: Chapter, manga: Manga) {
|
fun removeChapter(chapter: Chapter, manga: Manga) {
|
||||||
val sourceDir = rootDir.files[manga.source] ?: return
|
val sourceDir = rootDir.files[manga.source] ?: return
|
||||||
val mangaDir = sourceDir.files[provider.getMangaDirName(manga)] ?: return
|
val mangaDir = sourceDir.files[provider.getMangaDirName(manga)] ?: return
|
||||||
val chapterDirName = provider.getValidChapterDirNames(chapter)
|
provider.getValidChapterDirNames(chapter).forEach {
|
||||||
chapterDirName.forEach {
|
|
||||||
if (it in mangaDir.files) {
|
if (it in mangaDir.files) {
|
||||||
mangaDir.files -= it
|
mangaDir.files -= it
|
||||||
}
|
}
|
||||||
@ -210,8 +209,7 @@ class DownloadCache(
|
|||||||
val sourceDir = rootDir.files[manga.source] ?: return
|
val sourceDir = rootDir.files[manga.source] ?: return
|
||||||
val mangaDir = sourceDir.files[provider.getMangaDirName(manga)] ?: return
|
val mangaDir = sourceDir.files[provider.getMangaDirName(manga)] ?: return
|
||||||
chapters.forEach { chapter ->
|
chapters.forEach { chapter ->
|
||||||
val chapterDirName = provider.getValidChapterDirNames(chapter)
|
provider.getValidChapterDirNames(chapter).forEach {
|
||||||
chapterDirName.forEach {
|
|
||||||
if (it in mangaDir.files) {
|
if (it in mangaDir.files) {
|
||||||
mangaDir.files -= it
|
mangaDir.files -= it
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user