mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-03 15:48:56 +01:00
Minor extension update cleanup, default to on
This commit is contained in:
@@ -26,7 +26,7 @@ class BackupCreatorJob(private val context: Context, workerParams: WorkerParamet
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "BackupCreator"
|
||||
private const val TAG = "BackupCreator"
|
||||
|
||||
fun setupTask(context: Context, prefInterval: Int? = null) {
|
||||
val preferences = Injekt.get<PreferencesHelper>()
|
||||
|
||||
@@ -23,7 +23,7 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "LibraryUpdate"
|
||||
private const val TAG = "LibraryUpdate"
|
||||
|
||||
fun setupTask(context: Context, prefInterval: Int? = null) {
|
||||
val preferences = Injekt.get<PreferencesHelper>()
|
||||
|
||||
@@ -410,11 +410,9 @@ class NotificationReceiver : BroadcastReceiver() {
|
||||
internal fun markAsReadPendingBroadcast(
|
||||
context: Context,
|
||||
manga: Manga,
|
||||
chapters:
|
||||
Array<Chapter>,
|
||||
chapters: Array<Chapter>,
|
||||
groupId: Int
|
||||
):
|
||||
PendingIntent {
|
||||
): PendingIntent {
|
||||
val newIntent = Intent(context, NotificationReceiver::class.java).apply {
|
||||
action = ACTION_MARK_AS_READ
|
||||
putExtra(EXTRA_CHAPTER_URL, chapters.map { it.url }.toTypedArray())
|
||||
@@ -442,14 +440,14 @@ class NotificationReceiver : BroadcastReceiver() {
|
||||
* Returns [PendingIntent] that opens the extensions controller.
|
||||
*
|
||||
* @param context context of application
|
||||
* @return [PendingIntent]
|
||||
*/
|
||||
internal fun openExtensionsPendingActivity(context: Context): PendingIntent {
|
||||
val newIntent =
|
||||
Intent(context, MainActivity::class.java).setAction(MainActivity.SHORTCUT_EXTENSIONS)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
return PendingIntent.getActivity(
|
||||
context, 0, newIntent, PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
val intent = Intent(context, MainActivity::class.java).apply {
|
||||
action = MainActivity.SHORTCUT_EXTENSIONS
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
}
|
||||
return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun automaticUpdates() = prefs.getBoolean(Keys.automaticUpdates, true)
|
||||
|
||||
fun automaticExtUpdates() = rxPrefs.getBoolean(Keys.automaticExtUpdates, false)
|
||||
fun automaticExtUpdates() = rxPrefs.getBoolean(Keys.automaticExtUpdates, true)
|
||||
|
||||
fun extensionUpdatesCount() = rxPrefs.getInteger("ext_updates_count", 0)
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class UpdaterJob(private val context: Context, workerParams: WorkerParameters) :
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "UpdateChecker"
|
||||
private const val TAG = "UpdateChecker"
|
||||
|
||||
fun setupTask(context: Context) {
|
||||
val constraints = Constraints.Builder()
|
||||
|
||||
Reference in New Issue
Block a user