mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-01 22:58:57 +01:00
Always save pages/covers in subfolders
Ensures that pages and covers are grouped together.
This commit is contained in:
@@ -166,19 +166,12 @@ sealed class Image(
|
||||
}
|
||||
|
||||
sealed interface Location {
|
||||
data class Pictures private constructor(val relativePath: String) : Location {
|
||||
companion object {
|
||||
fun create(relativePath: String = ""): Pictures {
|
||||
return Pictures(relativePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
data class Pictures(val relativePath: String) : Location
|
||||
|
||||
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),
|
||||
@@ -192,6 +185,7 @@ sealed interface Location {
|
||||
}
|
||||
file
|
||||
}
|
||||
Cache -> context.cacheImageDir
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user