Revert "Always save pages/covers in subfolders"

This reverts commit 8568d5d6c3.

Closes #10052
This commit is contained in:
arkon
2023-11-04 16:37:03 -04:00
parent 4a2ee0b596
commit 4b225a4ff1
61 changed files with 133 additions and 6 deletions

View File

@@ -168,12 +168,19 @@ sealed class Image(
}
sealed interface Location {
data class Pictures(val relativePath: String) : Location
data class Pictures private constructor(val relativePath: String) : Location {
companion object {
fun create(relativePath: String = ""): Pictures {
return Pictures(relativePath)
}
}
}
data object Cache : Location
fun directory(context: Context): File {
return when (this) {
Cache -> context.cacheImageDir
is Pictures -> {
val file = File(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),
@@ -187,7 +194,6 @@ sealed interface Location {
}
file
}
Cache -> context.cacheImageDir
}
}
}