mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-13 12:38:58 +01:00
Minor changes and fixes
This commit is contained in:
@@ -26,6 +26,8 @@ class ChangelogDialogFragment : DialogFragment() {
|
||||
ChangelogDialogFragment().show(fm, "changelog")
|
||||
|
||||
// TODO better upgrades management
|
||||
if (oldVersion == 0) return
|
||||
|
||||
if (oldVersion < 14) {
|
||||
// Restore jobs after upgrading to evernote's job scheduler.
|
||||
if (BuildConfig.INCLUDE_UPDATER && preferences.automaticUpdates()) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.support.v4.content.FileProvider
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.notificationManager
|
||||
import java.io.File
|
||||
@@ -61,7 +62,7 @@ class ImageNotificationReceiver : BroadcastReceiver() {
|
||||
private fun showImage(context: Context, path: String) {
|
||||
val intent = Intent(Intent.ACTION_VIEW).apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_MULTIPLE_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION
|
||||
val uri = FileProvider.getUriForFile(context, "eu.kanade.tachiyomi.provider", File(path))
|
||||
val uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", File(path))
|
||||
setDataAndType(uri, "image/*")
|
||||
}
|
||||
context.startActivity(intent)
|
||||
|
||||
@@ -83,10 +83,11 @@ class SettingsDownloadsFragment : SettingsFragment() {
|
||||
|
||||
subscriptions += preferences.downloadsDirectory().asObservable()
|
||||
.subscribe { path ->
|
||||
downloadDirPref.summary = path
|
||||
val dir = UniFile.fromUri(context, Uri.parse(path))
|
||||
|
||||
downloadDirPref.summary = dir.filePath ?: path
|
||||
|
||||
// Don't display downloaded chapters in gallery apps creating a ".nomedia" file.
|
||||
val dir = UniFile.fromUri(context, Uri.parse(path))
|
||||
if (dir != null && dir.exists()) {
|
||||
dir.createFile(".nomedia")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user