Always save pages/covers in subfolders

Ensures that pages and covers are grouped together.
This commit is contained in:
arkon
2023-10-08 17:04:02 -04:00
parent 7ed99fbbd6
commit 8568d5d6c3
6 changed files with 6 additions and 24 deletions
@@ -740,17 +740,14 @@ class ReaderViewModel @JvmOverloads constructor(
val filename = generateFilename(manga, page)
// Pictures directory.
val relativePath = if (readerPreferences.folderPerManga().get()) DiskUtil.buildValidFilename(manga.title) else ""
// Copy file in background.
// Copy file in background
viewModelScope.launchNonCancellable {
try {
val uri = imageSaver.save(
image = Image.Page(
inputStream = page.stream!!,
name = filename,
location = Location.Pictures.create(relativePath),
location = Location.Pictures(DiskUtil.buildValidFilename(manga.title)),
),
)
withUIContext {
@@ -54,8 +54,6 @@ class ReaderPreferences(
fun readerHideThreshold() = preferenceStore.getEnum("reader_hide_threshold", ReaderHideThreshold.LOW)
fun folderPerManga() = preferenceStore.getBoolean("create_folder_per_manga", false)
fun skipRead() = preferenceStore.getBoolean("skip_read", false)
fun skipFiltered() = preferenceStore.getBoolean("skip_filtered", true)