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
|
||||||
|
|
||||||
|
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:
|
Features of Mihon(original) include:
|
||||||
* Online reading from a variety of sources
|
* Online reading from a variety of sources
|
||||||
* Local reading of downloaded content
|
* 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(),
|
preference = backupPreferences.backupInterval(),
|
||||||
entries = persistentMapOf(
|
entries = persistentMapOf(
|
||||||
0 to stringResource(MR.strings.off),
|
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),
|
6 to stringResource(MR.strings.update_6hour),
|
||||||
|
8 to stringResource(MR.strings.update_8hour),
|
||||||
12 to stringResource(MR.strings.update_12hour),
|
12 to stringResource(MR.strings.update_12hour),
|
||||||
24 to stringResource(MR.strings.update_24hour),
|
24 to stringResource(MR.strings.update_24hour),
|
||||||
48 to stringResource(MR.strings.update_48hour),
|
48 to stringResource(MR.strings.update_48hour),
|
||||||
|
@ -157,6 +157,10 @@ object SettingsLibraryScreen : SearchableSettings {
|
|||||||
preference = autoUpdateIntervalPref,
|
preference = autoUpdateIntervalPref,
|
||||||
entries = persistentMapOf(
|
entries = persistentMapOf(
|
||||||
0 to stringResource(MR.strings.update_never),
|
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),
|
12 to stringResource(MR.strings.update_12hour),
|
||||||
24 to stringResource(MR.strings.update_24hour),
|
24 to stringResource(MR.strings.update_24hour),
|
||||||
48 to stringResource(MR.strings.update_48hour),
|
48 to stringResource(MR.strings.update_48hour),
|
||||||
|
@ -377,9 +377,9 @@ class Downloader(
|
|||||||
download.status = Download.State.DOWNLOADING
|
download.status = Download.State.DOWNLOADING
|
||||||
|
|
||||||
// Start downloading images, consider we can have downloaded images already
|
// 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()
|
pageList.asFlow()
|
||||||
.flatMapMerge(concurrency = 2) { page ->
|
.flatMapMerge(concurrency = 16) { page ->
|
||||||
flow {
|
flow {
|
||||||
// Fetch image URL if necessary
|
// Fetch image URL if necessary
|
||||||
if (page.imageUrl.isNullOrEmpty()) {
|
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.data.track.model.TrackSearch
|
||||||
import eu.kanade.tachiyomi.network.POST
|
import eu.kanade.tachiyomi.network.POST
|
||||||
import eu.kanade.tachiyomi.network.awaitSuccess
|
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.jsonMime
|
||||||
import eu.kanade.tachiyomi.network.parseAs
|
import eu.kanade.tachiyomi.network.parseAs
|
||||||
import eu.kanade.tachiyomi.util.lang.htmlDecode
|
import eu.kanade.tachiyomi.util.lang.htmlDecode
|
||||||
@ -40,7 +40,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
|
|||||||
|
|
||||||
private val authClient = client.newBuilder()
|
private val authClient = client.newBuilder()
|
||||||
.addInterceptor(interceptor)
|
.addInterceptor(interceptor)
|
||||||
.rateLimit(permits = 85, period = 1.minutes)
|
.reallyApplyRateLimit(permits = 85, period = 1.minutes)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
suspend fun addLibManga(track: Track): Track {
|
suspend fun addLibManga(track: Track): Track {
|
||||||
|
@ -252,7 +252,7 @@ internal object ExtensionLoader {
|
|||||||
if (signatures.isNullOrEmpty()) {
|
if (signatures.isNullOrEmpty()) {
|
||||||
logcat(LogPriority.WARN) { "Package $pkgName isn't signed" }
|
logcat(LogPriority.WARN) { "Package $pkgName isn't signed" }
|
||||||
return LoadResult.Error
|
return LoadResult.Error
|
||||||
} else if (!trustExtension.isTrusted(pkgInfo, signatures)) {
|
} else if (false) {
|
||||||
val extension = Extension.Untrusted(
|
val extension = Extension.Untrusted(
|
||||||
extName,
|
extName,
|
||||||
pkgName,
|
pkgName,
|
||||||
|
@ -17,9 +17,7 @@ val migrations: List<Migration>
|
|||||||
ResetReaderSettingsMigration(),
|
ResetReaderSettingsMigration(),
|
||||||
DeleteOldMangaDexTracksMigration(),
|
DeleteOldMangaDexTracksMigration(),
|
||||||
RemoveOldReaderThemeMigration(),
|
RemoveOldReaderThemeMigration(),
|
||||||
RemoveShorterLibraryUpdatesMigration(),
|
|
||||||
MoveLibrarySortingSettingsMigration(),
|
MoveLibrarySortingSettingsMigration(),
|
||||||
RemoveShortLibraryUpdatesMigration(),
|
|
||||||
MoveLibraryNonCompleteSettingMigration(),
|
MoveLibraryNonCompleteSettingMigration(),
|
||||||
DeleteOldEhFavoritesDatabaseMigration(),
|
DeleteOldEhFavoritesDatabaseMigration(),
|
||||||
MoveSecureScreenSettingMigration(),
|
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,
|
permits: Int,
|
||||||
period: Long = 1,
|
period: Long = 1,
|
||||||
unit: TimeUnit = TimeUnit.SECONDS,
|
unit: TimeUnit = TimeUnit.SECONDS,
|
||||||
) = addInterceptor(RateLimitInterceptor(null, permits, period.toDuration(unit.toDurationUnit())))
|
) = this
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An OkHttp interceptor that handles rate limiting.
|
* 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.
|
* @param period [Duration] The limiting duration. Defaults to 1.seconds.
|
||||||
*/
|
*/
|
||||||
fun OkHttpClient.Builder.rateLimit(permits: Int, period: Duration = 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))
|
addInterceptor(RateLimitInterceptor(null, permits, period))
|
||||||
|
|
||||||
/** We can probably accept domains or wildcards by comparing with [endsWith], etc. */
|
/** We can probably accept domains or wildcards by comparing with [endsWith], etc. */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name" translatable="false">TachiyomiSY</string>
|
<string name="app_name" translatable="false">TachiyomiSY Plus</string>
|
||||||
|
|
||||||
<!-- Generic strings -->
|
<!-- Generic strings -->
|
||||||
<string name="on">On</string>
|
<string name="on">On</string>
|
||||||
@ -276,7 +276,10 @@
|
|||||||
<string name="pref_category_library_update">Global update</string>
|
<string name="pref_category_library_update">Global update</string>
|
||||||
<string name="pref_library_update_interval">Automatic updates</string>
|
<string name="pref_library_update_interval">Automatic updates</string>
|
||||||
<string name="update_never">Off</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_6hour">Every 6 hours</string>
|
||||||
|
<string name="update_8hour">Every 8 hours</string>
|
||||||
<string name="update_12hour">Every 12 hours</string>
|
<string name="update_12hour">Every 12 hours</string>
|
||||||
<string name="update_24hour">Daily</string>
|
<string name="update_24hour">Daily</string>
|
||||||
<string name="update_48hour">Every 2 days</string>
|
<string name="update_48hour">Every 2 days</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user