mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +01:00
Always save pages/covers in subfolders
Ensures that pages and covers are grouped together.
This commit is contained in:
@@ -102,8 +102,8 @@ class MangaCoverScreenModel(
|
||||
imageSaver.save(
|
||||
Image.Cover(
|
||||
bitmap = bitmap,
|
||||
name = manga.title,
|
||||
location = if (temp) Location.Cache else Location.Pictures.create(),
|
||||
name = "cover",
|
||||
location = if (temp) Location.Cache else Location.Pictures(manga.title),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user