mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix: Last minute change, use normalized app name as default folder name
Fixes GH-27
This commit is contained in:
parent
9a4149fb88
commit
ceb4ebab05
5 changed files with 8 additions and 7 deletions
|
@ -10,6 +10,7 @@
|
||||||
## Changes
|
## Changes
|
||||||
- Added splash to reader (in case it being opened from shortcut)
|
- Added splash to reader (in case it being opened from shortcut)
|
||||||
- Increased long strip split height
|
- Increased long strip split height
|
||||||
|
- Use normalized app name by default as folder name
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
- Fixed cutout support being broken
|
- Fixed cutout support being broken
|
||||||
|
|
|
@ -69,7 +69,7 @@ class PreferencesHelper(val context: Context, val preferenceStore: PreferenceSto
|
||||||
private val defaultDownloadsDir = Uri.fromFile(
|
private val defaultDownloadsDir = Uri.fromFile(
|
||||||
File(
|
File(
|
||||||
Environment.getExternalStorageDirectory().absolutePath + File.separator +
|
Environment.getExternalStorageDirectory().absolutePath + File.separator +
|
||||||
context.getString(R.string.app_name),
|
context.getString(R.string.app_normalized_name),
|
||||||
"downloads",
|
"downloads",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -77,7 +77,7 @@ class PreferencesHelper(val context: Context, val preferenceStore: PreferenceSto
|
||||||
private val defaultBackupDir = Uri.fromFile(
|
private val defaultBackupDir = Uri.fromFile(
|
||||||
File(
|
File(
|
||||||
Environment.getExternalStorageDirectory().absolutePath + File.separator +
|
Environment.getExternalStorageDirectory().absolutePath + File.separator +
|
||||||
context.getString(R.string.app_name),
|
context.getString(R.string.app_normalized_name),
|
||||||
"backup",
|
"backup",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -860,14 +860,14 @@ class MangaDetailsPresenter(
|
||||||
val directory = if (preferences.folderPerManga().get()) {
|
val directory = if (preferences.folderPerManga().get()) {
|
||||||
val baseDir = Environment.getExternalStorageDirectory().absolutePath +
|
val baseDir = Environment.getExternalStorageDirectory().absolutePath +
|
||||||
File.separator + Environment.DIRECTORY_PICTURES +
|
File.separator + Environment.DIRECTORY_PICTURES +
|
||||||
File.separator + preferences.context.getString(R.string.app_name)
|
File.separator + preferences.context.getString(R.string.app_normalized_name)
|
||||||
|
|
||||||
File(baseDir + File.separator + DiskUtil.buildValidFilename(manga.title))
|
File(baseDir + File.separator + DiskUtil.buildValidFilename(manga.title))
|
||||||
} else {
|
} else {
|
||||||
File(
|
File(
|
||||||
Environment.getExternalStorageDirectory().absolutePath +
|
Environment.getExternalStorageDirectory().absolutePath +
|
||||||
File.separator + Environment.DIRECTORY_PICTURES +
|
File.separator + Environment.DIRECTORY_PICTURES +
|
||||||
File.separator + preferences.context.getString(R.string.app_name),
|
File.separator + preferences.context.getString(R.string.app_normalized_name),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val file = saveCover(directory)
|
val file = saveCover(directory)
|
||||||
|
|
|
@ -816,7 +816,7 @@ class ReaderViewModel(
|
||||||
// Pictures directory.
|
// Pictures directory.
|
||||||
val baseDir = Environment.getExternalStorageDirectory().absolutePath +
|
val baseDir = Environment.getExternalStorageDirectory().absolutePath +
|
||||||
File.separator + Environment.DIRECTORY_PICTURES +
|
File.separator + Environment.DIRECTORY_PICTURES +
|
||||||
File.separator + context.getString(R.string.app_name)
|
File.separator + context.getString(R.string.app_normalized_name)
|
||||||
val destDir = if (preferences.folderPerManga().get()) {
|
val destDir = if (preferences.folderPerManga().get()) {
|
||||||
File(baseDir + File.separator + DiskUtil.buildValidFilename(manga.title))
|
File(baseDir + File.separator + DiskUtil.buildValidFilename(manga.title))
|
||||||
} else {
|
} else {
|
||||||
|
@ -850,7 +850,7 @@ class ReaderViewModel(
|
||||||
// Pictures directory.
|
// Pictures directory.
|
||||||
val baseDir = Environment.getExternalStorageDirectory().absolutePath +
|
val baseDir = Environment.getExternalStorageDirectory().absolutePath +
|
||||||
File.separator + Environment.DIRECTORY_PICTURES +
|
File.separator + Environment.DIRECTORY_PICTURES +
|
||||||
File.separator + context.getString(R.string.app_name)
|
File.separator + context.getString(R.string.app_normalized_name)
|
||||||
val destDir = if (preferences.folderPerManga().get()) {
|
val destDir = if (preferences.folderPerManga().get()) {
|
||||||
File(baseDir + File.separator + DiskUtil.buildValidFilename(manga.title))
|
File(baseDir + File.separator + DiskUtil.buildValidFilename(manga.title))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -205,7 +205,7 @@ class SettingsDownloadController : SettingsController() {
|
||||||
|
|
||||||
private fun getExternalDirs(): List<File> {
|
private fun getExternalDirs(): List<File> {
|
||||||
val defaultDir = Environment.getExternalStorageDirectory().absolutePath +
|
val defaultDir = Environment.getExternalStorageDirectory().absolutePath +
|
||||||
File.separator + activity.resources?.getString(R.string.app_name) +
|
File.separator + activity.resources?.getString(R.string.app_normalized_name) +
|
||||||
File.separator + "downloads"
|
File.separator + "downloads"
|
||||||
|
|
||||||
return mutableListOf(File(defaultDir)) +
|
return mutableListOf(File(defaultDir)) +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue