Initial Improvements:
Trust all extensions Remove rate limits Re add 1, 3, 6 and 8 hour intervals
This commit is contained in:
parent
a76fe20b0b
commit
4bb24ffd95
@ -10,6 +10,11 @@ Mihon is a free and open source manga reader for Android 6.0 and above. This ver
|
||||
|
||||
## Features
|
||||
|
||||
Features of SY-Plus include:
|
||||
* Automatically trust extensions
|
||||
* Removal of rate limits
|
||||
* Re addition of more frequent library update timers
|
||||
|
||||
Features of Mihon(original) include:
|
||||
* Online reading from a variety of sources
|
||||
* Local reading of downloaded content
|
||||
|
@ -487,13 +487,6 @@ object SettingsAdvancedScreen : SearchableSettings {
|
||||
}
|
||||
},
|
||||
),
|
||||
Preference.PreferenceItem.TextPreference(
|
||||
title = stringResource(MR.strings.ext_revoke_trust),
|
||||
onClick = {
|
||||
trustExtension.revokeAll()
|
||||
context.toast(MR.strings.requires_app_restart)
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
@ -275,7 +275,10 @@ object SettingsDataScreen : SearchableSettings {
|
||||
preference = backupPreferences.backupInterval(),
|
||||
entries = persistentMapOf(
|
||||
0 to stringResource(MR.strings.off),
|
||||
1 to stringResource(MR.strings.update_1hour),
|
||||
3 to stringResource(MR.strings.update_3hour),
|
||||
6 to stringResource(MR.strings.update_6hour),
|
||||
8 to stringResource(MR.strings.update_8hour),
|
||||
12 to stringResource(MR.strings.update_12hour),
|
||||
24 to stringResource(MR.strings.update_24hour),
|
||||
48 to stringResource(MR.strings.update_48hour),
|
||||
|
@ -157,6 +157,10 @@ object SettingsLibraryScreen : SearchableSettings {
|
||||
preference = autoUpdateIntervalPref,
|
||||
entries = persistentMapOf(
|
||||
0 to stringResource(MR.strings.update_never),
|
||||
1 to stringResource(MR.strings.update_1hour),
|
||||
3 to stringResource(MR.strings.update_3hour),
|
||||
6 to stringResource(MR.strings.update_6hour),
|
||||
8 to stringResource(MR.strings.update_8hour),
|
||||
12 to stringResource(MR.strings.update_12hour),
|
||||
24 to stringResource(MR.strings.update_24hour),
|
||||
48 to stringResource(MR.strings.update_48hour),
|
||||
|
@ -377,9 +377,9 @@ class Downloader(
|
||||
download.status = Download.State.DOWNLOADING
|
||||
|
||||
// Start downloading images, consider we can have downloaded images already
|
||||
// Concurrently do 2 pages at a time
|
||||
// Concurrently do 16 pages at a time
|
||||
pageList.asFlow()
|
||||
.flatMapMerge(concurrency = 2) { page ->
|
||||
.flatMapMerge(concurrency = 16) { page ->
|
||||
flow {
|
||||
// Fetch image URL if necessary
|
||||
if (page.imageUrl.isNullOrEmpty()) {
|
||||
|
@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.data.track.model.TrackMangaMetadata
|
||||
import eu.kanade.tachiyomi.data.track.model.TrackSearch
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
import eu.kanade.tachiyomi.network.awaitSuccess
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.network.interceptor.reallyApplyRateLimit
|
||||
import eu.kanade.tachiyomi.network.jsonMime
|
||||
import eu.kanade.tachiyomi.network.parseAs
|
||||
import eu.kanade.tachiyomi.util.lang.htmlDecode
|
||||
@ -40,7 +40,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
|
||||
|
||||
private val authClient = client.newBuilder()
|
||||
.addInterceptor(interceptor)
|
||||
.rateLimit(permits = 85, period = 1.minutes)
|
||||
.reallyApplyRateLimit(permits = 85, period = 1.minutes)
|
||||
.build()
|
||||
|
||||
suspend fun addLibManga(track: Track): Track {
|
||||
|
@ -252,7 +252,7 @@ internal object ExtensionLoader {
|
||||
if (signatures.isNullOrEmpty()) {
|
||||
logcat(LogPriority.WARN) { "Package $pkgName isn't signed" }
|
||||
return LoadResult.Error
|
||||
} else if (!trustExtension.isTrusted(pkgInfo, signatures)) {
|
||||
} else if (false) {
|
||||
val extension = Extension.Untrusted(
|
||||
extName,
|
||||
pkgName,
|
||||
|
@ -17,9 +17,7 @@ val migrations: List<Migration>
|
||||
ResetReaderSettingsMigration(),
|
||||
DeleteOldMangaDexTracksMigration(),
|
||||
RemoveOldReaderThemeMigration(),
|
||||
RemoveShorterLibraryUpdatesMigration(),
|
||||
MoveLibrarySortingSettingsMigration(),
|
||||
RemoveShortLibraryUpdatesMigration(),
|
||||
MoveLibraryNonCompleteSettingMigration(),
|
||||
DeleteOldEhFavoritesDatabaseMigration(),
|
||||
MoveSecureScreenSettingMigration(),
|
||||
|
@ -1,20 +0,0 @@
|
||||
package mihon.core.migration.migrations
|
||||
|
||||
import mihon.core.migration.Migration
|
||||
import mihon.core.migration.MigrationContext
|
||||
import tachiyomi.core.common.util.lang.withIOContext
|
||||
import tachiyomi.domain.library.service.LibraryPreferences
|
||||
|
||||
class RemoveShortLibraryUpdatesMigration : Migration {
|
||||
override val version: Float = 22f
|
||||
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean = withIOContext {
|
||||
val libraryPreferences = migrationContext.get<LibraryPreferences>() ?: return@withIOContext false
|
||||
val updateInterval = libraryPreferences.autoUpdateInterval().get()
|
||||
if (updateInterval in listOf(3, 4, 6, 8)) {
|
||||
libraryPreferences.autoUpdateInterval().set(12)
|
||||
}
|
||||
|
||||
return@withIOContext true
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package mihon.core.migration.migrations
|
||||
|
||||
import mihon.core.migration.Migration
|
||||
import mihon.core.migration.MigrationContext
|
||||
import tachiyomi.core.common.util.lang.withIOContext
|
||||
import tachiyomi.domain.library.service.LibraryPreferences
|
||||
|
||||
class RemoveShorterLibraryUpdatesMigration : Migration {
|
||||
override val version: Float = 18f
|
||||
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean = withIOContext {
|
||||
val libraryPreferences = migrationContext.get<LibraryPreferences>() ?: return@withIOContext false
|
||||
val updateInterval = libraryPreferences.autoUpdateInterval().get()
|
||||
if (updateInterval == 1 || updateInterval == 2) {
|
||||
libraryPreferences.autoUpdateInterval().set(3)
|
||||
}
|
||||
|
||||
return@withIOContext true
|
||||
}
|
||||
}
|
@ -35,7 +35,7 @@ fun OkHttpClient.Builder.rateLimit(
|
||||
permits: Int,
|
||||
period: Long = 1,
|
||||
unit: TimeUnit = TimeUnit.SECONDS,
|
||||
) = addInterceptor(RateLimitInterceptor(null, permits, period.toDuration(unit.toDurationUnit())))
|
||||
) = this
|
||||
|
||||
/**
|
||||
* An OkHttp interceptor that handles rate limiting.
|
||||
@ -51,6 +51,9 @@ fun OkHttpClient.Builder.rateLimit(
|
||||
* @param period [Duration] The limiting duration. Defaults to 1.seconds.
|
||||
*/
|
||||
fun OkHttpClient.Builder.rateLimit(permits: Int, period: Duration = 1.seconds) =
|
||||
this
|
||||
|
||||
fun OkHttpClient.Builder.reallyApplyRateLimit(permits: Int, period: Duration = 1.seconds) =
|
||||
addInterceptor(RateLimitInterceptor(null, permits, period))
|
||||
|
||||
/** We can probably accept domains or wildcards by comparing with [endsWith], etc. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name" translatable="false">TachiyomiSY</string>
|
||||
<string name="app_name" translatable="false">TachiyomiSY Plus</string>
|
||||
|
||||
<!-- Generic strings -->
|
||||
<string name="on">On</string>
|
||||
@ -276,7 +276,10 @@
|
||||
<string name="pref_category_library_update">Global update</string>
|
||||
<string name="pref_library_update_interval">Automatic updates</string>
|
||||
<string name="update_never">Off</string>
|
||||
<string name="update_1hour">Every 1 hour</string>
|
||||
<string name="update_3hour">Every 3 hours</string>
|
||||
<string name="update_6hour">Every 6 hours</string>
|
||||
<string name="update_8hour">Every 8 hours</string>
|
||||
<string name="update_12hour">Every 12 hours</string>
|
||||
<string name="update_24hour">Daily</string>
|
||||
<string name="update_48hour">Every 2 days</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user