Cherry pick fixes
This commit is contained in:
parent
3b55bc25dd
commit
c8de918e46
@ -34,7 +34,7 @@ fun List<Chapter>.applyFilters(manga: Manga, downloadManager: DownloadManager):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.filter { chapter ->
|
.filter { chapter ->
|
||||||
val downloaded = downloadManager.isChapterDownloaded(chapter.name, chapter.scanlator,/* SY --> */ manga.ogTitle /* SY <-- */, manga.source)
|
val downloaded = downloadManager.isChapterDownloaded(chapter.name, chapter.scanlator, /* SY --> */ manga.ogTitle /* SY <-- */, manga.source)
|
||||||
val downloadState = when {
|
val downloadState = when {
|
||||||
downloaded -> Download.State.DOWNLOADED
|
downloaded -> Download.State.DOWNLOADED
|
||||||
else -> Download.State.NOT_DOWNLOADED
|
else -> Download.State.NOT_DOWNLOADED
|
||||||
|
@ -328,8 +328,8 @@ class DownloadManager(
|
|||||||
if (removeRead) {
|
if (removeRead) {
|
||||||
val readChapters = allChapters.filter { it.read }
|
val readChapters = allChapters.filter { it.read }
|
||||||
val readChapterDirs = provider.findChapterDirs(readChapters, manga, source)
|
val readChapterDirs = provider.findChapterDirs(readChapters, manga, source)
|
||||||
readChapterDirs.forEach { it.delete() }
|
readChapterDirs.second.forEach { it.delete() }
|
||||||
cleaned += readChapterDirs.size
|
cleaned += readChapterDirs.second.size
|
||||||
cache.removeChapters(readChapters, manga)
|
cache.removeChapters(readChapters, manga)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,44 +184,4 @@ class DownloadPendingDeleter(
|
|||||||
val title: String,
|
val title: String,
|
||||||
val source: Long,
|
val source: Long,
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a manga entry from a manga model.
|
|
||||||
*/
|
|
||||||
private fun Manga.toEntry(): MangaEntry {
|
|
||||||
return MangaEntry(id!!, url, /* SY --> */ ogTitle /* SY <-- */, source)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a chapter entry from a chapter model.
|
|
||||||
*/
|
|
||||||
private fun Chapter.toEntry(): ChapterEntry {
|
|
||||||
return ChapterEntry(id!!, url, name, scanlator)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a manga model from a manga entry.
|
|
||||||
*/
|
|
||||||
private fun MangaEntry.toModel(): Manga {
|
|
||||||
return Manga.create().copy(
|
|
||||||
url = url,
|
|
||||||
// SY -->
|
|
||||||
ogTitle = title,
|
|
||||||
// SY <--
|
|
||||||
source = source,
|
|
||||||
id = id,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a chapter model from a chapter entry.
|
|
||||||
*/
|
|
||||||
private fun ChapterEntry.toModel(): Chapter {
|
|
||||||
return Chapter.create().copy(
|
|
||||||
id = id,
|
|
||||||
url = url,
|
|
||||||
name = name,
|
|
||||||
scanlator = scanlator,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,6 @@ class MangaInfoScreenModel(
|
|||||||
private val downloadCache: DownloadCache = Injekt.get(),
|
private val downloadCache: DownloadCache = Injekt.get(),
|
||||||
private val getMangaAndChapters: GetMangaWithChapters = Injekt.get(),
|
private val getMangaAndChapters: GetMangaWithChapters = Injekt.get(),
|
||||||
// SY -->
|
// SY -->
|
||||||
private val uiPreferences: UiPreferences = Injekt.get(),
|
|
||||||
private val readerPreferences: ReaderPreferences = Injekt.get(),
|
private val readerPreferences: ReaderPreferences = Injekt.get(),
|
||||||
private val getManga: GetManga = Injekt.get(),
|
private val getManga: GetManga = Injekt.get(),
|
||||||
private val setMangaFilteredScanlators: SetMangaFilteredScanlators = Injekt.get(),
|
private val setMangaFilteredScanlators: SetMangaFilteredScanlators = Injekt.get(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user