mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 21:18:56 +01:00
Add option to prevent deleting bookmarked chapters (closes #2082)
This commit is contained in:
@@ -494,8 +494,14 @@ class MangaPresenter(
|
||||
* @param chapters the chapters to delete.
|
||||
*/
|
||||
private fun deleteChaptersInternal(chapters: List<ChapterItem>) {
|
||||
downloadManager.deleteChapters(chapters, manga, source)
|
||||
chapters.forEach {
|
||||
val filteredChapters = if (!preferences.removeBookmarkedChapters()) {
|
||||
chapters.filterNot { it.bookmark }
|
||||
} else {
|
||||
chapters
|
||||
}
|
||||
|
||||
downloadManager.deleteChapters(filteredChapters, manga, source)
|
||||
filteredChapters.forEach {
|
||||
it.status = Download.NOT_DOWNLOADED
|
||||
it.download = null
|
||||
}
|
||||
|
||||
@@ -84,6 +84,11 @@ class SettingsDownloadController : SettingsController() {
|
||||
defaultValue = "-1"
|
||||
summary = "%s"
|
||||
}
|
||||
switchPreference {
|
||||
key = Keys.removeBookmarkedChapters
|
||||
titleRes = R.string.pref_remove_bookmarked_chapters
|
||||
defaultValue = false
|
||||
}
|
||||
}
|
||||
|
||||
val dbCategories = db.getCategories().executeAsBlocking()
|
||||
|
||||
Reference in New Issue
Block a user