Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
7135902100
|
|||
|
|
969947ef71 | ||
|
|
806e4eade6 | ||
|
|
063cfbe6b9 | ||
|
|
7cb94a3baa | ||
|
|
894c584c78 | ||
|
|
2f65e7776a | ||
|
|
76c56c9119 | ||
|
|
e0a803399c | ||
|
|
7803f42486 | ||
|
|
39713b3cf6 | ||
|
|
8ebf5cea62 | ||
|
|
663dabe218 | ||
|
|
3a5d0120bf | ||
|
|
a773f932d4 | ||
|
2a5812735f
|
|||
|
06ec145802
|
|||
|
6624778f7f
|
|||
|
1af1f071ad
|
|||
|
f87db4e6d3
|
|||
|
|
07bd66fb39 | ||
|
4bb0d52217
|
|||
| 66de4bd49e | |||
|
|
ff12d63696 | ||
|
|
c168a841f3 | ||
|
|
8bfb676e6a | ||
|
|
d5c0ce280e | ||
|
|
b34627c361 | ||
|
|
cbc3be056a | ||
|
d9acc4ec18
|
|||
|
577cc848ee
|
|||
|
8a64c88a07
|
|||
|
1cd7745e38
|
|||
|
395b3f7200
|
|||
|
b8db4c81d8
|
|||
|
98bd42f3ae
|
|||
|
db8835a7b8
|
|||
|
afe50a9ed6
|
|||
|
beba818f57
|
|||
|
beb17ef442
|
|||
|
24f1546019
|
|||
|
|
1b0fed5c56 | ||
|
3d32bd9d58
|
|||
|
590120433c
|
|||
|
4bd7656681
|
|||
|
2c7438e64d
|
|||
|
|
665bebaa7b | ||
|
|
6ed5994726 | ||
|
|
311ed865b7 | ||
|
|
b59fb678fe | ||
|
ed9ebdcc55
|
|||
|
74569615e3
|
@@ -16,11 +16,12 @@ android {
|
||||
applicationId 'org.koitharu.kotatsu'
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 588
|
||||
versionName = '6.2.1'
|
||||
versionCode = 595
|
||||
versionName = '6.2.7'
|
||||
generatedDensities = []
|
||||
testInstrumentationRunner "org.koitharu.kotatsu.HiltTestRunner"
|
||||
ksp {
|
||||
// arg("room.generateKotlin", "true") TODO: enable later
|
||||
arg("room.schemaLocation", "$projectDir/schemas")
|
||||
}
|
||||
androidResources {
|
||||
@@ -81,24 +82,24 @@ afterEvaluate {
|
||||
}
|
||||
dependencies {
|
||||
//noinspection GradleDependency
|
||||
implementation('com.github.KotatsuApp:kotatsu-parsers:0054d06e6e') {
|
||||
implementation('com.github.KotatsuApp:kotatsu-parsers:02463e5833') {
|
||||
exclude group: 'org.json', module: 'json'
|
||||
}
|
||||
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.10'
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.20'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.core:core-ktx:1.12.0'
|
||||
implementation 'androidx.activity:activity-ktx:1.8.0'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.6.1'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.6.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-service:2.6.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-process:2.6.2'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
||||
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta02'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha05'
|
||||
@@ -114,12 +115,12 @@ dependencies {
|
||||
exclude group: 'com.google.j2objc', module: 'j2objc-annotations'
|
||||
}
|
||||
|
||||
implementation 'androidx.room:room-runtime:2.5.2'
|
||||
implementation 'androidx.room:room-ktx:2.5.2'
|
||||
ksp 'androidx.room:room-compiler:2.5.2'
|
||||
implementation 'androidx.room:room-runtime:2.6.0'
|
||||
implementation 'androidx.room:room-ktx:2.6.0'
|
||||
ksp 'androidx.room:room-compiler:2.6.0'
|
||||
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:4.11.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:4.12.0'
|
||||
implementation 'com.squareup.okio:okio:3.6.0'
|
||||
|
||||
implementation 'com.hannesdorfmann:adapterdelegates4-kotlin-dsl:4.3.2'
|
||||
@@ -127,22 +128,22 @@ dependencies {
|
||||
|
||||
implementation 'com.google.dagger:hilt-android:2.48.1'
|
||||
kapt 'com.google.dagger:hilt-compiler:2.48.1'
|
||||
implementation 'androidx.hilt:hilt-work:1.0.0'
|
||||
kapt 'androidx.hilt:hilt-compiler:1.0.0'
|
||||
implementation 'androidx.hilt:hilt-work:1.1.0'
|
||||
kapt 'androidx.hilt:hilt-compiler:1.1.0'
|
||||
|
||||
implementation 'io.coil-kt:coil-base:2.4.0'
|
||||
implementation 'io.coil-kt:coil-svg:2.4.0'
|
||||
implementation 'io.coil-kt:coil-base:2.5.0'
|
||||
implementation 'io.coil-kt:coil-svg:2.5.0'
|
||||
implementation 'com.github.KotatsuApp:subsampling-scale-image-view:cf089a264d'
|
||||
implementation 'com.github.solkin:disk-lru-cache:1.4'
|
||||
implementation 'io.noties.markwon:core:4.6.2'
|
||||
|
||||
implementation 'ch.acra:acra-http:5.11.2'
|
||||
implementation 'ch.acra:acra-dialog:5.11.2'
|
||||
implementation 'ch.acra:acra-http:5.11.3'
|
||||
implementation 'ch.acra:acra-dialog:5.11.3'
|
||||
|
||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12'
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
testImplementation 'org.json:json:20230618'
|
||||
testImplementation 'org.json:json:20231013'
|
||||
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'
|
||||
|
||||
androidTestImplementation 'androidx.test:runner:1.5.2'
|
||||
@@ -152,7 +153,7 @@ dependencies {
|
||||
|
||||
androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'
|
||||
|
||||
androidTestImplementation 'androidx.room:room-testing:2.5.2'
|
||||
androidTestImplementation 'androidx.room:room-testing:2.6.0'
|
||||
androidTestImplementation 'com.squareup.moshi:moshi-kotlin:1.15.0'
|
||||
|
||||
androidTestImplementation 'com.google.dagger:hilt-android-testing:2.48.1'
|
||||
|
||||
1
app/proguard-rules.pro
vendored
1
app/proguard-rules.pro
vendored
@@ -18,3 +18,4 @@
|
||||
-keep class org.koitharu.kotatsu.core.exceptions.* { *; }
|
||||
-keep class org.koitharu.kotatsu.settings.NotificationSettingsLegacyFragment
|
||||
-keep class org.koitharu.kotatsu.core.prefs.ScreenshotsPolicy { *; }
|
||||
-keep class org.koitharu.kotatsu.settings.backup.PeriodicalBackupSettingsFragment { *; }
|
||||
|
||||
@@ -82,7 +82,7 @@ class AppBackupAgentTest {
|
||||
assertEquals(history, historyRepository.getOne(SampleData.manga))
|
||||
assertEquals(listOf(SampleData.manga), favouritesRepository.getManga(category.id))
|
||||
|
||||
val allTags = database.tagsDao.findTags(SampleData.tag.source.name).toMangaTags()
|
||||
val allTags = database.getTagsDao().findTags(SampleData.tag.source.name).toMangaTags()
|
||||
assertTrue(SampleData.tag in allTags)
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,16 @@
|
||||
<data android:host="kotatsu.app" />
|
||||
<data android:path="/manga" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="kotatsu" />
|
||||
<data android:host="manga" />
|
||||
<data android:host="kotatsu.app" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="org.koitharu.kotatsu.reader.ui.ReaderActivity"
|
||||
@@ -327,6 +337,13 @@
|
||||
<action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver
|
||||
android:name="org.koitharu.kotatsu.core.ErrorReporterReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="${applicationId}.action.REPORT_ERROR" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<meta-data
|
||||
android:name="android.webkit.WebView.EnableSafeBrowsing"
|
||||
|
||||
@@ -25,15 +25,15 @@ class BookmarksRepository @Inject constructor(
|
||||
) {
|
||||
|
||||
fun observeBookmark(manga: Manga, chapterId: Long, page: Int): Flow<Bookmark?> {
|
||||
return db.bookmarksDao.observe(manga.id, chapterId, page).map { it?.toBookmark(manga) }
|
||||
return db.getBookmarksDao().observe(manga.id, chapterId, page).map { it?.toBookmark(manga) }
|
||||
}
|
||||
|
||||
fun observeBookmarks(manga: Manga): Flow<List<Bookmark>> {
|
||||
return db.bookmarksDao.observe(manga.id).mapItems { it.toBookmark(manga) }
|
||||
return db.getBookmarksDao().observe(manga.id).mapItems { it.toBookmark(manga) }
|
||||
}
|
||||
|
||||
fun observeBookmarks(): Flow<Map<Manga, List<Bookmark>>> {
|
||||
return db.bookmarksDao.observe().map { map ->
|
||||
return db.getBookmarksDao().observe().map { map ->
|
||||
val res = LinkedHashMap<Manga, List<Bookmark>>(map.size)
|
||||
for ((k, v) in map) {
|
||||
val manga = k.toManga()
|
||||
@@ -46,9 +46,9 @@ class BookmarksRepository @Inject constructor(
|
||||
suspend fun addBookmark(bookmark: Bookmark) {
|
||||
db.withTransaction {
|
||||
val tags = bookmark.manga.tags.toEntities()
|
||||
db.tagsDao.upsert(tags)
|
||||
db.mangaDao.upsert(bookmark.manga.toEntity(), tags)
|
||||
db.bookmarksDao.insert(bookmark.toEntity())
|
||||
db.getTagsDao().upsert(tags)
|
||||
db.getMangaDao().upsert(bookmark.manga.toEntity(), tags)
|
||||
db.getBookmarksDao().insert(bookmark.toEntity())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,11 +56,11 @@ class BookmarksRepository @Inject constructor(
|
||||
val entity = bookmark.toEntity().copy(
|
||||
imageUrl = imageUrl,
|
||||
)
|
||||
db.bookmarksDao.upsert(listOf(entity))
|
||||
db.getBookmarksDao().upsert(listOf(entity))
|
||||
}
|
||||
|
||||
suspend fun removeBookmark(mangaId: Long, chapterId: Long, page: Int) {
|
||||
check(db.bookmarksDao.delete(mangaId, chapterId, page) != 0) {
|
||||
check(db.getBookmarksDao().delete(mangaId, chapterId, page) != 0) {
|
||||
"Bookmark not found"
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class BookmarksRepository @Inject constructor(
|
||||
suspend fun removeBookmarks(ids: Set<Long>): ReversibleHandle {
|
||||
val entities = ArrayList<BookmarkEntity>(ids.size)
|
||||
db.withTransaction {
|
||||
val dao = db.bookmarksDao
|
||||
val dao = db.getBookmarksDao()
|
||||
for (pageId in ids) {
|
||||
val e = dao.find(pageId)
|
||||
if (e != null) {
|
||||
@@ -92,7 +92,7 @@ class BookmarksRepository @Inject constructor(
|
||||
db.withTransaction {
|
||||
for (e in entities) {
|
||||
try {
|
||||
db.bookmarksDao.insert(e)
|
||||
db.getBookmarksDao().insert(e)
|
||||
} catch (e: SQLException) {
|
||||
e.printStackTraceDebug()
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ class BookmarksActivity :
|
||||
val fm = supportFragmentManager
|
||||
if (fm.findFragmentById(R.id.container) == null) {
|
||||
fm.commit {
|
||||
val fragment = BookmarksFragment.newInstance()
|
||||
replace(R.id.container, fragment)
|
||||
setReorderingAllowed(true)
|
||||
replace(R.id.container, BookmarksFragment::class.java, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ class CloudFlareActivity : BaseActivity<ActivityBrowserBinding>(), CloudFlareCal
|
||||
if (!catchingWebViewUnavailability {
|
||||
setContentView(
|
||||
ActivityBrowserBinding.inflate(
|
||||
layoutInflater
|
||||
)
|
||||
layoutInflater,
|
||||
),
|
||||
)
|
||||
}) {
|
||||
return
|
||||
@@ -82,9 +82,11 @@ class CloudFlareActivity : BaseActivity<ActivityBrowserBinding>(), CloudFlareCal
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
viewBinding.webView.run {
|
||||
stopLoading()
|
||||
destroy()
|
||||
runCatching {
|
||||
viewBinding.webView
|
||||
}.onSuccess {
|
||||
it.stopLoading()
|
||||
it.destroy()
|
||||
}
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.koitharu.kotatsu.core
|
||||
|
||||
import android.app.PendingIntent
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.core.app.PendingIntentCompat
|
||||
import org.koitharu.kotatsu.BuildConfig
|
||||
import org.koitharu.kotatsu.core.util.ext.getSerializableExtraCompat
|
||||
import org.koitharu.kotatsu.core.util.ext.report
|
||||
|
||||
class ErrorReporterReceiver : BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
val e = intent?.getSerializableExtraCompat<Throwable>(EXTRA_ERROR) ?: return
|
||||
e.report()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
private const val EXTRA_ERROR = "err"
|
||||
private const val ACTION_REPORT = "${BuildConfig.APPLICATION_ID}.action.REPORT_ERROR"
|
||||
|
||||
fun getPendingIntent(context: Context, e: Throwable): PendingIntent {
|
||||
val intent = Intent(context, ErrorReporterReceiver::class.java)
|
||||
intent.setAction(ACTION_REPORT)
|
||||
intent.setData(Uri.parse("err://${e.hashCode()}"))
|
||||
intent.putExtra(EXTRA_ERROR, e)
|
||||
return checkNotNull(PendingIntentCompat.getBroadcast(context, 0, intent, 0, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ class BackupRepository @Inject constructor(
|
||||
var offset = 0
|
||||
val entry = BackupEntry(BackupEntry.HISTORY, JSONArray())
|
||||
while (true) {
|
||||
val history = db.historyDao.findAll(offset, PAGE_SIZE)
|
||||
val history = db.getHistoryDao().findAll(offset, PAGE_SIZE)
|
||||
if (history.isEmpty()) {
|
||||
break
|
||||
}
|
||||
@@ -42,7 +42,7 @@ class BackupRepository @Inject constructor(
|
||||
|
||||
suspend fun dumpCategories(): BackupEntry {
|
||||
val entry = BackupEntry(BackupEntry.CATEGORIES, JSONArray())
|
||||
val categories = db.favouriteCategoriesDao.findAll()
|
||||
val categories = db.getFavouriteCategoriesDao().findAll()
|
||||
for (item in categories) {
|
||||
entry.data.put(JsonSerializer(item).toJson())
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class BackupRepository @Inject constructor(
|
||||
var offset = 0
|
||||
val entry = BackupEntry(BackupEntry.FAVOURITES, JSONArray())
|
||||
while (true) {
|
||||
val favourites = db.favouritesDao.findAll(offset, PAGE_SIZE)
|
||||
val favourites = db.getFavouritesDao().findAll(offset, PAGE_SIZE)
|
||||
if (favourites.isEmpty()) {
|
||||
break
|
||||
}
|
||||
@@ -73,7 +73,7 @@ class BackupRepository @Inject constructor(
|
||||
|
||||
suspend fun dumpBookmarks(): BackupEntry {
|
||||
val entry = BackupEntry(BackupEntry.BOOKMARKS, JSONArray())
|
||||
val all = db.bookmarksDao.findAll()
|
||||
val all = db.getBookmarksDao().findAll()
|
||||
for ((m, b) in all) {
|
||||
val json = JSONObject()
|
||||
val manga = JsonSerializer(m.manga).toJson()
|
||||
@@ -122,9 +122,9 @@ class BackupRepository @Inject constructor(
|
||||
val history = JsonDeserializer(item).toHistoryEntity()
|
||||
result += runCatchingCancellable {
|
||||
db.withTransaction {
|
||||
db.tagsDao.upsert(tags)
|
||||
db.mangaDao.upsert(manga, tags)
|
||||
db.historyDao.upsert(history)
|
||||
db.getTagsDao().upsert(tags)
|
||||
db.getMangaDao().upsert(manga, tags)
|
||||
db.getHistoryDao().upsert(history)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class BackupRepository @Inject constructor(
|
||||
for (item in entry.data.JSONIterator()) {
|
||||
val category = JsonDeserializer(item).toFavouriteCategoryEntity()
|
||||
result += runCatchingCancellable {
|
||||
db.favouriteCategoriesDao.upsert(category)
|
||||
db.getFavouriteCategoriesDao().upsert(category)
|
||||
}
|
||||
}
|
||||
return result
|
||||
@@ -153,9 +153,9 @@ class BackupRepository @Inject constructor(
|
||||
val favourite = JsonDeserializer(item).toFavouriteEntity()
|
||||
result += runCatchingCancellable {
|
||||
db.withTransaction {
|
||||
db.tagsDao.upsert(tags)
|
||||
db.mangaDao.upsert(manga, tags)
|
||||
db.favouritesDao.upsert(favourite)
|
||||
db.getTagsDao().upsert(tags)
|
||||
db.getMangaDao().upsert(manga, tags)
|
||||
db.getFavouritesDao().upsert(favourite)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,9 +175,9 @@ class BackupRepository @Inject constructor(
|
||||
}
|
||||
result += runCatchingCancellable {
|
||||
db.withTransaction {
|
||||
db.tagsDao.upsert(tags)
|
||||
db.mangaDao.upsert(manga, tags)
|
||||
db.bookmarksDao.upsert(bookmarks)
|
||||
db.getTagsDao().upsert(tags)
|
||||
db.getMangaDao().upsert(manga, tags)
|
||||
db.getBookmarksDao().upsert(bookmarks)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class BackupZipOutput(val file: File) : Closeable {
|
||||
}
|
||||
}
|
||||
|
||||
private const val DIR_BACKUPS = "backups"
|
||||
const val DIR_BACKUPS = "backups"
|
||||
|
||||
suspend fun BackupZipOutput(context: Context): BackupZipOutput = runInterruptible(Dispatchers.IO) {
|
||||
val dir = context.run {
|
||||
|
||||
@@ -66,29 +66,29 @@ const val DATABASE_VERSION = 17
|
||||
)
|
||||
abstract class MangaDatabase : RoomDatabase() {
|
||||
|
||||
abstract val historyDao: HistoryDao
|
||||
abstract fun getHistoryDao(): HistoryDao
|
||||
|
||||
abstract val tagsDao: TagsDao
|
||||
abstract fun getTagsDao(): TagsDao
|
||||
|
||||
abstract val mangaDao: MangaDao
|
||||
abstract fun getMangaDao(): MangaDao
|
||||
|
||||
abstract val favouritesDao: FavouritesDao
|
||||
abstract fun getFavouritesDao(): FavouritesDao
|
||||
|
||||
abstract val preferencesDao: PreferencesDao
|
||||
abstract fun getPreferencesDao(): PreferencesDao
|
||||
|
||||
abstract val favouriteCategoriesDao: FavouriteCategoriesDao
|
||||
abstract fun getFavouriteCategoriesDao(): FavouriteCategoriesDao
|
||||
|
||||
abstract val tracksDao: TracksDao
|
||||
abstract fun getTracksDao(): TracksDao
|
||||
|
||||
abstract val trackLogsDao: TrackLogsDao
|
||||
abstract fun getTrackLogsDao(): TrackLogsDao
|
||||
|
||||
abstract val suggestionDao: SuggestionDao
|
||||
abstract fun getSuggestionDao(): SuggestionDao
|
||||
|
||||
abstract val bookmarksDao: BookmarksDao
|
||||
abstract fun getBookmarksDao(): BookmarksDao
|
||||
|
||||
abstract val scrobblingDao: ScrobblingDao
|
||||
abstract fun getScrobblingDao(): ScrobblingDao
|
||||
|
||||
abstract val sourcesDao: MangaSourcesDao
|
||||
abstract fun getSourcesDao(): MangaSourcesDao
|
||||
}
|
||||
|
||||
fun getDatabaseMigrations(context: Context): Array<Migration> = arrayOf(
|
||||
|
||||
@@ -5,8 +5,8 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration10To11 : Migration(10, 11) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL(
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS `bookmarks` (
|
||||
`manga_id` INTEGER NOT NULL,
|
||||
@@ -20,7 +20,7 @@ class Migration10To11 : Migration(10, 11) {
|
||||
FOREIGN KEY(`manga_id`) REFERENCES `manga`(`manga_id`) ON UPDATE NO ACTION ON DELETE CASCADE )
|
||||
""".trimIndent()
|
||||
)
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS `index_bookmarks_manga_id` ON `bookmarks` (`manga_id`)")
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS `index_bookmarks_page_id` ON `bookmarks` (`page_id`)")
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS `index_bookmarks_manga_id` ON `bookmarks` (`manga_id`)")
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS `index_bookmarks_page_id` ON `bookmarks` (`page_id`)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration11To12 : Migration(11, 12) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL(
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS `scrobblings` (
|
||||
`scrobbler` INTEGER NOT NULL,
|
||||
@@ -21,7 +21,7 @@ class Migration11To12 : Migration(11, 12) {
|
||||
)
|
||||
""".trimIndent()
|
||||
)
|
||||
database.execSQL("ALTER TABLE history ADD COLUMN `percent` REAL NOT NULL DEFAULT -1")
|
||||
database.execSQL("ALTER TABLE bookmarks ADD COLUMN `percent` REAL NOT NULL DEFAULT -1")
|
||||
db.execSQL("ALTER TABLE history ADD COLUMN `percent` REAL NOT NULL DEFAULT -1")
|
||||
db.execSQL("ALTER TABLE bookmarks ADD COLUMN `percent` REAL NOT NULL DEFAULT -1")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration12To13 : Migration(12, 13) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE favourite_categories ADD COLUMN `show_in_lib` INTEGER NOT NULL DEFAULT 1")
|
||||
database.execSQL("ALTER TABLE favourites ADD COLUMN `sort_key` INTEGER NOT NULL DEFAULT 0")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("ALTER TABLE favourite_categories ADD COLUMN `show_in_lib` INTEGER NOT NULL DEFAULT 1")
|
||||
db.execSQL("ALTER TABLE favourites ADD COLUMN `sort_key` INTEGER NOT NULL DEFAULT 0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration13To14 : Migration(13, 14) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE favourite_categories ADD COLUMN `deleted_at` INTEGER NOT NULL DEFAULT 0")
|
||||
database.execSQL("ALTER TABLE favourites ADD COLUMN `deleted_at` INTEGER NOT NULL DEFAULT 0")
|
||||
database.execSQL("ALTER TABLE history ADD COLUMN `deleted_at` INTEGER NOT NULL DEFAULT 0")
|
||||
database.execSQL("ALTER TABLE preferences ADD COLUMN `cf_brightness` REAL NOT NULL DEFAULT 0")
|
||||
database.execSQL("ALTER TABLE preferences ADD COLUMN `cf_contrast` REAL NOT NULL DEFAULT 0")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("ALTER TABLE favourite_categories ADD COLUMN `deleted_at` INTEGER NOT NULL DEFAULT 0")
|
||||
db.execSQL("ALTER TABLE favourites ADD COLUMN `deleted_at` INTEGER NOT NULL DEFAULT 0")
|
||||
db.execSQL("ALTER TABLE history ADD COLUMN `deleted_at` INTEGER NOT NULL DEFAULT 0")
|
||||
db.execSQL("ALTER TABLE preferences ADD COLUMN `cf_brightness` REAL NOT NULL DEFAULT 0")
|
||||
db.execSQL("ALTER TABLE preferences ADD COLUMN `cf_contrast` REAL NOT NULL DEFAULT 0")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration14To15 : Migration(14, 15) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) = Unit
|
||||
override fun migrate(db: SupportSQLiteDatabase) = Unit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration15To16 : Migration(15, 16) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE preferences ADD COLUMN `cf_invert` INTEGER NOT NULL DEFAULT 0")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("ALTER TABLE preferences ADD COLUMN `cf_invert` INTEGER NOT NULL DEFAULT 0")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ class Migration16To17(context: Context) : Migration(16, 17) {
|
||||
|
||||
private val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("CREATE TABLE `sources` (`source` TEXT NOT NULL, `enabled` INTEGER NOT NULL, `sort_key` INTEGER NOT NULL, PRIMARY KEY(`source`))")
|
||||
database.execSQL("CREATE INDEX `index_sources_sort_key` ON `sources` (`sort_key`)")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("CREATE TABLE `sources` (`source` TEXT NOT NULL, `enabled` INTEGER NOT NULL, `sort_key` INTEGER NOT NULL, PRIMARY KEY(`source`))")
|
||||
db.execSQL("CREATE INDEX `index_sources_sort_key` ON `sources` (`sort_key`)")
|
||||
val hiddenSources = prefs.getStringSet("sources_hidden", null).orEmpty()
|
||||
val order = prefs.getString("sources_order_2", null)?.split('|').orEmpty()
|
||||
val sources = MangaSource.entries
|
||||
@@ -30,7 +30,7 @@ class Migration16To17(context: Context) : Migration(16, 17) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
database.execSQL(
|
||||
db.execSQL(
|
||||
"INSERT INTO `sources` (`source`, `enabled`, `sort_key`) VALUES (?, ?, ?)",
|
||||
arrayOf(name, (!isHidden).toInt(), sortKey),
|
||||
)
|
||||
|
||||
@@ -7,48 +7,48 @@ class Migration1To2 : Migration(1, 2) {
|
||||
/**
|
||||
* Adding foreign keys
|
||||
*/
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
/* manga_tags */
|
||||
database.execSQL(
|
||||
db.execSQL(
|
||||
"CREATE TABLE IF NOT EXISTS manga_tags_tmp (manga_id INTEGER NOT NULL, tag_id INTEGER NOT NULL, " +
|
||||
"PRIMARY KEY(manga_id, tag_id), " +
|
||||
"FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE, " +
|
||||
"FOREIGN KEY(tag_id) REFERENCES tags(tag_id) ON UPDATE NO ACTION ON DELETE CASCADE )"
|
||||
)
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_manga_tags_manga_id ON manga_tags_tmp (manga_id)")
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_manga_tags_tag_id ON manga_tags_tmp (tag_id)")
|
||||
database.execSQL("INSERT INTO manga_tags_tmp (manga_id, tag_id) SELECT manga_id, tag_id FROM manga_tags")
|
||||
database.execSQL("DROP TABLE manga_tags")
|
||||
database.execSQL("ALTER TABLE manga_tags_tmp RENAME TO manga_tags")
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS index_manga_tags_manga_id ON manga_tags_tmp (manga_id)")
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS index_manga_tags_tag_id ON manga_tags_tmp (tag_id)")
|
||||
db.execSQL("INSERT INTO manga_tags_tmp (manga_id, tag_id) SELECT manga_id, tag_id FROM manga_tags")
|
||||
db.execSQL("DROP TABLE manga_tags")
|
||||
db.execSQL("ALTER TABLE manga_tags_tmp RENAME TO manga_tags")
|
||||
/* favourites */
|
||||
database.execSQL(
|
||||
db.execSQL(
|
||||
"CREATE TABLE IF NOT EXISTS favourites_tmp (manga_id INTEGER NOT NULL, category_id INTEGER NOT NULL, created_at INTEGER NOT NULL, " +
|
||||
"PRIMARY KEY(manga_id, category_id), " +
|
||||
"FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE , " +
|
||||
"FOREIGN KEY(category_id) REFERENCES favourite_categories(category_id) ON UPDATE NO ACTION ON DELETE CASCADE )"
|
||||
)
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_favourites_manga_id ON favourites_tmp (manga_id)")
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_favourites_category_id ON favourites_tmp (category_id)")
|
||||
database.execSQL("INSERT INTO favourites_tmp (manga_id, category_id, created_at) SELECT manga_id, category_id, created_at FROM favourites")
|
||||
database.execSQL("DROP TABLE favourites")
|
||||
database.execSQL("ALTER TABLE favourites_tmp RENAME TO favourites")
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS index_favourites_manga_id ON favourites_tmp (manga_id)")
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS index_favourites_category_id ON favourites_tmp (category_id)")
|
||||
db.execSQL("INSERT INTO favourites_tmp (manga_id, category_id, created_at) SELECT manga_id, category_id, created_at FROM favourites")
|
||||
db.execSQL("DROP TABLE favourites")
|
||||
db.execSQL("ALTER TABLE favourites_tmp RENAME TO favourites")
|
||||
/* history */
|
||||
database.execSQL(
|
||||
db.execSQL(
|
||||
"CREATE TABLE IF NOT EXISTS history_tmp (manga_id INTEGER NOT NULL, created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL, chapter_id INTEGER NOT NULL, page INTEGER NOT NULL, " +
|
||||
"PRIMARY KEY(manga_id), " +
|
||||
"FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE )"
|
||||
)
|
||||
database.execSQL("INSERT INTO history_tmp (manga_id, created_at, updated_at, chapter_id, page) SELECT manga_id, created_at, updated_at, chapter_id, page FROM history")
|
||||
database.execSQL("DROP TABLE history")
|
||||
database.execSQL("ALTER TABLE history_tmp RENAME TO history")
|
||||
db.execSQL("INSERT INTO history_tmp (manga_id, created_at, updated_at, chapter_id, page) SELECT manga_id, created_at, updated_at, chapter_id, page FROM history")
|
||||
db.execSQL("DROP TABLE history")
|
||||
db.execSQL("ALTER TABLE history_tmp RENAME TO history")
|
||||
/* preferences */
|
||||
database.execSQL(
|
||||
db.execSQL(
|
||||
"CREATE TABLE IF NOT EXISTS preferences_tmp (manga_id INTEGER NOT NULL, mode INTEGER NOT NULL," +
|
||||
" PRIMARY KEY(manga_id), " +
|
||||
"FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE )"
|
||||
)
|
||||
database.execSQL("INSERT INTO preferences_tmp (manga_id, mode) SELECT manga_id, mode FROM preferences")
|
||||
database.execSQL("DROP TABLE preferences")
|
||||
database.execSQL("ALTER TABLE preferences_tmp RENAME TO preferences")
|
||||
db.execSQL("INSERT INTO preferences_tmp (manga_id, mode) SELECT manga_id, mode FROM preferences")
|
||||
db.execSQL("DROP TABLE preferences")
|
||||
db.execSQL("ALTER TABLE preferences_tmp RENAME TO preferences")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration2To3 : Migration(2, 3) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE history ADD COLUMN scroll REAL NOT NULL DEFAULT 0")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("ALTER TABLE history ADD COLUMN scroll REAL NOT NULL DEFAULT 0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration3To4 : Migration(3, 4) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS tracks (manga_id INTEGER NOT NULL, chapters_total INTEGER NOT NULL, last_chapter_id INTEGER NOT NULL, chapters_new INTEGER NOT NULL, last_check INTEGER NOT NULL, last_notified_id INTEGER NOT NULL, PRIMARY KEY(manga_id), FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE )")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("CREATE TABLE IF NOT EXISTS tracks (manga_id INTEGER NOT NULL, chapters_total INTEGER NOT NULL, last_chapter_id INTEGER NOT NULL, chapters_new INTEGER NOT NULL, last_check INTEGER NOT NULL, last_notified_id INTEGER NOT NULL, PRIMARY KEY(manga_id), FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE )")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration4To5 : Migration(4, 5) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE favourite_categories ADD COLUMN sort_key INTEGER NOT NULL DEFAULT 0")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("ALTER TABLE favourite_categories ADD COLUMN sort_key INTEGER NOT NULL DEFAULT 0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration5To6 : Migration(5, 6) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS track_logs (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, manga_id INTEGER NOT NULL, chapters TEXT NOT NULL, created_at INTEGER NOT NULL, FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE)")
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_track_logs_manga_id ON track_logs (manga_id)")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("CREATE TABLE IF NOT EXISTS track_logs (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, manga_id INTEGER NOT NULL, chapters TEXT NOT NULL, created_at INTEGER NOT NULL, FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE)")
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS index_track_logs_manga_id ON track_logs (manga_id)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration6To7 : Migration(6, 7) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE manga ADD COLUMN public_url TEXT NOT NULL DEFAULT ''")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("ALTER TABLE manga ADD COLUMN public_url TEXT NOT NULL DEFAULT ''")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration7To8 : Migration(7, 8) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE manga ADD COLUMN nsfw INTEGER NOT NULL DEFAULT 0")
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS suggestions (manga_id INTEGER NOT NULL, relevance REAL NOT NULL, created_at INTEGER NOT NULL, PRIMARY KEY(manga_id), FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE )")
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_suggestions_manga_id ON suggestions (manga_id)")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("ALTER TABLE manga ADD COLUMN nsfw INTEGER NOT NULL DEFAULT 0")
|
||||
db.execSQL("CREATE TABLE IF NOT EXISTS suggestions (manga_id INTEGER NOT NULL, relevance REAL NOT NULL, created_at INTEGER NOT NULL, PRIMARY KEY(manga_id), FOREIGN KEY(manga_id) REFERENCES manga(manga_id) ON UPDATE NO ACTION ON DELETE CASCADE )")
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS index_suggestions_manga_id ON suggestions (manga_id)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
|
||||
class Migration8To9 : Migration(8, 9) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE favourite_categories ADD COLUMN `order` TEXT NOT NULL DEFAULT ${SortOrder.NEWEST.name}")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("ALTER TABLE favourite_categories ADD COLUMN `order` TEXT NOT NULL DEFAULT ${SortOrder.NEWEST.name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
class Migration9To10 : Migration(9, 10) {
|
||||
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE favourite_categories ADD COLUMN `track` INTEGER NOT NULL DEFAULT 1")
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL("ALTER TABLE favourite_categories ADD COLUMN `track` INTEGER NOT NULL DEFAULT 1")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,16 +28,16 @@ class MangaDataRepository @Inject constructor(
|
||||
suspend fun saveReaderMode(manga: Manga, mode: ReaderMode) {
|
||||
db.withTransaction {
|
||||
storeManga(manga)
|
||||
val entity = db.preferencesDao.find(manga.id) ?: newEntity(manga.id)
|
||||
db.preferencesDao.upsert(entity.copy(mode = mode.id))
|
||||
val entity = db.getPreferencesDao().find(manga.id) ?: newEntity(manga.id)
|
||||
db.getPreferencesDao().upsert(entity.copy(mode = mode.id))
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun saveColorFilter(manga: Manga, colorFilter: ReaderColorFilter?) {
|
||||
db.withTransaction {
|
||||
storeManga(manga)
|
||||
val entity = db.preferencesDao.find(manga.id) ?: newEntity(manga.id)
|
||||
db.preferencesDao.upsert(
|
||||
val entity = db.getPreferencesDao().find(manga.id) ?: newEntity(manga.id)
|
||||
db.getPreferencesDao().upsert(
|
||||
entity.copy(
|
||||
cfBrightness = colorFilter?.brightness ?: 0f,
|
||||
cfContrast = colorFilter?.contrast ?: 0f,
|
||||
@@ -48,25 +48,25 @@ class MangaDataRepository @Inject constructor(
|
||||
}
|
||||
|
||||
suspend fun getReaderMode(mangaId: Long): ReaderMode? {
|
||||
return db.preferencesDao.find(mangaId)?.let { ReaderMode.valueOf(it.mode) }
|
||||
return db.getPreferencesDao().find(mangaId)?.let { ReaderMode.valueOf(it.mode) }
|
||||
}
|
||||
|
||||
suspend fun getColorFilter(mangaId: Long): ReaderColorFilter? {
|
||||
return db.preferencesDao.find(mangaId)?.getColorFilterOrNull()
|
||||
return db.getPreferencesDao().find(mangaId)?.getColorFilterOrNull()
|
||||
}
|
||||
|
||||
fun observeColorFilter(mangaId: Long): Flow<ReaderColorFilter?> {
|
||||
return db.preferencesDao.observe(mangaId)
|
||||
return db.getPreferencesDao().observe(mangaId)
|
||||
.map { it?.getColorFilterOrNull() }
|
||||
.distinctUntilChanged()
|
||||
}
|
||||
|
||||
suspend fun findMangaById(mangaId: Long): Manga? {
|
||||
return db.mangaDao.find(mangaId)?.toManga()
|
||||
return db.getMangaDao().find(mangaId)?.toManga()
|
||||
}
|
||||
|
||||
suspend fun findMangaByPublicUrl(publicUrl: String): Manga? {
|
||||
return db.mangaDao.findByPublicUrl(publicUrl)?.toManga()
|
||||
return db.getMangaDao().findByPublicUrl(publicUrl)?.toManga()
|
||||
}
|
||||
|
||||
suspend fun resolveIntent(intent: MangaIntent): Manga? = when {
|
||||
@@ -79,13 +79,13 @@ class MangaDataRepository @Inject constructor(
|
||||
suspend fun storeManga(manga: Manga) {
|
||||
val tags = manga.tags.toEntities()
|
||||
db.withTransaction {
|
||||
db.tagsDao.upsert(tags)
|
||||
db.mangaDao.upsert(manga.toEntity(), tags)
|
||||
db.getTagsDao().upsert(tags)
|
||||
db.getMangaDao().upsert(manga.toEntity(), tags)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun findTags(source: MangaSource): Set<MangaTag> {
|
||||
return db.tagsDao.findTags(source.name).toMangaTags()
|
||||
return db.getTagsDao().findTags(source.name).toMangaTags()
|
||||
}
|
||||
|
||||
private fun MangaPrefsEntity.getColorFilterOrNull(): ReaderColorFilter? {
|
||||
|
||||
@@ -23,14 +23,14 @@ class MangaLinkResolver @Inject constructor(
|
||||
) {
|
||||
|
||||
suspend fun resolve(uri: Uri): Manga {
|
||||
return if (uri.host == "kotatsu.app") {
|
||||
return if (uri.scheme == "kotatsu" || uri.host == "kotatsu.app") {
|
||||
resolveAppLink(uri)
|
||||
} else {
|
||||
resolveExternalLink(uri)
|
||||
} ?: throw NotFoundException("Manga not found", uri.toString())
|
||||
} ?: throw NotFoundException("Cannot resolve link", uri.toString())
|
||||
}
|
||||
|
||||
suspend fun resolveAppLink(uri: Uri): Manga? {
|
||||
private suspend fun resolveAppLink(uri: Uri): Manga? {
|
||||
require(uri.pathSegments.singleOrNull() == "manga") { "Invalid url" }
|
||||
val sourceName = requireNotNull(uri.getQueryParameter("source")) { "Source is not specified" }
|
||||
val source = MangaSource(sourceName)
|
||||
@@ -42,7 +42,7 @@ class MangaLinkResolver @Inject constructor(
|
||||
)
|
||||
}
|
||||
|
||||
suspend fun resolveExternalLink(uri: Uri): Manga? {
|
||||
private suspend fun resolveExternalLink(uri: Uri): Manga? {
|
||||
dataRepository.findMangaByPublicUrl(uri.toString())?.let {
|
||||
return it
|
||||
}
|
||||
|
||||
@@ -354,6 +354,16 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
|
||||
val is32BitColorsEnabled: Boolean
|
||||
get() = prefs.getBoolean(KEY_32BIT_COLOR, false)
|
||||
|
||||
val isPeriodicalBackupEnabled: Boolean
|
||||
get() = prefs.getBoolean(KEY_BACKUP_PERIODICAL_ENABLED, false)
|
||||
|
||||
val periodicalBackupFrequency: Long
|
||||
get() = prefs.getString(KEY_BACKUP_PERIODICAL_FREQUENCY, null)?.toLongOrNull() ?: 7L
|
||||
|
||||
var periodicalBackupOutput: Uri?
|
||||
get() = prefs.getString(KEY_BACKUP_PERIODICAL_OUTPUT, null)?.toUriOrNull()
|
||||
set(value) = prefs.edit { putString(KEY_BACKUP_PERIODICAL_OUTPUT, value?.toString()) }
|
||||
|
||||
fun isTipEnabled(tip: String): Boolean {
|
||||
return prefs.getStringSet(KEY_TIPS_CLOSED, emptySet())?.contains(tip) != true
|
||||
}
|
||||
@@ -458,6 +468,10 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
|
||||
const val KEY_ZOOM_MODE = "zoom_mode"
|
||||
const val KEY_BACKUP = "backup"
|
||||
const val KEY_RESTORE = "restore"
|
||||
const val KEY_BACKUP_PERIODICAL_ENABLED = "backup_periodic"
|
||||
const val KEY_BACKUP_PERIODICAL_FREQUENCY = "backup_periodic_freq"
|
||||
const val KEY_BACKUP_PERIODICAL_OUTPUT = "backup_periodic_output"
|
||||
const val KEY_BACKUP_PERIODICAL_LAST = "backup_periodic_last"
|
||||
const val KEY_HISTORY_GROUPING = "history_grouping"
|
||||
const val KEY_READING_INDICATORS = "reading_indicators"
|
||||
const val KEY_REVERSE_CHAPTERS = "reverse_chapters"
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.KeyEvent
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.CallSuper
|
||||
@@ -96,10 +95,10 @@ abstract class BaseActivity<B : ViewBinding> :
|
||||
insetsDelegate.onViewCreated(binding.root)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem) = if (item.itemId == android.R.id.home) {
|
||||
onBackPressed()
|
||||
true
|
||||
} else super.onOptionsItemSelected(item)
|
||||
override fun onSupportNavigateUp(): Boolean {
|
||||
dispatchNavigateUp()
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
|
||||
if (BuildConfig.DEBUG && keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
|
||||
@@ -150,6 +149,17 @@ abstract class BaseActivity<B : ViewBinding> :
|
||||
window.statusBarColor = defaultStatusBarColor
|
||||
}
|
||||
|
||||
protected open fun dispatchNavigateUp() {
|
||||
val upIntent = parentActivityIntent
|
||||
if (upIntent != null) {
|
||||
if (!navigateUpTo(upIntent)) {
|
||||
startActivity(upIntent)
|
||||
}
|
||||
} else {
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
private fun putDataToExtras(intent: Intent?) {
|
||||
intent?.putExtra(EXTRA_DATA, intent.data)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.koitharu.kotatsu.core.ui.list
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver
|
||||
|
||||
class RecyclerScrollKeeper(
|
||||
private val rv: RecyclerView,
|
||||
) : AdapterDataObserver() {
|
||||
|
||||
private val scrollUpRunnable = Runnable {
|
||||
(rv.layoutManager as? LinearLayoutManager)?.scrollToPositionWithOffset(0, 0)
|
||||
}
|
||||
|
||||
fun attach() {
|
||||
rv.adapter?.registerAdapterDataObserver(this)
|
||||
}
|
||||
|
||||
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
|
||||
super.onItemRangeInserted(positionStart, itemCount)
|
||||
if (positionStart == 0 && isScrolledToTop()) {
|
||||
postScrollUp()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemRangeMoved(fromPosition: Int, toPosition: Int, itemCount: Int) {
|
||||
super.onItemRangeMoved(fromPosition, toPosition, itemCount)
|
||||
if (toPosition == 0 && isScrolledToTop()) {
|
||||
postScrollUp()
|
||||
}
|
||||
}
|
||||
|
||||
private fun postScrollUp() {
|
||||
rv.postDelayed(scrollUpRunnable, 500L)
|
||||
}
|
||||
|
||||
private fun isScrolledToTop(): Boolean {
|
||||
return (rv.layoutManager as? LinearLayoutManager)?.findFirstVisibleItemPosition() == 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package org.koitharu.kotatsu.core.ui.widgets
|
||||
|
||||
import android.content.Context
|
||||
import android.util.ArrayMap
|
||||
import android.util.AttributeSet
|
||||
import com.google.android.material.slider.Slider
|
||||
import kotlin.math.cbrt
|
||||
import kotlin.math.pow
|
||||
|
||||
class CubicSlider @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
) : Slider(context, attrs) {
|
||||
|
||||
private val changeListeners = ArrayMap<OnChangeListener, OnChangeListenerMapper>(1)
|
||||
|
||||
override fun setValue(value: Float) {
|
||||
super.setValue(value.unmap())
|
||||
}
|
||||
|
||||
override fun getValue(): Float {
|
||||
return super.getValue().map()
|
||||
}
|
||||
|
||||
override fun getValueFrom(): Float {
|
||||
return super.getValueFrom().map()
|
||||
}
|
||||
|
||||
override fun setValueFrom(valueFrom: Float) {
|
||||
super.setValueFrom(valueFrom.unmap())
|
||||
}
|
||||
|
||||
override fun getValueTo(): Float {
|
||||
return super.getValueTo().map()
|
||||
}
|
||||
|
||||
override fun setValueTo(valueTo: Float) {
|
||||
super.setValueTo(valueTo.unmap())
|
||||
}
|
||||
|
||||
override fun addOnChangeListener(listener: OnChangeListener) {
|
||||
val mapper = OnChangeListenerMapper(listener)
|
||||
super.addOnChangeListener(mapper)
|
||||
changeListeners[listener] = mapper
|
||||
}
|
||||
|
||||
override fun removeOnChangeListener(listener: OnChangeListener) {
|
||||
changeListeners.remove(listener)?.let {
|
||||
super.removeOnChangeListener(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun clearOnChangeListeners() {
|
||||
super.clearOnChangeListeners()
|
||||
changeListeners.clear()
|
||||
}
|
||||
|
||||
private fun Float.map(): Float {
|
||||
return this.pow(3)
|
||||
}
|
||||
|
||||
private fun Float.unmap(): Float {
|
||||
return cbrt(this)
|
||||
}
|
||||
|
||||
private inner class OnChangeListenerMapper(
|
||||
private val delegate: OnChangeListener,
|
||||
) : OnChangeListener {
|
||||
|
||||
override fun onValueChange(slider: Slider, value: Float, fromUser: Boolean) {
|
||||
delegate.onValueChange(slider, value.map(), fromUser)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ class CompositeMutex<T : Any> : Set<T> {
|
||||
}
|
||||
|
||||
override fun isEmpty(): Boolean {
|
||||
return state.isEmpty
|
||||
return state.isEmpty()
|
||||
}
|
||||
|
||||
override fun iterator(): Iterator<T> {
|
||||
|
||||
@@ -19,7 +19,7 @@ class CompositeMutex2<T : Any> : Set<T> {
|
||||
}
|
||||
|
||||
override fun isEmpty(): Boolean {
|
||||
return delegates.isEmpty
|
||||
return delegates.isEmpty()
|
||||
}
|
||||
|
||||
override fun iterator(): Iterator<T> {
|
||||
|
||||
@@ -83,7 +83,7 @@ fun <I> ActivityResultLauncher<I>.tryLaunch(
|
||||
e.printStackTraceDebug()
|
||||
}.isSuccess
|
||||
|
||||
fun SharedPreferences.observe() = callbackFlow<String?> {
|
||||
fun SharedPreferences.observe(): Flow<String?> = callbackFlow {
|
||||
val listener = SharedPreferences.OnSharedPreferenceChangeListener { _, key ->
|
||||
trySendBlocking(key)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ fun ImageView.newImageRequest(lifecycleOwner: LifecycleOwner, data: Any?): Image
|
||||
return null
|
||||
}
|
||||
}
|
||||
disposeImageRequest()
|
||||
// disposeImageRequest()
|
||||
return ImageRequest.Builder(context)
|
||||
.data(data)
|
||||
.lifecycle(lifecycleOwner)
|
||||
|
||||
@@ -87,5 +87,5 @@ class DetailsInteractor @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun findLocal(seed: Manga) = localMangaRepository.getRemoteManga(seed)
|
||||
suspend fun findRemote(seed: Manga) = localMangaRepository.getRemoteManga(seed)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.koitharu.kotatsu.details.domain
|
||||
import org.koitharu.kotatsu.core.db.MangaDatabase
|
||||
import org.koitharu.kotatsu.core.model.findChapter
|
||||
import org.koitharu.kotatsu.core.model.isLocal
|
||||
import org.koitharu.kotatsu.core.os.NetworkState
|
||||
import org.koitharu.kotatsu.core.parser.MangaRepository
|
||||
import org.koitharu.kotatsu.history.data.PROGRESS_NONE
|
||||
import org.koitharu.kotatsu.local.data.LocalMangaRepository
|
||||
@@ -13,15 +14,19 @@ class ProgressUpdateUseCase @Inject constructor(
|
||||
private val mangaRepositoryFactory: MangaRepository.Factory,
|
||||
private val database: MangaDatabase,
|
||||
private val localMangaRepository: LocalMangaRepository,
|
||||
private val networkState: NetworkState,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(manga: Manga): Float {
|
||||
val history = database.historyDao.find(manga.id) ?: return PROGRESS_NONE
|
||||
val history = database.getHistoryDao().find(manga.id) ?: return PROGRESS_NONE
|
||||
val seed = if (manga.isLocal) {
|
||||
localMangaRepository.getRemoteManga(manga) ?: manga
|
||||
} else {
|
||||
manga
|
||||
}
|
||||
if (!seed.isLocal && !networkState.value) {
|
||||
return PROGRESS_NONE
|
||||
}
|
||||
val repo = mangaRepositoryFactory.create(seed.source)
|
||||
val details = if (manga.source != seed.source || seed.chapters.isNullOrEmpty()) {
|
||||
repo.getDetails(seed)
|
||||
@@ -43,7 +48,7 @@ class ProgressUpdateUseCase @Inject constructor(
|
||||
val ppc = 1f / chaptersCount
|
||||
val result = ppc * chapterIndex + ppc * pagePercent
|
||||
if (result != history.percent) {
|
||||
database.historyDao.update(
|
||||
database.getHistoryDao().update(
|
||||
history.copy(
|
||||
chapterId = chapter.id,
|
||||
percent = result,
|
||||
|
||||
@@ -149,15 +149,13 @@ class DetailsViewModel @Inject constructor(
|
||||
val scrobblingInfo: StateFlow<List<ScrobblingInfo>> = interactor.observeScrobblingInfo(mangaId)
|
||||
.stateIn(viewModelScope + Dispatchers.Default, SharingStarted.Eagerly, emptyList())
|
||||
|
||||
val relatedManga: StateFlow<List<MangaItemModel>> = manga
|
||||
.mapLatest {
|
||||
if (it != null && settings.isRelatedMangaEnabled) {
|
||||
relatedMangaUseCase.invoke(it)?.toUi(ListMode.GRID, extraProvider).orEmpty()
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
val relatedManga: StateFlow<List<MangaItemModel>> = manga.mapLatest {
|
||||
if (it != null && settings.isRelatedMangaEnabled) {
|
||||
relatedMangaUseCase.invoke(it)?.toUi(ListMode.GRID, extraProvider).orEmpty()
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
.stateIn(viewModelScope, SharingStarted.Lazily, emptyList())
|
||||
}.stateIn(viewModelScope, SharingStarted.Lazily, emptyList())
|
||||
|
||||
val branches: StateFlow<List<MangaBranch>> = combine(
|
||||
details,
|
||||
@@ -217,7 +215,7 @@ class DetailsViewModel @Inject constructor(
|
||||
}
|
||||
launchJob(Dispatchers.Default) {
|
||||
val manga = details.firstOrNull { it != null && it.isLocal } ?: return@launchJob
|
||||
remoteManga.value = interactor.findLocal(manga.toManga())
|
||||
remoteManga.value = interactor.findRemote(manga.toManga())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@ data class DownloadState(
|
||||
val currentPage: Int = 0,
|
||||
val eta: Long = -1L,
|
||||
val localManga: LocalManga? = null,
|
||||
val downloadedChapters: LongArray = LongArray(0),
|
||||
val scheduledChapters: LongArray = LongArray(0),
|
||||
val downloadedChapters: Int = 0,
|
||||
val timestamp: Long = System.currentTimeMillis(),
|
||||
) {
|
||||
|
||||
@@ -42,68 +41,17 @@ data class DownloadState(
|
||||
.putLong(DATA_ETA, eta)
|
||||
.putLong(DATA_TIMESTAMP, timestamp)
|
||||
.putString(DATA_ERROR, error)
|
||||
.putLongArray(DATA_CHAPTERS, downloadedChapters)
|
||||
.putLongArray(DATA_CHAPTERS_SRC, scheduledChapters)
|
||||
.putInt(DATA_CHAPTERS, downloadedChapters)
|
||||
.putBoolean(DATA_INDETERMINATE, isIndeterminate)
|
||||
.putBoolean(DATA_PAUSED, isPaused)
|
||||
.build()
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as DownloadState
|
||||
|
||||
if (manga != other.manga) return false
|
||||
if (isIndeterminate != other.isIndeterminate) return false
|
||||
if (isPaused != other.isPaused) return false
|
||||
if (isStopped != other.isStopped) return false
|
||||
if (error != other.error) return false
|
||||
if (totalChapters != other.totalChapters) return false
|
||||
if (currentChapter != other.currentChapter) return false
|
||||
if (totalPages != other.totalPages) return false
|
||||
if (currentPage != other.currentPage) return false
|
||||
if (eta != other.eta) return false
|
||||
if (localManga != other.localManga) return false
|
||||
if (!downloadedChapters.contentEquals(other.downloadedChapters)) return false
|
||||
if (!scheduledChapters.contentEquals(other.scheduledChapters)) return false
|
||||
if (timestamp != other.timestamp) return false
|
||||
if (max != other.max) return false
|
||||
if (progress != other.progress) return false
|
||||
if (percent != other.percent) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = manga.hashCode()
|
||||
result = 31 * result + isIndeterminate.hashCode()
|
||||
result = 31 * result + isPaused.hashCode()
|
||||
result = 31 * result + isStopped.hashCode()
|
||||
result = 31 * result + (error?.hashCode() ?: 0)
|
||||
result = 31 * result + totalChapters
|
||||
result = 31 * result + currentChapter
|
||||
result = 31 * result + totalPages
|
||||
result = 31 * result + currentPage
|
||||
result = 31 * result + eta.hashCode()
|
||||
result = 31 * result + (localManga?.hashCode() ?: 0)
|
||||
result = 31 * result + downloadedChapters.contentHashCode()
|
||||
result = 31 * result + scheduledChapters.contentHashCode()
|
||||
result = 31 * result + timestamp.hashCode()
|
||||
result = 31 * result + max
|
||||
result = 31 * result + progress
|
||||
result = 31 * result + percent.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
|
||||
private const val DATA_MANGA_ID = "manga_id"
|
||||
private const val DATA_MAX = "max"
|
||||
private const val DATA_PROGRESS = "progress"
|
||||
private const val DATA_CHAPTERS = "chapter"
|
||||
private const val DATA_CHAPTERS_SRC = "chapters_src"
|
||||
private const val DATA_CHAPTERS = "chapter_cnt"
|
||||
private const val DATA_ETA = "eta"
|
||||
private const val DATA_TIMESTAMP = "timestamp"
|
||||
private const val DATA_ERROR = "error"
|
||||
@@ -126,8 +74,6 @@ data class DownloadState(
|
||||
|
||||
fun getTimestamp(data: Data): Date = Date(data.getLong(DATA_TIMESTAMP, 0L))
|
||||
|
||||
fun getDownloadedChapters(data: Data): LongArray = data.getLongArray(DATA_CHAPTERS) ?: LongArray(0)
|
||||
|
||||
fun getScheduledChapters(data: Data): LongArray = data.getLongArray(DATA_CHAPTERS_SRC) ?: LongArray(0)
|
||||
fun getDownloadedChapters(data: Data): Int = data.getInt(DATA_CHAPTERS, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,22 @@ package org.koitharu.kotatsu.download.ui.list
|
||||
|
||||
import android.transition.TransitionManager
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.work.WorkInfo
|
||||
import coil.ImageLoader
|
||||
import coil.request.SuccessResult
|
||||
import coil.util.CoilUtils
|
||||
import com.hannesdorfmann.adapterdelegates4.dsl.adapterDelegateViewBinding
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.core.ui.BaseListAdapter
|
||||
import org.koitharu.kotatsu.core.ui.image.TrimTransformation
|
||||
import org.koitharu.kotatsu.core.util.ext.drawableEnd
|
||||
import org.koitharu.kotatsu.core.util.ext.enqueueWith
|
||||
import org.koitharu.kotatsu.core.util.ext.isAnimationsEnabled
|
||||
import org.koitharu.kotatsu.core.util.ext.newImageRequest
|
||||
import org.koitharu.kotatsu.core.util.ext.source
|
||||
import org.koitharu.kotatsu.core.util.ext.textAndVisible
|
||||
import org.koitharu.kotatsu.databinding.ItemDownloadBinding
|
||||
import org.koitharu.kotatsu.download.ui.list.chapters.DownloadChapter
|
||||
import org.koitharu.kotatsu.download.ui.list.chapters.downloadChapterAD
|
||||
import org.koitharu.kotatsu.list.ui.ListModelDiffCallback
|
||||
import org.koitharu.kotatsu.list.ui.adapter.ListItemType
|
||||
import org.koitharu.kotatsu.list.ui.model.ListModel
|
||||
import org.koitharu.kotatsu.parsers.util.format
|
||||
|
||||
@@ -36,9 +30,7 @@ fun downloadItemAD(
|
||||
) {
|
||||
|
||||
val percentPattern = context.resources.getString(R.string.percent_string_pattern)
|
||||
val expandIcon = ContextCompat.getDrawable(context, R.drawable.ic_expand_collapse)
|
||||
val chaptersAdapter = BaseListAdapter<DownloadChapter>()
|
||||
.addDelegate(ListItemType.CHAPTER, downloadChapterAD())
|
||||
// val expandIcon = ContextCompat.getDrawable(context, R.drawable.ic_expand_collapse)
|
||||
|
||||
val clickListener = object : View.OnClickListener, View.OnLongClickListener {
|
||||
override fun onClick(v: View) {
|
||||
@@ -59,27 +51,26 @@ fun downloadItemAD(
|
||||
binding.buttonResume.setOnClickListener(clickListener)
|
||||
itemView.setOnClickListener(clickListener)
|
||||
itemView.setOnLongClickListener(clickListener)
|
||||
binding.recyclerViewChapters.addItemDecoration(DividerItemDecoration(context, RecyclerView.VERTICAL))
|
||||
binding.recyclerViewChapters.adapter = chaptersAdapter
|
||||
|
||||
bind { payloads ->
|
||||
if (ListModelDiffCallback.PAYLOAD_CHECKED_CHANGED in payloads && context.isAnimationsEnabled) {
|
||||
TransitionManager.beginDelayedTransition(binding.constraintLayout)
|
||||
}
|
||||
binding.textViewTitle.text = item.manga.title
|
||||
binding.imageViewCover.newImageRequest(lifecycleOwner, item.manga.coverUrl)?.apply {
|
||||
placeholder(R.drawable.ic_placeholder)
|
||||
fallback(R.drawable.ic_placeholder)
|
||||
error(R.drawable.ic_error_placeholder)
|
||||
allowRgb565(true)
|
||||
transformations(TrimTransformation())
|
||||
source(item.manga.source)
|
||||
enqueueWith(coil)
|
||||
if ((CoilUtils.result(binding.imageViewCover) as? SuccessResult)?.memoryCacheKey != item.coverCacheKey) {
|
||||
binding.imageViewCover.newImageRequest(lifecycleOwner, item.manga.coverUrl)?.apply {
|
||||
placeholder(R.drawable.ic_placeholder)
|
||||
fallback(R.drawable.ic_placeholder)
|
||||
error(R.drawable.ic_error_placeholder)
|
||||
allowRgb565(true)
|
||||
transformations(TrimTransformation())
|
||||
memoryCacheKey(item.coverCacheKey)
|
||||
source(item.manga.source)
|
||||
enqueueWith(coil)
|
||||
}
|
||||
}
|
||||
binding.textViewTitle.isChecked = item.isExpanded
|
||||
binding.textViewTitle.drawableEnd = if (item.isExpandable) expandIcon else null
|
||||
binding.cardDetails.isVisible = item.isExpanded
|
||||
chaptersAdapter.items = item.chapters
|
||||
// binding.textViewTitle.isChecked = item.isExpanded
|
||||
// binding.textViewTitle.drawableEnd = if (item.isExpandable) expandIcon else null
|
||||
when (item.workState) {
|
||||
WorkInfo.State.ENQUEUED,
|
||||
WorkInfo.State.BLOCKED -> {
|
||||
@@ -117,11 +108,11 @@ fun downloadItemAD(
|
||||
binding.progressBar.isVisible = false
|
||||
binding.progressBar.isEnabled = true
|
||||
binding.textViewPercent.isVisible = false
|
||||
if (item.totalChapters > 0) {
|
||||
if (item.chaptersDownloaded > 0) {
|
||||
binding.textViewDetails.text = context.resources.getQuantityString(
|
||||
R.plurals.chapters,
|
||||
item.totalChapters,
|
||||
item.totalChapters,
|
||||
item.chaptersDownloaded,
|
||||
item.chaptersDownloaded,
|
||||
)
|
||||
binding.textViewDetails.isVisible = true
|
||||
} else {
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.koitharu.kotatsu.download.ui.list
|
||||
|
||||
import android.text.format.DateUtils
|
||||
import androidx.work.WorkInfo
|
||||
import org.koitharu.kotatsu.download.ui.list.chapters.DownloadChapter
|
||||
import coil.memory.MemoryCache
|
||||
import org.koitharu.kotatsu.list.ui.ListModelDiffCallback
|
||||
import org.koitharu.kotatsu.list.ui.model.ListModel
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
@@ -17,14 +17,15 @@ data class DownloadItemModel(
|
||||
val manga: Manga,
|
||||
val error: String?,
|
||||
val max: Int,
|
||||
val totalChapters: Int,
|
||||
val progress: Int,
|
||||
val eta: Long,
|
||||
val timestamp: Date,
|
||||
val chapters: List<DownloadChapter>,
|
||||
val chaptersDownloaded: Int,
|
||||
val isExpanded: Boolean,
|
||||
) : ListModel, Comparable<DownloadItemModel> {
|
||||
|
||||
val coverCacheKey = MemoryCache.Key(manga.coverUrl, mapOf("dl" to "1"))
|
||||
|
||||
val percent: Float
|
||||
get() = if (max > 0) progress / max.toFloat() else 0f
|
||||
|
||||
@@ -38,7 +39,7 @@ data class DownloadItemModel(
|
||||
get() = workState == WorkInfo.State.RUNNING && isPaused
|
||||
|
||||
val isExpandable: Boolean
|
||||
get() = chapters.isNotEmpty()
|
||||
get() = false // TODO
|
||||
|
||||
fun getEtaString(): CharSequence? = if (hasEta) {
|
||||
DateUtils.getRelativeTimeSpanString(
|
||||
|
||||
@@ -15,6 +15,7 @@ import dagger.hilt.android.AndroidEntryPoint
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.core.ui.BaseActivity
|
||||
import org.koitharu.kotatsu.core.ui.list.ListSelectionController
|
||||
import org.koitharu.kotatsu.core.ui.list.RecyclerScrollKeeper
|
||||
import org.koitharu.kotatsu.core.ui.util.MenuInvalidator
|
||||
import org.koitharu.kotatsu.core.ui.util.ReversibleActionObserver
|
||||
import org.koitharu.kotatsu.core.util.ext.observe
|
||||
@@ -53,6 +54,7 @@ class DownloadsActivity : BaseActivity<ActivityDownloadsBinding>(),
|
||||
addItemDecoration(decoration)
|
||||
adapter = downloadsAdapter
|
||||
selectionController.attachToRecyclerView(this)
|
||||
RecyclerScrollKeeper(this).attach()
|
||||
}
|
||||
addMenuProvider(DownloadsMenuProvider(this, viewModel))
|
||||
viewModel.items.observe(this) {
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.koitharu.kotatsu.core.util.ext.MutableEventFlow
|
||||
import org.koitharu.kotatsu.core.util.ext.call
|
||||
import org.koitharu.kotatsu.core.util.ext.daysDiff
|
||||
import org.koitharu.kotatsu.download.domain.DownloadState
|
||||
import org.koitharu.kotatsu.download.ui.list.chapters.DownloadChapter
|
||||
import org.koitharu.kotatsu.download.ui.worker.DownloadWorker
|
||||
import org.koitharu.kotatsu.list.ui.model.EmptyState
|
||||
import org.koitharu.kotatsu.list.ui.model.ListHeader
|
||||
@@ -239,8 +238,6 @@ class DownloadsViewModel @Inject constructor(
|
||||
val mangaId = DownloadState.getMangaId(workData)
|
||||
if (mangaId == 0L) return null
|
||||
val manga = getManga(mangaId) ?: return null
|
||||
val downloadedChapters = DownloadState.getDownloadedChapters(workData)
|
||||
val scheduledChapters = DownloadState.getScheduledChapters(workData).toSet()
|
||||
return DownloadItemModel(
|
||||
id = id,
|
||||
workState = state,
|
||||
@@ -252,19 +249,8 @@ class DownloadsViewModel @Inject constructor(
|
||||
progress = DownloadState.getProgress(workData),
|
||||
eta = DownloadState.getEta(workData),
|
||||
timestamp = DownloadState.getTimestamp(workData),
|
||||
totalChapters = downloadedChapters.size,
|
||||
chaptersDownloaded = DownloadState.getDownloadedChapters(workData),
|
||||
isExpanded = isExpanded,
|
||||
chapters = manga.chapters?.mapNotNull {
|
||||
if (it.id in scheduledChapters) {
|
||||
DownloadChapter(
|
||||
number = it.number,
|
||||
name = it.name,
|
||||
isDownloaded = it.id in downloadedChapters,
|
||||
)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}.orEmpty(),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import okio.buffer
|
||||
import okio.sink
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.core.exceptions.TooManyRequestExceptions
|
||||
import org.koitharu.kotatsu.core.model.ids
|
||||
import org.koitharu.kotatsu.core.network.CommonHeaders
|
||||
import org.koitharu.kotatsu.core.network.MangaHttpClient
|
||||
import org.koitharu.kotatsu.core.parser.MangaDataRepository
|
||||
@@ -46,7 +47,6 @@ import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||
import org.koitharu.kotatsu.core.util.Throttler
|
||||
import org.koitharu.kotatsu.core.util.ext.awaitFinishedWorkInfosByTag
|
||||
import org.koitharu.kotatsu.core.util.ext.awaitUpdateWork
|
||||
import org.koitharu.kotatsu.core.util.ext.awaitWorkInfoById
|
||||
import org.koitharu.kotatsu.core.util.ext.awaitWorkInfosByTag
|
||||
import org.koitharu.kotatsu.core.util.ext.deleteAwait
|
||||
import org.koitharu.kotatsu.core.util.ext.deleteWork
|
||||
@@ -105,11 +105,12 @@ class DownloadWorker @AssistedInject constructor(
|
||||
setForeground(getForegroundInfo())
|
||||
val mangaId = inputData.getLong(MANGA_ID, 0L)
|
||||
val manga = mangaDataRepository.findMangaById(mangaId) ?: return Result.failure()
|
||||
val chaptersIds = inputData.getLongArray(CHAPTERS_IDS)?.takeUnless { it.isEmpty() }
|
||||
val downloadedIds = getDoneChapters()
|
||||
lastPublishedState = DownloadState(manga, isIndeterminate = true)
|
||||
publishState(DownloadState(manga, isIndeterminate = true))
|
||||
val chaptersIds = inputData.getLongArray(CHAPTERS_IDS)?.takeUnless { it.isEmpty() }
|
||||
val downloadedIds = getDoneChapters(manga)
|
||||
return try {
|
||||
downloadMangaImpl(chaptersIds, downloadedIds)
|
||||
downloadMangaImpl(manga, chaptersIds, downloadedIds)
|
||||
Result.success(currentState.toWorkData())
|
||||
} catch (e: CancellationException) {
|
||||
withContext(NonCancellable) {
|
||||
@@ -147,10 +148,11 @@ class DownloadWorker @AssistedInject constructor(
|
||||
}
|
||||
|
||||
private suspend fun downloadMangaImpl(
|
||||
subject: Manga,
|
||||
includedIds: LongArray?,
|
||||
excludedIds: LongArray,
|
||||
excludedIds: Set<Long>,
|
||||
) {
|
||||
var manga = currentState.manga
|
||||
var manga = subject
|
||||
val chaptersToSkip = excludedIds.toMutableSet()
|
||||
withMangaLock(manga) {
|
||||
ContextCompat.registerReceiver(
|
||||
@@ -178,16 +180,9 @@ class DownloadWorker @AssistedInject constructor(
|
||||
}
|
||||
}
|
||||
val chapters = getChapters(mangaDetails, includedIds)
|
||||
publishState(
|
||||
currentState.copy(scheduledChapters = LongArray(chapters.size) { i -> chapters[i].id }),
|
||||
)
|
||||
for ((chapterIndex, chapter) in chapters.withIndex()) {
|
||||
if (chaptersToSkip.remove(chapter.id)) {
|
||||
publishState(
|
||||
currentState.copy(
|
||||
downloadedChapters = currentState.downloadedChapters + chapter.id,
|
||||
),
|
||||
)
|
||||
publishState(currentState.copy(downloadedChapters = currentState.downloadedChapters + 1))
|
||||
continue
|
||||
}
|
||||
val pages = runFailsafe(pausingHandle) {
|
||||
@@ -225,11 +220,7 @@ class DownloadWorker @AssistedInject constructor(
|
||||
localStorageChanges.emit(LocalMangaInput.of(output.rootFile).getManga())
|
||||
}.onFailure(Throwable::printStackTraceDebug)
|
||||
}
|
||||
publishState(
|
||||
currentState.copy(
|
||||
downloadedChapters = currentState.downloadedChapters + chapter.id,
|
||||
),
|
||||
)
|
||||
publishState(currentState.copy(downloadedChapters = currentState.downloadedChapters + 1))
|
||||
}
|
||||
publishState(currentState.copy(isIndeterminate = true, eta = -1L))
|
||||
output.mergeWithExisting()
|
||||
@@ -336,11 +327,9 @@ class DownloadWorker @AssistedInject constructor(
|
||||
setProgress(state.toWorkData())
|
||||
}
|
||||
|
||||
private suspend fun getDoneChapters(): LongArray {
|
||||
val work = WorkManager.getInstance(applicationContext).awaitWorkInfoById(id)
|
||||
?: return LongArray(0)
|
||||
return DownloadState.getDownloadedChapters(work.progress)
|
||||
}
|
||||
private suspend fun getDoneChapters(manga: Manga) = runCatchingCancellable {
|
||||
localMangaRepository.getDetails(manga).chapters?.ids()
|
||||
}.getOrNull().orEmpty()
|
||||
|
||||
private fun getChapters(
|
||||
manga: Manga,
|
||||
|
||||
@@ -30,7 +30,7 @@ class MangaSourcesRepository @Inject constructor(
|
||||
) {
|
||||
|
||||
private val dao: MangaSourcesDao
|
||||
get() = db.sourcesDao
|
||||
get() = db.getSourcesDao()
|
||||
|
||||
private val remoteSources = EnumSet.allOf(MangaSource::class.java).apply {
|
||||
remove(MangaSource.LOCAL)
|
||||
|
||||
@@ -169,6 +169,7 @@ abstract class FavouritesDao {
|
||||
ListSortOrder.NEWEST -> "favourites.created_at DESC"
|
||||
ListSortOrder.ALPHABETIC -> "manga.title ASC"
|
||||
ListSortOrder.NEW_CHAPTERS -> "(SELECT chapters_new FROM tracks WHERE tracks.manga_id = manga.manga_id) DESC"
|
||||
ListSortOrder.UPDATED, // for legacy support
|
||||
ListSortOrder.PROGRESS -> "(SELECT percent FROM history WHERE history.manga_id = manga.manga_id) DESC"
|
||||
else -> throw IllegalArgumentException("Sort order $sortOrder is not supported")
|
||||
}
|
||||
|
||||
@@ -31,27 +31,27 @@ class FavouritesRepository @Inject constructor(
|
||||
) {
|
||||
|
||||
suspend fun getAllManga(): List<Manga> {
|
||||
val entities = db.favouritesDao.findAll()
|
||||
val entities = db.getFavouritesDao().findAll()
|
||||
return entities.toMangaList()
|
||||
}
|
||||
|
||||
suspend fun getLastManga(limit: Int): List<Manga> {
|
||||
val entities = db.favouritesDao.findLast(limit)
|
||||
val entities = db.getFavouritesDao().findLast(limit)
|
||||
return entities.toMangaList()
|
||||
}
|
||||
|
||||
fun observeAll(order: ListSortOrder): Flow<List<Manga>> {
|
||||
return db.favouritesDao.observeAll(order)
|
||||
return db.getFavouritesDao().observeAll(order)
|
||||
.mapItems { it.toManga() }
|
||||
}
|
||||
|
||||
suspend fun getManga(categoryId: Long): List<Manga> {
|
||||
val entities = db.favouritesDao.findAll(categoryId)
|
||||
val entities = db.getFavouritesDao().findAll(categoryId)
|
||||
return entities.toMangaList()
|
||||
}
|
||||
|
||||
fun observeAll(categoryId: Long, order: ListSortOrder): Flow<List<Manga>> {
|
||||
return db.favouritesDao.observeAll(categoryId, order)
|
||||
return db.getFavouritesDao().observeAll(categoryId, order)
|
||||
.mapItems { it.toManga() }
|
||||
}
|
||||
|
||||
@@ -61,25 +61,25 @@ class FavouritesRepository @Inject constructor(
|
||||
}
|
||||
|
||||
fun observeCategories(): Flow<List<FavouriteCategory>> {
|
||||
return db.favouriteCategoriesDao.observeAll().mapItems {
|
||||
return db.getFavouriteCategoriesDao().observeAll().mapItems {
|
||||
it.toFavouriteCategory()
|
||||
}.distinctUntilChanged()
|
||||
}
|
||||
|
||||
fun observeCategoriesForLibrary(): Flow<List<FavouriteCategory>> {
|
||||
return db.favouriteCategoriesDao.observeAllForLibrary().mapItems {
|
||||
return db.getFavouriteCategoriesDao().observeAllForLibrary().mapItems {
|
||||
it.toFavouriteCategory()
|
||||
}.distinctUntilChanged()
|
||||
}
|
||||
|
||||
fun observeCategoriesWithCovers(): Flow<Map<FavouriteCategory, List<Cover>>> {
|
||||
return db.favouriteCategoriesDao.observeAll()
|
||||
return db.getFavouriteCategoriesDao().observeAll()
|
||||
.map {
|
||||
db.withTransaction {
|
||||
val res = LinkedHashMap<FavouriteCategory, List<Cover>>()
|
||||
for (entity in it) {
|
||||
val cat = entity.toFavouriteCategory()
|
||||
res[cat] = db.favouritesDao.findCovers(
|
||||
res[cat] = db.getFavouritesDao().findCovers(
|
||||
categoryId = cat.id,
|
||||
order = cat.order,
|
||||
)
|
||||
@@ -90,16 +90,16 @@ class FavouritesRepository @Inject constructor(
|
||||
}
|
||||
|
||||
fun observeCategory(id: Long): Flow<FavouriteCategory?> {
|
||||
return db.favouriteCategoriesDao.observe(id)
|
||||
return db.getFavouriteCategoriesDao().observe(id)
|
||||
.map { it?.toFavouriteCategory() }
|
||||
}
|
||||
|
||||
fun observeCategoriesIds(mangaId: Long): Flow<Set<Long>> {
|
||||
return db.favouritesDao.observeIds(mangaId).map { it.toSet() }
|
||||
return db.getFavouritesDao().observeIds(mangaId).map { it.toSet() }
|
||||
}
|
||||
|
||||
suspend fun getCategory(id: Long): FavouriteCategory {
|
||||
return db.favouriteCategoriesDao.find(id.toInt()).toFavouriteCategory()
|
||||
return db.getFavouriteCategoriesDao().find(id.toInt()).toFavouriteCategory()
|
||||
}
|
||||
|
||||
suspend fun createCategory(
|
||||
@@ -111,14 +111,14 @@ class FavouritesRepository @Inject constructor(
|
||||
val entity = FavouriteCategoryEntity(
|
||||
title = title,
|
||||
createdAt = System.currentTimeMillis(),
|
||||
sortKey = db.favouriteCategoriesDao.getNextSortKey(),
|
||||
sortKey = db.getFavouriteCategoriesDao().getNextSortKey(),
|
||||
categoryId = 0,
|
||||
order = sortOrder.name,
|
||||
track = isTrackerEnabled,
|
||||
deletedAt = 0L,
|
||||
isVisibleInLibrary = isVisibleOnShelf,
|
||||
)
|
||||
val id = db.favouriteCategoriesDao.insert(entity)
|
||||
val id = db.getFavouriteCategoriesDao().insert(entity)
|
||||
val category = entity.toFavouriteCategory(id)
|
||||
channels.createChannel(category)
|
||||
return category
|
||||
@@ -131,22 +131,22 @@ class FavouritesRepository @Inject constructor(
|
||||
isTrackerEnabled: Boolean,
|
||||
isVisibleOnShelf: Boolean,
|
||||
) {
|
||||
db.favouriteCategoriesDao.update(id, title, sortOrder.name, isTrackerEnabled, isVisibleOnShelf)
|
||||
db.getFavouriteCategoriesDao().update(id, title, sortOrder.name, isTrackerEnabled, isVisibleOnShelf)
|
||||
}
|
||||
|
||||
suspend fun updateCategory(id: Long, isVisibleInLibrary: Boolean) {
|
||||
db.favouriteCategoriesDao.updateLibVisibility(id, isVisibleInLibrary)
|
||||
db.getFavouriteCategoriesDao().updateLibVisibility(id, isVisibleInLibrary)
|
||||
}
|
||||
|
||||
suspend fun updateCategoryTracking(id: Long, isTrackingEnabled: Boolean) {
|
||||
db.favouriteCategoriesDao.updateTracking(id, isTrackingEnabled)
|
||||
db.getFavouriteCategoriesDao().updateTracking(id, isTrackingEnabled)
|
||||
}
|
||||
|
||||
suspend fun removeCategories(ids: Collection<Long>) {
|
||||
db.withTransaction {
|
||||
for (id in ids) {
|
||||
db.favouritesDao.deleteAll(id)
|
||||
db.favouriteCategoriesDao.delete(id)
|
||||
db.getFavouritesDao().deleteAll(id)
|
||||
db.getFavouriteCategoriesDao().delete(id)
|
||||
}
|
||||
}
|
||||
// run after transaction success
|
||||
@@ -156,11 +156,11 @@ class FavouritesRepository @Inject constructor(
|
||||
}
|
||||
|
||||
suspend fun setCategoryOrder(id: Long, order: ListSortOrder) {
|
||||
db.favouriteCategoriesDao.updateOrder(id, order.name)
|
||||
db.getFavouriteCategoriesDao().updateOrder(id, order.name)
|
||||
}
|
||||
|
||||
suspend fun reorderCategories(orderedIds: List<Long>) {
|
||||
val dao = db.favouriteCategoriesDao
|
||||
val dao = db.getFavouriteCategoriesDao()
|
||||
db.withTransaction {
|
||||
for ((i, id) in orderedIds.withIndex()) {
|
||||
dao.updateSortKey(id, i)
|
||||
@@ -172,8 +172,8 @@ class FavouritesRepository @Inject constructor(
|
||||
db.withTransaction {
|
||||
for (manga in mangas) {
|
||||
val tags = manga.tags.toEntities()
|
||||
db.tagsDao.upsert(tags)
|
||||
db.mangaDao.upsert(manga.toEntity(), tags)
|
||||
db.getTagsDao().upsert(tags)
|
||||
db.getMangaDao().upsert(manga.toEntity(), tags)
|
||||
val entity = FavouriteEntity(
|
||||
mangaId = manga.id,
|
||||
categoryId = categoryId,
|
||||
@@ -181,7 +181,7 @@ class FavouritesRepository @Inject constructor(
|
||||
sortKey = 0,
|
||||
deletedAt = 0L,
|
||||
)
|
||||
db.favouritesDao.insert(entity)
|
||||
db.getFavouritesDao().insert(entity)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,7 +189,7 @@ class FavouritesRepository @Inject constructor(
|
||||
suspend fun removeFromFavourites(ids: Collection<Long>): ReversibleHandle {
|
||||
db.withTransaction {
|
||||
for (id in ids) {
|
||||
db.favouritesDao.delete(mangaId = id)
|
||||
db.getFavouritesDao().delete(mangaId = id)
|
||||
}
|
||||
}
|
||||
return ReversibleHandle { recoverToFavourites(ids) }
|
||||
@@ -198,14 +198,14 @@ class FavouritesRepository @Inject constructor(
|
||||
suspend fun removeFromCategory(categoryId: Long, ids: Collection<Long>): ReversibleHandle {
|
||||
db.withTransaction {
|
||||
for (id in ids) {
|
||||
db.favouritesDao.delete(categoryId = categoryId, mangaId = id)
|
||||
db.getFavouritesDao().delete(categoryId = categoryId, mangaId = id)
|
||||
}
|
||||
}
|
||||
return ReversibleHandle { recoverToCategory(categoryId, ids) }
|
||||
}
|
||||
|
||||
private fun observeOrder(categoryId: Long): Flow<ListSortOrder> {
|
||||
return db.favouriteCategoriesDao.observe(categoryId)
|
||||
return db.getFavouriteCategoriesDao().observe(categoryId)
|
||||
.filterNotNull()
|
||||
.map { x -> ListSortOrder(x.order, ListSortOrder.NEWEST) }
|
||||
.distinctUntilChanged()
|
||||
@@ -214,7 +214,7 @@ class FavouritesRepository @Inject constructor(
|
||||
private suspend fun recoverToFavourites(ids: Collection<Long>) {
|
||||
db.withTransaction {
|
||||
for (id in ids) {
|
||||
db.favouritesDao.recover(mangaId = id)
|
||||
db.getFavouritesDao().recover(mangaId = id)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,7 +222,7 @@ class FavouritesRepository @Inject constructor(
|
||||
private suspend fun recoverToCategory(categoryId: Long, ids: Collection<Long>) {
|
||||
db.withTransaction {
|
||||
for (id in ids) {
|
||||
db.favouritesDao.recover(mangaId = id, categoryId = categoryId)
|
||||
db.getFavouritesDao().recover(mangaId = id, categoryId = categoryId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ abstract class HistoryDao {
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM history WHERE deleted_at = 0 AND manga_id IN (:ids)")
|
||||
abstract suspend fun findAll(ids: Collection<Long>): List<HistoryEntity?>
|
||||
abstract suspend fun findAll(ids: Collection<Long>): List<HistoryEntity>
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM history WHERE deleted_at = 0 ORDER BY updated_at DESC")
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.koitharu.kotatsu.core.db.entity.toMangaTag
|
||||
import org.koitharu.kotatsu.core.db.entity.toMangaTags
|
||||
import org.koitharu.kotatsu.core.model.MangaHistory
|
||||
import org.koitharu.kotatsu.core.model.findById
|
||||
import org.koitharu.kotatsu.core.model.isLocal
|
||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||
import org.koitharu.kotatsu.core.ui.util.ReversibleHandle
|
||||
import org.koitharu.kotatsu.core.util.ext.mapItems
|
||||
@@ -38,36 +39,36 @@ class HistoryRepository @Inject constructor(
|
||||
) {
|
||||
|
||||
suspend fun getList(offset: Int, limit: Int): List<Manga> {
|
||||
val entities = db.historyDao.findAll(offset, limit)
|
||||
val entities = db.getHistoryDao().findAll(offset, limit)
|
||||
return entities.map { it.manga.toManga(it.tags.toMangaTags()) }
|
||||
}
|
||||
|
||||
suspend fun getLastOrNull(): Manga? {
|
||||
val entity = db.historyDao.findAll(0, 1).firstOrNull() ?: return null
|
||||
val entity = db.getHistoryDao().findAll(0, 1).firstOrNull() ?: return null
|
||||
return entity.manga.toManga(entity.tags.toMangaTags())
|
||||
}
|
||||
|
||||
fun observeLast(): Flow<Manga?> {
|
||||
return db.historyDao.observeAll(1).map {
|
||||
return db.getHistoryDao().observeAll(1).map {
|
||||
val first = it.firstOrNull()
|
||||
first?.manga?.toManga(first.tags.toMangaTags())
|
||||
}
|
||||
}
|
||||
|
||||
fun observeAll(): Flow<List<Manga>> {
|
||||
return db.historyDao.observeAll().mapItems {
|
||||
return db.getHistoryDao().observeAll().mapItems {
|
||||
it.manga.toManga(it.tags.toMangaTags())
|
||||
}
|
||||
}
|
||||
|
||||
fun observeAll(limit: Int): Flow<List<Manga>> {
|
||||
return db.historyDao.observeAll(limit).mapItems {
|
||||
return db.getHistoryDao().observeAll(limit).mapItems {
|
||||
it.manga.toManga(it.tags.toMangaTags())
|
||||
}
|
||||
}
|
||||
|
||||
fun observeAllWithHistory(order: ListSortOrder): Flow<List<MangaWithHistory>> {
|
||||
return db.historyDao.observeAll(order).mapItems {
|
||||
return db.getHistoryDao().observeAll(order).mapItems {
|
||||
MangaWithHistory(
|
||||
it.manga.toManga(it.tags.toMangaTags()),
|
||||
it.history.toMangaHistory(),
|
||||
@@ -76,13 +77,13 @@ class HistoryRepository @Inject constructor(
|
||||
}
|
||||
|
||||
fun observeOne(id: Long): Flow<MangaHistory?> {
|
||||
return db.historyDao.observe(id).map {
|
||||
return db.getHistoryDao().observe(id).map {
|
||||
it?.toMangaHistory()
|
||||
}
|
||||
}
|
||||
|
||||
fun observeHasItems(): Flow<Boolean> {
|
||||
return db.historyDao.observeCount()
|
||||
return db.getHistoryDao().observeCount()
|
||||
.map { it > 0 }
|
||||
.distinctUntilChanged()
|
||||
}
|
||||
@@ -93,12 +94,12 @@ class HistoryRepository @Inject constructor(
|
||||
}
|
||||
val tags = manga.tags.toEntities()
|
||||
db.withTransaction {
|
||||
val existing = db.mangaDao.find(manga.id)?.manga
|
||||
val existing = db.getMangaDao().find(manga.id)?.manga
|
||||
if (existing == null || existing.source == manga.source.name) {
|
||||
db.tagsDao.upsert(tags)
|
||||
db.mangaDao.upsert(manga.toEntity(), tags)
|
||||
db.getTagsDao().upsert(tags)
|
||||
db.getMangaDao().upsert(manga.toEntity(), tags)
|
||||
}
|
||||
db.historyDao.upsert(
|
||||
db.getHistoryDao().upsert(
|
||||
HistoryEntity(
|
||||
mangaId = manga.id,
|
||||
createdAt = System.currentTimeMillis(),
|
||||
@@ -119,29 +120,29 @@ class HistoryRepository @Inject constructor(
|
||||
}
|
||||
|
||||
suspend fun getOne(manga: Manga): MangaHistory? {
|
||||
return db.historyDao.find(manga.id)?.recoverIfNeeded(manga)?.toMangaHistory()
|
||||
return db.getHistoryDao().find(manga.id)?.recoverIfNeeded(manga)?.toMangaHistory()
|
||||
}
|
||||
|
||||
suspend fun getProgress(mangaId: Long): Float {
|
||||
return db.historyDao.findProgress(mangaId) ?: PROGRESS_NONE
|
||||
return db.getHistoryDao().findProgress(mangaId) ?: PROGRESS_NONE
|
||||
}
|
||||
|
||||
suspend fun clear() {
|
||||
db.historyDao.clear()
|
||||
db.getHistoryDao().clear()
|
||||
}
|
||||
|
||||
suspend fun delete(manga: Manga) {
|
||||
db.historyDao.delete(manga.id)
|
||||
db.getHistoryDao().delete(manga.id)
|
||||
}
|
||||
|
||||
suspend fun deleteAfter(minDate: Long) {
|
||||
db.historyDao.deleteAfter(minDate)
|
||||
db.getHistoryDao().deleteAfter(minDate)
|
||||
}
|
||||
|
||||
suspend fun delete(ids: Collection<Long>): ReversibleHandle {
|
||||
db.withTransaction {
|
||||
for (id in ids) {
|
||||
db.historyDao.delete(id)
|
||||
db.getHistoryDao().delete(id)
|
||||
}
|
||||
}
|
||||
return ReversibleHandle {
|
||||
@@ -154,13 +155,13 @@ class HistoryRepository @Inject constructor(
|
||||
* Useful for replacing saved manga on deleting it with remote source
|
||||
*/
|
||||
suspend fun deleteOrSwap(manga: Manga, alternative: Manga?) {
|
||||
if (alternative == null || db.mangaDao.update(alternative.toEntity()) <= 0) {
|
||||
db.historyDao.delete(manga.id)
|
||||
if (alternative == null || db.getMangaDao().update(alternative.toEntity()) <= 0) {
|
||||
db.getHistoryDao().delete(manga.id)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getPopularTags(limit: Int): List<MangaTag> {
|
||||
return db.historyDao.findPopularTags(limit).map { x -> x.toMangaTag() }
|
||||
return db.getHistoryDao().findPopularTags(limit).map { x -> x.toMangaTag() }
|
||||
}
|
||||
|
||||
fun shouldSkip(manga: Manga): Boolean {
|
||||
@@ -178,21 +179,21 @@ class HistoryRepository @Inject constructor(
|
||||
private suspend fun recover(ids: Collection<Long>) {
|
||||
db.withTransaction {
|
||||
for (id in ids) {
|
||||
db.historyDao.recover(id)
|
||||
db.getHistoryDao().recover(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun HistoryEntity.recoverIfNeeded(manga: Manga): HistoryEntity {
|
||||
val chapters = manga.chapters
|
||||
if (chapters.isNullOrEmpty() || chapters.findById(chapterId) != null) {
|
||||
if (manga.isLocal || chapters.isNullOrEmpty() || chapters.findById(chapterId) != null) {
|
||||
return this
|
||||
}
|
||||
val newChapterId = chapters.getOrNull(
|
||||
(chapters.size * percent).toInt(),
|
||||
)?.id ?: return this
|
||||
val newEntity = copy(chapterId = newChapterId)
|
||||
db.historyDao.update(newEntity)
|
||||
db.getHistoryDao().update(newEntity)
|
||||
return newEntity
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import dagger.hilt.android.AndroidEntryPoint
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.core.os.NetworkManageIntent
|
||||
import org.koitharu.kotatsu.core.ui.list.ListSelectionController
|
||||
import org.koitharu.kotatsu.core.ui.list.RecyclerScrollKeeper
|
||||
import org.koitharu.kotatsu.core.util.ext.addMenuProvider
|
||||
import org.koitharu.kotatsu.databinding.FragmentListBinding
|
||||
import org.koitharu.kotatsu.list.ui.MangaListFragment
|
||||
@@ -23,6 +24,7 @@ class HistoryListFragment : MangaListFragment() {
|
||||
|
||||
override fun onViewBindingCreated(binding: FragmentListBinding, savedInstanceState: Bundle?) {
|
||||
super.onViewBindingCreated(binding, savedInstanceState)
|
||||
RecyclerScrollKeeper(binding.recyclerView).attach()
|
||||
addMenuProvider(HistoryListMenuProvider(binding.root.context, viewModel))
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import coil.request.ImageRequest
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedInject
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.core.ErrorReporterReceiver
|
||||
import org.koitharu.kotatsu.core.util.ext.checkNotificationPermission
|
||||
import org.koitharu.kotatsu.core.util.ext.getDisplayMessage
|
||||
import org.koitharu.kotatsu.core.util.ext.toBitmapOrNull
|
||||
@@ -91,6 +92,7 @@ class ImportWorker @AssistedInject constructor(
|
||||
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
||||
.setDefaults(0)
|
||||
.setSilent(true)
|
||||
.setAutoCancel(true)
|
||||
result.onSuccess { manga ->
|
||||
notification.setLargeIcon(
|
||||
coil.execute(
|
||||
@@ -110,10 +112,9 @@ class ImportWorker @AssistedInject constructor(
|
||||
PendingIntent.FLAG_UPDATE_CURRENT,
|
||||
false,
|
||||
),
|
||||
).setAutoCancel(true)
|
||||
.setVisibility(
|
||||
if (manga.isNsfw) NotificationCompat.VISIBILITY_SECRET else NotificationCompat.VISIBILITY_PUBLIC,
|
||||
)
|
||||
).setVisibility(
|
||||
if (manga.isNsfw) NotificationCompat.VISIBILITY_SECRET else NotificationCompat.VISIBILITY_PUBLIC,
|
||||
)
|
||||
notification.setContentTitle(applicationContext.getString(R.string.import_completed))
|
||||
.setContentText(applicationContext.getString(R.string.import_completed_hint))
|
||||
.setSmallIcon(R.drawable.ic_stat_done)
|
||||
@@ -123,6 +124,11 @@ class ImportWorker @AssistedInject constructor(
|
||||
notification.setContentTitle(applicationContext.getString(R.string.error_occurred))
|
||||
.setContentText(error.getDisplayMessage(applicationContext.resources))
|
||||
.setSmallIcon(android.R.drawable.stat_notify_error)
|
||||
.addAction(
|
||||
R.drawable.ic_alert_outline,
|
||||
applicationContext.getString(R.string.report),
|
||||
ErrorReporterReceiver.getPendingIntent(applicationContext, error),
|
||||
)
|
||||
}
|
||||
return notification.build()
|
||||
}
|
||||
|
||||
@@ -183,7 +183,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), AppBarOwner, BottomNav
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean = when (item.itemId) {
|
||||
android.R.id.home -> if (isSearchOpened()) {
|
||||
super.onOptionsItemSelected(item)
|
||||
closeSearchCallback.handleOnBackPressed()
|
||||
true
|
||||
} else {
|
||||
viewBinding.searchView.requestFocus()
|
||||
true
|
||||
|
||||
@@ -52,6 +52,7 @@ import org.koitharu.kotatsu.core.util.ext.postDelayed
|
||||
import org.koitharu.kotatsu.core.util.ext.setValueRounded
|
||||
import org.koitharu.kotatsu.core.util.ext.zipWithPrevious
|
||||
import org.koitharu.kotatsu.databinding.ActivityReaderBinding
|
||||
import org.koitharu.kotatsu.details.ui.DetailsActivity
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaChapter
|
||||
import org.koitharu.kotatsu.reader.ui.config.ReaderConfigSheet
|
||||
@@ -147,6 +148,11 @@ class ReaderActivity :
|
||||
}
|
||||
}
|
||||
|
||||
override fun getParentActivityIntent(): Intent? {
|
||||
val manga = viewModel.manga?.toManga() ?: return null
|
||||
return DetailsActivity.newIntent(this, manga)
|
||||
}
|
||||
|
||||
override fun onUserInteraction() {
|
||||
super.onUserInteraction()
|
||||
scrollTimer.onUserInteraction()
|
||||
@@ -249,6 +255,7 @@ class ReaderActivity :
|
||||
|
||||
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
||||
touchHelper.dispatchTouchEvent(ev)
|
||||
scrollTimer.onTouchEvent(ev)
|
||||
return super.dispatchTouchEvent(ev)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.koitharu.kotatsu.reader.ui
|
||||
|
||||
import android.view.MotionEvent
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import dagger.assisted.Assisted
|
||||
@@ -8,11 +9,14 @@ import dagger.assisted.AssistedInject
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.isActive
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.yield
|
||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||
import org.koitharu.kotatsu.core.prefs.observeAsFlow
|
||||
import kotlin.math.roundToLong
|
||||
@@ -33,6 +37,7 @@ class ScrollTimer @AssistedInject constructor(
|
||||
private var delayMs: Long = 10L
|
||||
private var pageSwitchDelay: Long = 100L
|
||||
private var resumeAt = 0L
|
||||
private var isTouchDown = MutableStateFlow(false)
|
||||
|
||||
var isEnabled: Boolean = false
|
||||
set(value) {
|
||||
@@ -55,6 +60,19 @@ class ScrollTimer @AssistedInject constructor(
|
||||
resumeAt = System.currentTimeMillis() + INTERACTION_SKIP_MS
|
||||
}
|
||||
|
||||
fun onTouchEvent(event: MotionEvent) {
|
||||
when (event.actionMasked) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
isTouchDown.value = true
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_UP,
|
||||
MotionEvent.ACTION_CANCEL -> {
|
||||
isTouchDown.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun onSpeedChanged(speed: Float) {
|
||||
if (speed <= 0f) {
|
||||
delayMs = 0L
|
||||
@@ -108,12 +126,18 @@ class ScrollTimer @AssistedInject constructor(
|
||||
}
|
||||
|
||||
private fun isPaused(): Boolean {
|
||||
return resumeAt > System.currentTimeMillis()
|
||||
return isTouchDown.value || resumeAt > System.currentTimeMillis()
|
||||
}
|
||||
|
||||
private suspend fun delayUntilResumed() {
|
||||
while (isPaused()) {
|
||||
delay(resumeAt - System.currentTimeMillis())
|
||||
val delayTime = resumeAt - System.currentTimeMillis()
|
||||
if (delayTime > 0) {
|
||||
delay(delayTime)
|
||||
} else {
|
||||
yield()
|
||||
}
|
||||
isTouchDown.first { !it }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ class ReaderConfigSheet :
|
||||
when (buttonView.id) {
|
||||
R.id.switch_scroll_timer -> {
|
||||
findCallback()?.isAutoScrollEnabled = isChecked
|
||||
requireViewBinding().labelTimer.isVisible = isChecked
|
||||
requireViewBinding().layoutTimer.isVisible = isChecked
|
||||
requireViewBinding().sliderTimer.isVisible = isChecked
|
||||
}
|
||||
}
|
||||
@@ -159,6 +159,7 @@ class ReaderConfigSheet :
|
||||
if (fromUser) {
|
||||
settings.readerAutoscrollSpeed = value
|
||||
}
|
||||
(viewBinding ?: return).labelTimerValue.text = getString(R.string.speed_value, value * 10f)
|
||||
}
|
||||
|
||||
override fun onActivityResult(result: Uri?) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import kotlinx.coroutines.flow.SharingStarted
|
||||
import kotlinx.coroutines.flow.catch
|
||||
import kotlinx.coroutines.flow.combine
|
||||
import kotlinx.coroutines.flow.debounce
|
||||
import kotlinx.coroutines.flow.getAndUpdate
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
@@ -95,7 +96,6 @@ open class RemoteListViewModel @Inject constructor(
|
||||
.onEach { filterState ->
|
||||
loadingJob?.cancelAndJoin()
|
||||
mangaList.value = null
|
||||
hasNextPage.value = false
|
||||
loadList(filterState, false)
|
||||
}.catch { error ->
|
||||
listError.value = error
|
||||
@@ -134,12 +134,18 @@ open class RemoteListViewModel @Inject constructor(
|
||||
sortOrder = filterState.sortOrder,
|
||||
tags = filterState.tags,
|
||||
)
|
||||
if (!append) {
|
||||
mangaList.value = list
|
||||
} else if (list.isNotEmpty()) {
|
||||
mangaList.value = mangaList.value?.plus(list) ?: list
|
||||
val oldList = mangaList.getAndUpdate { oldList ->
|
||||
if (!append || oldList.isNullOrEmpty()) {
|
||||
list
|
||||
} else {
|
||||
oldList + list
|
||||
}
|
||||
}.orEmpty()
|
||||
hasNextPage.value = if (append) {
|
||||
list.isNotEmpty()
|
||||
} else {
|
||||
list.size > oldList.size || hasNextPage.value
|
||||
}
|
||||
hasNextPage.value = list.isNotEmpty() // TODO check if new ids added
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
} catch (e: Throwable) {
|
||||
@@ -148,6 +154,7 @@ open class RemoteListViewModel @Inject constructor(
|
||||
if (!mangaList.value.isNullOrEmpty()) {
|
||||
errorEvent.call(e)
|
||||
}
|
||||
hasNextPage.value = false
|
||||
}
|
||||
}.also { loadingJob = it }
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class AniListRepository @Inject constructor(
|
||||
}
|
||||
|
||||
override suspend fun unregister(mangaId: Long) {
|
||||
return db.scrobblingDao.delete(ScrobblerService.ANILIST.id, mangaId)
|
||||
return db.getScrobblingDao().delete(ScrobblerService.ANILIST.id, mangaId)
|
||||
}
|
||||
|
||||
override fun logout() {
|
||||
@@ -223,7 +223,7 @@ class AniListRepository @Inject constructor(
|
||||
comment = json.getString("notes"),
|
||||
rating = scoreFormat.normalize(json.getDouble("score").toFloat()),
|
||||
)
|
||||
db.scrobblingDao.upsert(entity)
|
||||
db.getScrobblingDao().upsert(entity)
|
||||
}
|
||||
|
||||
private fun ScrobblerManga(json: JSONObject): ScrobblerManga {
|
||||
|
||||
@@ -29,7 +29,7 @@ class AniListScrobbler @Inject constructor(
|
||||
status: ScrobblingStatus?,
|
||||
comment: String?,
|
||||
) {
|
||||
val entity = db.scrobblingDao.find(scrobblerService.id, mangaId)
|
||||
val entity = db.getScrobblingDao().find(scrobblerService.id, mangaId)
|
||||
requireNotNull(entity) { "Scrobbling info for manga $mangaId not found" }
|
||||
repository.updateRate(
|
||||
rateId = entity.id,
|
||||
|
||||
@@ -67,24 +67,24 @@ abstract class Scrobbler(
|
||||
}
|
||||
|
||||
suspend fun scrobble(mangaId: Long, chapter: MangaChapter) {
|
||||
val entity = db.scrobblingDao.find(scrobblerService.id, mangaId) ?: return
|
||||
val entity = db.getScrobblingDao().find(scrobblerService.id, mangaId) ?: return
|
||||
repository.updateRate(entity.id, entity.mangaId, chapter)
|
||||
}
|
||||
|
||||
suspend fun getScrobblingInfoOrNull(mangaId: Long): ScrobblingInfo? {
|
||||
val entity = db.scrobblingDao.find(scrobblerService.id, mangaId) ?: return null
|
||||
val entity = db.getScrobblingDao().find(scrobblerService.id, mangaId) ?: return null
|
||||
return entity.toScrobblingInfo()
|
||||
}
|
||||
|
||||
abstract suspend fun updateScrobblingInfo(mangaId: Long, rating: Float, status: ScrobblingStatus?, comment: String?)
|
||||
|
||||
fun observeScrobblingInfo(mangaId: Long): Flow<ScrobblingInfo?> {
|
||||
return db.scrobblingDao.observe(scrobblerService.id, mangaId)
|
||||
return db.getScrobblingDao().observe(scrobblerService.id, mangaId)
|
||||
.map { it?.toScrobblingInfo() }
|
||||
}
|
||||
|
||||
fun observeAllScrobblingInfo(): Flow<List<ScrobblingInfo>> {
|
||||
return db.scrobblingDao.observe(scrobblerService.id)
|
||||
return db.getScrobblingDao().observe(scrobblerService.id)
|
||||
.map { entities ->
|
||||
coroutineScope {
|
||||
entities.map {
|
||||
|
||||
@@ -10,6 +10,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.SharingStarted
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.combine
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.stateIn
|
||||
import kotlinx.coroutines.plus
|
||||
import org.koitharu.kotatsu.R
|
||||
@@ -18,6 +19,7 @@ import org.koitharu.kotatsu.core.parser.MangaIntent
|
||||
import org.koitharu.kotatsu.core.ui.BaseViewModel
|
||||
import org.koitharu.kotatsu.core.util.ext.MutableEventFlow
|
||||
import org.koitharu.kotatsu.core.util.ext.call
|
||||
import org.koitharu.kotatsu.core.util.ext.printStackTraceDebug
|
||||
import org.koitharu.kotatsu.core.util.ext.require
|
||||
import org.koitharu.kotatsu.core.util.ext.requireValue
|
||||
import org.koitharu.kotatsu.list.ui.model.ListModel
|
||||
@@ -27,7 +29,6 @@ import org.koitharu.kotatsu.parsers.util.runCatchingCancellable
|
||||
import org.koitharu.kotatsu.scrobbling.common.domain.Scrobbler
|
||||
import org.koitharu.kotatsu.scrobbling.common.domain.model.ScrobblerManga
|
||||
import org.koitharu.kotatsu.scrobbling.common.ui.selector.model.ScrobblerHint
|
||||
import org.koitharu.kotatsu.core.util.ext.printStackTraceDebug
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
@@ -53,7 +54,7 @@ class ScrobblingSelectorViewModel @Inject constructor(
|
||||
get() = availableScrobblers[selectedScrobblerIndex.requireValue()]
|
||||
|
||||
val content: StateFlow<List<ListModel>> = combine(
|
||||
scrobblerMangaList,
|
||||
scrobblerMangaList.map { it.distinctBy { x -> x.id } },
|
||||
listError,
|
||||
hasNextPage,
|
||||
) { list, error, isHasNextPage ->
|
||||
|
||||
@@ -85,7 +85,7 @@ class MALRepository @Inject constructor(
|
||||
}
|
||||
|
||||
override suspend fun unregister(mangaId: Long) {
|
||||
return db.scrobblingDao.delete(ScrobblerService.MAL.id, mangaId)
|
||||
return db.getScrobblingDao().delete(ScrobblerService.MAL.id, mangaId)
|
||||
}
|
||||
|
||||
override suspend fun findManga(query: String, offset: Int): List<ScrobblerManga> {
|
||||
@@ -98,6 +98,7 @@ class MALRepository @Inject constructor(
|
||||
.build()
|
||||
val request = Request.Builder().url(url).get().build()
|
||||
val response = okHttp.newCall(request).await().parseJson()
|
||||
check(response.has("data")) { "Invalid response: \"$response\"" }
|
||||
val data = response.getJSONArray("data")
|
||||
return data.mapJSONNotNull { jsonToManga(it) }
|
||||
}
|
||||
@@ -175,7 +176,7 @@ class MALRepository @Inject constructor(
|
||||
comment = json.getString("comments"),
|
||||
rating = (json.getDouble("score").toFloat() / 10f).coerceIn(0f, 1f),
|
||||
)
|
||||
db.scrobblingDao.upsert(entity)
|
||||
db.getScrobblingDao().upsert(entity)
|
||||
}
|
||||
|
||||
override fun logout() {
|
||||
|
||||
@@ -30,7 +30,7 @@ class MALScrobbler @Inject constructor(
|
||||
status: ScrobblingStatus?,
|
||||
comment: String?,
|
||||
) {
|
||||
val entity = db.scrobblingDao.find(scrobblerService.id, mangaId)
|
||||
val entity = db.getScrobblingDao().find(scrobblerService.id, mangaId)
|
||||
requireNotNull(entity) { "Scrobbling info for manga $mangaId not found" }
|
||||
repository.updateRate(
|
||||
rateId = entity.id,
|
||||
|
||||
@@ -84,7 +84,7 @@ class ShikimoriRepository @Inject constructor(
|
||||
}
|
||||
|
||||
override suspend fun unregister(mangaId: Long) {
|
||||
return db.scrobblingDao.delete(ScrobblerService.SHIKIMORI.id, mangaId)
|
||||
return db.getScrobblingDao().delete(ScrobblerService.SHIKIMORI.id, mangaId)
|
||||
}
|
||||
|
||||
override fun logout() {
|
||||
@@ -192,7 +192,7 @@ class ShikimoriRepository @Inject constructor(
|
||||
comment = json.getString("text"),
|
||||
rating = (json.getDouble("score").toFloat() / 10f).coerceIn(0f, 1f),
|
||||
)
|
||||
db.scrobblingDao.upsert(entity)
|
||||
db.getScrobblingDao().upsert(entity)
|
||||
}
|
||||
|
||||
private fun ScrobblerManga(json: JSONObject) = ScrobblerManga(
|
||||
|
||||
@@ -31,7 +31,7 @@ class ShikimoriScrobbler @Inject constructor(
|
||||
status: ScrobblingStatus?,
|
||||
comment: String?,
|
||||
) {
|
||||
val entity = db.scrobblingDao.find(scrobblerService.id, mangaId)
|
||||
val entity = db.getScrobblingDao().find(scrobblerService.id, mangaId)
|
||||
requireNotNull(entity) { "Scrobbling info for manga $mangaId not found" }
|
||||
repository.updateRate(
|
||||
rateId = entity.id,
|
||||
|
||||
@@ -40,9 +40,9 @@ class MangaSearchRepository @Inject constructor(
|
||||
}
|
||||
val skipNsfw = settings.isNsfwContentDisabled
|
||||
return if (source != null) {
|
||||
db.mangaDao.searchByTitle("%$query%", source.name, limit)
|
||||
db.getMangaDao().searchByTitle("%$query%", source.name, limit)
|
||||
} else {
|
||||
db.mangaDao.searchByTitle("%$query%", limit)
|
||||
db.getMangaDao().searchByTitle("%$query%", limit)
|
||||
}.let {
|
||||
if (skipNsfw) it.filterNot { x -> x.manga.isNsfw } else it
|
||||
}
|
||||
@@ -83,7 +83,7 @@ class MangaSearchRepository @Inject constructor(
|
||||
if (query.isEmpty()) {
|
||||
return emptyList()
|
||||
}
|
||||
val titles = db.suggestionDao.getTitles("$query%")
|
||||
val titles = db.getSuggestionDao().getTitles("$query%")
|
||||
if (titles.isEmpty()) {
|
||||
return emptyList()
|
||||
}
|
||||
@@ -92,19 +92,20 @@ class MangaSearchRepository @Inject constructor(
|
||||
|
||||
suspend fun getTagsSuggestion(query: String, limit: Int, source: MangaSource?): List<MangaTag> {
|
||||
return when {
|
||||
query.isNotEmpty() && source != null -> db.tagsDao.findTags(source.name, "%$query%", limit)
|
||||
query.isNotEmpty() -> db.tagsDao.findTags("%$query%", limit)
|
||||
source != null -> db.tagsDao.findPopularTags(source.name, limit)
|
||||
else -> db.tagsDao.findPopularTags(limit)
|
||||
query.isNotEmpty() && source != null -> db.getTagsDao()
|
||||
.findTags(source.name, "%$query%", limit)
|
||||
query.isNotEmpty() -> db.getTagsDao().findTags("%$query%", limit)
|
||||
source != null -> db.getTagsDao().findPopularTags(source.name, limit)
|
||||
else -> db.getTagsDao().findPopularTags(limit)
|
||||
}.toMangaTagsList()
|
||||
}
|
||||
|
||||
suspend fun getTagsSuggestion(tags: Set<MangaTag>): List<MangaTag> {
|
||||
val ids = tags.mapToSet { it.toEntity().id }
|
||||
return if (ids.size == 1) {
|
||||
db.tagsDao.findRelatedTags(ids.first())
|
||||
db.getTagsDao().findRelatedTags(ids.first())
|
||||
} else {
|
||||
db.tagsDao.findRelatedTags(ids)
|
||||
db.getTagsDao().findRelatedTags(ids)
|
||||
}.mapNotNull { x ->
|
||||
if (x.id in ids) null else x.toMangaTag()
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ fun searchSuggestionQueryHintAD(
|
||||
{ inflater, parent -> ItemSearchSuggestionQueryHintBinding.inflate(inflater, parent, false) },
|
||||
) {
|
||||
|
||||
val viewClickListener = View.OnClickListener { v ->
|
||||
val viewClickListener = View.OnClickListener { _ ->
|
||||
listener.onQueryClick(item.query, true)
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ class AppearanceSettingsFragment :
|
||||
|
||||
private val deviceLocales = LocaleManagerCompat.getSystemLocales(context)
|
||||
.map { it.language }
|
||||
.distinct()
|
||||
|
||||
override fun compare(a: Locale, b: Locale): Int {
|
||||
return if (a === b) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.koitharu.kotatsu.core.ui.AlertDialogFragment
|
||||
import org.koitharu.kotatsu.core.util.ext.getDisplayMessage
|
||||
import org.koitharu.kotatsu.core.util.ext.observe
|
||||
import org.koitharu.kotatsu.core.util.ext.observeEvent
|
||||
import org.koitharu.kotatsu.core.util.ext.tryLaunch
|
||||
import org.koitharu.kotatsu.databinding.DialogProgressBinding
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
@@ -28,7 +29,7 @@ class BackupDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
|
||||
|
||||
private var backup: File? = null
|
||||
private val saveFileContract = registerForActivityResult(
|
||||
ActivityResultContracts.CreateDocument("*/*"),
|
||||
ActivityResultContracts.CreateDocument("application/zip"),
|
||||
) { uri ->
|
||||
val file = backup
|
||||
if (uri != null && file != null) {
|
||||
@@ -81,7 +82,10 @@ class BackupDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
|
||||
|
||||
private fun onBackupDone(file: File) {
|
||||
this.backup = file
|
||||
saveFileContract.launch(file.name)
|
||||
if (!saveFileContract.tryLaunch(file.name)) {
|
||||
Toast.makeText(requireContext(), R.string.operation_not_supported, Toast.LENGTH_SHORT).show()
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
private fun saveBackup(file: File, output: Uri) {
|
||||
@@ -91,7 +95,7 @@ class BackupDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
|
||||
it.write(file.readBytes())
|
||||
}
|
||||
}
|
||||
Toast.makeText(requireContext(), R.string.backup_saved, Toast.LENGTH_LONG).show()
|
||||
Toast.makeText(requireContext(), R.string.backup_saved, Toast.LENGTH_SHORT).show()
|
||||
dismiss()
|
||||
} catch (e: InterruptedException) {
|
||||
throw e
|
||||
|
||||
@@ -43,7 +43,6 @@ class BackupViewModel @Inject constructor(
|
||||
|
||||
backup.finish()
|
||||
progress.value = 1f
|
||||
backup.close()
|
||||
backup.file
|
||||
}
|
||||
onBackupDone.call(file)
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package org.koitharu.kotatsu.settings.backup
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.activity.result.ActivityResultCallback
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.documentfile.provider.DocumentFile
|
||||
import androidx.preference.Preference
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.core.backup.DIR_BACKUPS
|
||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||
import org.koitharu.kotatsu.core.ui.BasePreferenceFragment
|
||||
import org.koitharu.kotatsu.core.util.ext.resolveFile
|
||||
import org.koitharu.kotatsu.core.util.ext.tryLaunch
|
||||
import org.koitharu.kotatsu.core.util.ext.viewLifecycleScope
|
||||
import java.io.File
|
||||
import java.text.SimpleDateFormat
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class PeriodicalBackupSettingsFragment : BasePreferenceFragment(R.string.periodic_backups),
|
||||
ActivityResultCallback<Uri?> {
|
||||
|
||||
@Inject
|
||||
lateinit var scheduler: PeriodicalBackupWorker.Scheduler
|
||||
|
||||
private val outputSelectCall = registerForActivityResult(
|
||||
ActivityResultContracts.OpenDocumentTree(),
|
||||
this,
|
||||
)
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
addPreferencesFromResource(R.xml.pref_backup_periodic)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
bindOutputSummary()
|
||||
bindLastBackupInfo()
|
||||
}
|
||||
|
||||
override fun onPreferenceTreeClick(preference: Preference): Boolean {
|
||||
return when (preference.key) {
|
||||
AppSettings.KEY_BACKUP_PERIODICAL_OUTPUT -> outputSelectCall.tryLaunch(null)
|
||||
else -> super.onPreferenceTreeClick(preference)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(result: Uri?) {
|
||||
if (result != null) {
|
||||
val takeFlags: Int = Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
|
||||
context?.contentResolver?.takePersistableUriPermission(result, takeFlags)
|
||||
settings.periodicalBackupOutput = result
|
||||
bindOutputSummary()
|
||||
}
|
||||
}
|
||||
|
||||
private fun bindOutputSummary() {
|
||||
val preference = findPreference<Preference>(AppSettings.KEY_BACKUP_PERIODICAL_OUTPUT) ?: return
|
||||
viewLifecycleScope.launch {
|
||||
preference.summary = withContext(Dispatchers.Default) {
|
||||
val value = settings.periodicalBackupOutput
|
||||
value?.toUserFriendlyString(preference.context) ?: preference.context.run {
|
||||
getExternalFilesDir(DIR_BACKUPS) ?: File(filesDir, DIR_BACKUPS)
|
||||
}.path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun bindLastBackupInfo() {
|
||||
val preference = findPreference<Preference>(AppSettings.KEY_BACKUP_PERIODICAL_LAST) ?: return
|
||||
viewLifecycleScope.launch {
|
||||
val lastDate = withContext(Dispatchers.Default) {
|
||||
scheduler.getLastSuccessfulBackup()
|
||||
}
|
||||
preference.summary = lastDate?.let {
|
||||
val format = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.MEDIUM, SimpleDateFormat.SHORT)
|
||||
preference.context.getString(R.string.last_successful_backup, format.format(it))
|
||||
}
|
||||
preference.isVisible = lastDate != null
|
||||
}
|
||||
}
|
||||
|
||||
private fun Uri.toUserFriendlyString(context: Context): String {
|
||||
val df = DocumentFile.fromTreeUri(context, this)
|
||||
if (df?.canWrite() != true) {
|
||||
return context.getString(R.string.invalid_value_message)
|
||||
}
|
||||
return resolveFile(context)?.path ?: toString()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package org.koitharu.kotatsu.settings.backup
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import androidx.documentfile.provider.DocumentFile
|
||||
import androidx.hilt.work.HiltWorker
|
||||
import androidx.work.Constraints
|
||||
import androidx.work.CoroutineWorker
|
||||
import androidx.work.ExistingPeriodicWorkPolicy
|
||||
import androidx.work.PeriodicWorkRequestBuilder
|
||||
import androidx.work.WorkInfo
|
||||
import androidx.work.WorkManager
|
||||
import androidx.work.WorkerParameters
|
||||
import androidx.work.await
|
||||
import androidx.work.workDataOf
|
||||
import dagger.Reusable
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedInject
|
||||
import org.koitharu.kotatsu.core.backup.BackupRepository
|
||||
import org.koitharu.kotatsu.core.backup.BackupZipOutput
|
||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||
import org.koitharu.kotatsu.core.util.ext.awaitUniqueWorkInfoByName
|
||||
import org.koitharu.kotatsu.core.util.ext.deleteAwait
|
||||
import org.koitharu.kotatsu.settings.work.PeriodicWorkScheduler
|
||||
import java.util.Date
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltWorker
|
||||
class PeriodicalBackupWorker @AssistedInject constructor(
|
||||
@Assisted appContext: Context,
|
||||
@Assisted params: WorkerParameters,
|
||||
private val repository: BackupRepository,
|
||||
private val settings: AppSettings,
|
||||
) : CoroutineWorker(appContext, params) {
|
||||
|
||||
override suspend fun doWork(): Result {
|
||||
val resultData = workDataOf(DATA_TIMESTAMP to Date().time)
|
||||
val file = BackupZipOutput(applicationContext).use { backup ->
|
||||
backup.put(repository.createIndex())
|
||||
backup.put(repository.dumpHistory())
|
||||
backup.put(repository.dumpCategories())
|
||||
backup.put(repository.dumpFavourites())
|
||||
backup.put(repository.dumpBookmarks())
|
||||
backup.put(repository.dumpSettings())
|
||||
backup.finish()
|
||||
backup.file
|
||||
}
|
||||
val dirUri = settings.periodicalBackupOutput ?: return Result.success(resultData)
|
||||
val target = DocumentFile.fromTreeUri(applicationContext, dirUri)
|
||||
?.createFile("application/zip", file.nameWithoutExtension)
|
||||
?.uri ?: return Result.failure()
|
||||
applicationContext.contentResolver.openOutputStream(target, "wt")?.use { output ->
|
||||
file.inputStream().copyTo(output)
|
||||
} ?: return Result.failure()
|
||||
file.deleteAwait()
|
||||
return Result.success(resultData)
|
||||
}
|
||||
|
||||
@Reusable
|
||||
class Scheduler @Inject constructor(
|
||||
private val workManager: WorkManager,
|
||||
private val settings: AppSettings,
|
||||
) : PeriodicWorkScheduler {
|
||||
|
||||
override suspend fun schedule() {
|
||||
val constraints = Constraints.Builder()
|
||||
.setRequiresStorageNotLow(true)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
constraints.setRequiresDeviceIdle(true)
|
||||
}
|
||||
val request = PeriodicWorkRequestBuilder<PeriodicalBackupWorker>(
|
||||
settings.periodicalBackupFrequency,
|
||||
TimeUnit.DAYS,
|
||||
).setConstraints(constraints.build())
|
||||
.keepResultsForAtLeast(20, TimeUnit.DAYS)
|
||||
.addTag(TAG)
|
||||
.build()
|
||||
workManager
|
||||
.enqueueUniquePeriodicWork(TAG, ExistingPeriodicWorkPolicy.UPDATE, request)
|
||||
.await()
|
||||
}
|
||||
|
||||
override suspend fun unschedule() {
|
||||
workManager
|
||||
.cancelUniqueWork(TAG)
|
||||
.await()
|
||||
}
|
||||
|
||||
override suspend fun isScheduled(): Boolean {
|
||||
return workManager
|
||||
.awaitUniqueWorkInfoByName(TAG)
|
||||
.any { !it.state.isFinished }
|
||||
}
|
||||
|
||||
suspend fun getLastSuccessfulBackup(): Date? {
|
||||
return workManager
|
||||
.awaitUniqueWorkInfoByName(TAG)
|
||||
.lastOrNull { x -> x.state == WorkInfo.State.SUCCEEDED }
|
||||
?.outputData
|
||||
?.getLong(DATA_TIMESTAMP, 0)
|
||||
?.let { if (it != 0L) Date(it) else null }
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
|
||||
const val TAG = "backups"
|
||||
const val DATA_TIMESTAMP = "ts"
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,7 @@ class UserDataSettingsFragment : BasePreferenceFragment(R.string.data_and_privac
|
||||
findPreference<Preference>(AppSettings.KEY_PAGES_CACHE_CLEAR)?.bindBytesSizeSummary(checkNotNull(viewModel.cacheSizes[CacheDir.PAGES]))
|
||||
findPreference<Preference>(AppSettings.KEY_THUMBS_CACHE_CLEAR)?.bindBytesSizeSummary(checkNotNull(viewModel.cacheSizes[CacheDir.THUMBS]))
|
||||
findPreference<Preference>(AppSettings.KEY_HTTP_CACHE_CLEAR)?.bindBytesSizeSummary(viewModel.httpCacheSize)
|
||||
bindPeriodicalBackupSummary()
|
||||
findPreference<Preference>(AppSettings.KEY_SEARCH_HISTORY_CLEAR)?.let { pref ->
|
||||
viewModel.searchHistoryCount.observe(viewLifecycleOwner) {
|
||||
pref.summary = if (it < 0) {
|
||||
@@ -200,6 +201,20 @@ class UserDataSettingsFragment : BasePreferenceFragment(R.string.data_and_privac
|
||||
}
|
||||
}
|
||||
|
||||
private fun bindPeriodicalBackupSummary() {
|
||||
val preference = findPreference<Preference>(AppSettings.KEY_BACKUP_PERIODICAL_ENABLED) ?: return
|
||||
val entries = resources.getStringArray(R.array.backup_frequency)
|
||||
val entryValues = resources.getStringArray(R.array.values_backup_frequency)
|
||||
viewModel.periodicalBackupFrequency.observe(viewLifecycleOwner) { freq ->
|
||||
preference.summary = if (freq == 0L) {
|
||||
getString(R.string.disabled)
|
||||
} else {
|
||||
val index = entryValues.indexOf(freq.toString())
|
||||
entries.getOrNull(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun clearSearchHistory() {
|
||||
MaterialAlertDialogBuilder(context ?: return)
|
||||
.setTitle(R.string.clear_search_history)
|
||||
|
||||
@@ -5,12 +5,15 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.cancelAndJoin
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.flatMapLatest
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.runInterruptible
|
||||
import okhttp3.Cache
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.core.network.cookies.MutableCookieJar
|
||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||
import org.koitharu.kotatsu.core.prefs.observeAsFlow
|
||||
import org.koitharu.kotatsu.core.ui.BaseViewModel
|
||||
import org.koitharu.kotatsu.core.ui.util.ReversibleAction
|
||||
import org.koitharu.kotatsu.core.util.ext.MutableEventFlow
|
||||
@@ -29,6 +32,7 @@ class UserDataSettingsViewModel @Inject constructor(
|
||||
private val searchRepository: MangaSearchRepository,
|
||||
private val trackingRepository: TrackingRepository,
|
||||
private val cookieJar: MutableCookieJar,
|
||||
private val settings: AppSettings,
|
||||
) : BaseViewModel() {
|
||||
|
||||
val onActionDone = MutableEventFlow<ReversibleAction>()
|
||||
@@ -40,6 +44,20 @@ class UserDataSettingsViewModel @Inject constructor(
|
||||
val cacheSizes = EnumMap<CacheDir, MutableStateFlow<Long>>(CacheDir::class.java)
|
||||
val storageUsage = MutableStateFlow<StorageUsage?>(null)
|
||||
|
||||
val periodicalBackupFrequency = settings.observeAsFlow(
|
||||
key = AppSettings.KEY_BACKUP_PERIODICAL_ENABLED,
|
||||
valueProducer = { isPeriodicalBackupEnabled },
|
||||
).flatMapLatest { isEnabled ->
|
||||
if (isEnabled) {
|
||||
settings.observeAsFlow(
|
||||
key = AppSettings.KEY_BACKUP_PERIODICAL_FREQUENCY,
|
||||
valueProducer = { periodicalBackupFrequency },
|
||||
)
|
||||
} else {
|
||||
flowOf(0)
|
||||
}
|
||||
}
|
||||
|
||||
private var storageUsageJob: Job? = null
|
||||
|
||||
init {
|
||||
|
||||
@@ -11,7 +11,7 @@ class TagsAutoCompleteProvider @Inject constructor(
|
||||
if (query.isEmpty()) {
|
||||
return emptyList()
|
||||
}
|
||||
val tags = db.tagsDao.findTags(query = "$query%", limit = 6)
|
||||
val tags = db.getTagsDao().findTags(query = "$query%", limit = 6)
|
||||
val set = HashSet<String>()
|
||||
val result = ArrayList<String>(tags.size)
|
||||
for (tag in tags) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||
import org.koitharu.kotatsu.core.util.ext.processLifecycleScope
|
||||
import org.koitharu.kotatsu.settings.backup.PeriodicalBackupWorker
|
||||
import org.koitharu.kotatsu.suggestions.ui.SuggestionsWorker
|
||||
import org.koitharu.kotatsu.tracker.work.TrackWorker
|
||||
import javax.inject.Inject
|
||||
@@ -13,6 +14,7 @@ class WorkScheduleManager @Inject constructor(
|
||||
private val settings: AppSettings,
|
||||
private val suggestionScheduler: SuggestionsWorker.Scheduler,
|
||||
private val trackerScheduler: TrackWorker.Scheduler,
|
||||
private val periodicalBackupScheduler: PeriodicalBackupWorker.Scheduler,
|
||||
) : SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
|
||||
@@ -30,6 +32,13 @@ class WorkScheduleManager @Inject constructor(
|
||||
isEnabled = settings.isSuggestionsEnabled,
|
||||
force = key != AppSettings.KEY_SUGGESTIONS,
|
||||
)
|
||||
|
||||
AppSettings.KEY_BACKUP_PERIODICAL_ENABLED,
|
||||
AppSettings.KEY_BACKUP_PERIODICAL_FREQUENCY -> updateWorker(
|
||||
scheduler = periodicalBackupScheduler,
|
||||
isEnabled = settings.isPeriodicalBackupEnabled,
|
||||
force = key != AppSettings.KEY_BACKUP_PERIODICAL_ENABLED,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +47,7 @@ class WorkScheduleManager @Inject constructor(
|
||||
processLifecycleScope.launch(Dispatchers.Default) {
|
||||
updateWorkerImpl(trackerScheduler, settings.isTrackerEnabled, false)
|
||||
updateWorkerImpl(suggestionScheduler, settings.isSuggestionsEnabled, false)
|
||||
updateWorkerImpl(periodicalBackupScheduler, settings.isPeriodicalBackupEnabled, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,39 +17,39 @@ class SuggestionRepository @Inject constructor(
|
||||
) {
|
||||
|
||||
fun observeAll(): Flow<List<Manga>> {
|
||||
return db.suggestionDao.observeAll().mapItems {
|
||||
return db.getSuggestionDao().observeAll().mapItems {
|
||||
it.manga.toManga(it.tags.toMangaTags())
|
||||
}
|
||||
}
|
||||
|
||||
fun observeAll(limit: Int): Flow<List<Manga>> {
|
||||
return db.suggestionDao.observeAll(limit).mapItems {
|
||||
return db.getSuggestionDao().observeAll(limit).mapItems {
|
||||
it.manga.toManga(it.tags.toMangaTags())
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getRandom(): Manga? {
|
||||
return db.suggestionDao.getRandom()?.let {
|
||||
return db.getSuggestionDao().getRandom()?.let {
|
||||
it.manga.toManga(it.tags.toMangaTags())
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun clear() {
|
||||
db.suggestionDao.deleteAll()
|
||||
db.getSuggestionDao().deleteAll()
|
||||
}
|
||||
|
||||
suspend fun isEmpty(): Boolean {
|
||||
return db.suggestionDao.count() == 0
|
||||
return db.getSuggestionDao().count() == 0
|
||||
}
|
||||
|
||||
suspend fun replace(suggestions: Iterable<MangaSuggestion>) {
|
||||
db.withTransaction {
|
||||
db.suggestionDao.deleteAll()
|
||||
db.getSuggestionDao().deleteAll()
|
||||
suggestions.forEach { (manga, relevance) ->
|
||||
val tags = manga.tags.toEntities()
|
||||
db.tagsDao.upsert(tags)
|
||||
db.mangaDao.upsert(manga.toEntity(), tags)
|
||||
db.suggestionDao.upsert(
|
||||
db.getTagsDao().upsert(tags)
|
||||
db.getMangaDao().upsert(manga.toEntity(), tags)
|
||||
db.getSuggestionDao().upsert(
|
||||
SuggestionEntity(
|
||||
mangaId = manga.id,
|
||||
relevance = relevance,
|
||||
|
||||
@@ -29,8 +29,7 @@ class SuggestionsActivity :
|
||||
if (fm.findFragmentById(R.id.container) == null) {
|
||||
fm.commit {
|
||||
setReorderingAllowed(true)
|
||||
val fragment = SuggestionsFragment.newInstance()
|
||||
replace(R.id.container, fragment)
|
||||
replace(R.id.container, SuggestionsFragment::class.java, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,11 +120,11 @@ class SyncController @Inject constructor(
|
||||
private suspend fun MangaDatabase.gc(favourites: Boolean, history: Boolean) = withTransaction {
|
||||
val deletedAt = System.currentTimeMillis() - defaultGcPeriod
|
||||
if (history) {
|
||||
historyDao.gc(deletedAt)
|
||||
getHistoryDao().gc(deletedAt)
|
||||
}
|
||||
if (favourites) {
|
||||
favouritesDao.gc(deletedAt)
|
||||
favouriteCategoriesDao.gc(deletedAt)
|
||||
getFavouritesDao().gc(deletedAt)
|
||||
getFavouriteCategoriesDao().gc(deletedAt)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,9 +130,6 @@ class SyncHelper @AssistedInject constructor(
|
||||
private fun upsertHistory(json: JSONArray, timestamp: Long): Array<ContentProviderResult> {
|
||||
val uri = uri(authorityHistory, TABLE_HISTORY)
|
||||
val operations = ArrayList<ContentProviderOperation>()
|
||||
operations += ContentProviderOperation.newDelete(uri)
|
||||
.withSelection("updated_at < ?", arrayOf(timestamp.toString()))
|
||||
.build()
|
||||
json.mapJSONTo(operations) { jo ->
|
||||
operations.addAll(upsertManga(jo.removeJSONObject("manga"), authorityHistory))
|
||||
ContentProviderOperation.newInsert(uri)
|
||||
@@ -145,9 +142,6 @@ class SyncHelper @AssistedInject constructor(
|
||||
private fun upsertFavouriteCategories(json: JSONArray, timestamp: Long): Array<ContentProviderResult> {
|
||||
val uri = uri(authorityFavourites, TABLE_FAVOURITE_CATEGORIES)
|
||||
val operations = ArrayList<ContentProviderOperation>()
|
||||
operations += ContentProviderOperation.newDelete(uri)
|
||||
.withSelection("created_at < ?", arrayOf(timestamp.toString()))
|
||||
.build()
|
||||
json.mapJSONTo(operations) { jo ->
|
||||
ContentProviderOperation.newInsert(uri)
|
||||
.withValues(jo.toContentValues())
|
||||
@@ -159,9 +153,6 @@ class SyncHelper @AssistedInject constructor(
|
||||
private fun upsertFavourites(json: JSONArray, timestamp: Long): Array<ContentProviderResult> {
|
||||
val uri = uri(authorityFavourites, TABLE_FAVOURITES)
|
||||
val operations = ArrayList<ContentProviderOperation>()
|
||||
operations += ContentProviderOperation.newDelete(uri)
|
||||
.withSelection("created_at < ?", arrayOf(timestamp.toString()))
|
||||
.build()
|
||||
json.mapJSONTo(operations) { jo ->
|
||||
operations.addAll(upsertManga(jo.removeJSONObject("manga"), authorityFavourites))
|
||||
ContentProviderOperation.newInsert(uri)
|
||||
|
||||
@@ -20,11 +20,11 @@ import org.koitharu.kotatsu.core.db.entity.MangaEntity
|
||||
class TrackEntity(
|
||||
@PrimaryKey(autoGenerate = false)
|
||||
@ColumnInfo(name = "manga_id") val mangaId: Long,
|
||||
@get:Deprecated(message = "Should not be used", level = DeprecationLevel.ERROR)
|
||||
@get:Deprecated(message = "Should not be used", level = DeprecationLevel.WARNING)
|
||||
@ColumnInfo(name = "chapters_total") val totalChapters: Int,
|
||||
@ColumnInfo(name = "last_chapter_id") val lastChapterId: Long,
|
||||
@ColumnInfo(name = "chapters_new") val newChapters: Int,
|
||||
@ColumnInfo(name = "last_check") val lastCheck: Long,
|
||||
@get:Deprecated(message = "Should not be used", level = DeprecationLevel.ERROR)
|
||||
@get:Deprecated(message = "Should not be used", level = DeprecationLevel.WARNING)
|
||||
@ColumnInfo(name = "last_notified_id") val lastNotifiedChapterId: Long
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.koitharu.kotatsu.tracker.data
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.MapInfo
|
||||
import androidx.room.MapColumn
|
||||
import androidx.room.Query
|
||||
import androidx.room.Transaction
|
||||
import androidx.room.Upsert
|
||||
@@ -23,9 +23,8 @@ abstract class TracksDao {
|
||||
@Query("SELECT chapters_new FROM tracks WHERE manga_id = :mangaId")
|
||||
abstract suspend fun findNewChapters(mangaId: Long): Int?
|
||||
|
||||
@MapInfo(keyColumn = "manga_id", valueColumn = "chapters_new")
|
||||
@Query("SELECT manga_id, chapters_new FROM tracks")
|
||||
abstract fun observeNewChaptersMap(): Flow<Map<Long, Int>>
|
||||
abstract fun observeNewChaptersMap(): Flow<Map<@MapColumn(columnName = "manga_id") Long, @MapColumn(columnName = "chapters_new") Int>>
|
||||
|
||||
@Query("SELECT chapters_new FROM tracks")
|
||||
abstract fun observeNewChapters(): Flow<List<Int>>
|
||||
|
||||
@@ -41,23 +41,23 @@ class TrackingRepository @Inject constructor(
|
||||
private var isGcCalled = AtomicBoolean(false)
|
||||
|
||||
suspend fun getNewChaptersCount(mangaId: Long): Int {
|
||||
return db.tracksDao.findNewChapters(mangaId) ?: 0
|
||||
return db.getTracksDao().findNewChapters(mangaId) ?: 0
|
||||
}
|
||||
|
||||
fun observeNewChaptersCount(mangaId: Long): Flow<Int> {
|
||||
return db.tracksDao.observeNewChapters(mangaId).map { it ?: 0 }
|
||||
return db.getTracksDao().observeNewChapters(mangaId).map { it ?: 0 }
|
||||
}
|
||||
|
||||
fun observeUpdatedMangaCount(): Flow<Int> {
|
||||
return db.tracksDao.observeNewChapters().map { list -> list.count { it > 0 } }
|
||||
return db.getTracksDao().observeNewChapters().map { list -> list.count { it > 0 } }
|
||||
.onStart { gcIfNotCalled() }
|
||||
}
|
||||
|
||||
fun observeUpdatedManga(limit: Int = 0): Flow<List<Manga>> {
|
||||
return if (limit == 0) {
|
||||
db.tracksDao.observeUpdatedManga()
|
||||
db.getTracksDao().observeUpdatedManga()
|
||||
} else {
|
||||
db.tracksDao.observeUpdatedManga(limit)
|
||||
db.getTracksDao().observeUpdatedManga(limit)
|
||||
}.mapItems { it.toManga() }
|
||||
.distinctUntilChanged()
|
||||
.onStart { gcIfNotCalled() }
|
||||
@@ -65,7 +65,7 @@ class TrackingRepository @Inject constructor(
|
||||
|
||||
suspend fun getTracks(mangaList: Collection<Manga>): List<MangaTracking> {
|
||||
val ids = mangaList.mapToSet { it.id }
|
||||
val tracks = db.tracksDao.findAll(ids).groupBy { it.mangaId }
|
||||
val tracks = db.getTracksDao().findAll(ids).groupBy { it.mangaId }
|
||||
val idSet = HashSet<Long>()
|
||||
val result = ArrayList<MangaTracking>(mangaList.size)
|
||||
for (item in mangaList) {
|
||||
@@ -89,7 +89,7 @@ class TrackingRepository @Inject constructor(
|
||||
|
||||
@VisibleForTesting
|
||||
suspend fun getTrack(manga: Manga): MangaTracking {
|
||||
val track = db.tracksDao.find(manga.id)
|
||||
val track = db.getTracksDao().find(manga.id)
|
||||
return MangaTracking(
|
||||
manga = manga,
|
||||
lastChapterId = track?.lastChapterId ?: NO_ID,
|
||||
@@ -99,14 +99,14 @@ class TrackingRepository @Inject constructor(
|
||||
|
||||
@VisibleForTesting
|
||||
suspend fun deleteTrack(mangaId: Long) {
|
||||
db.tracksDao.delete(mangaId)
|
||||
db.getTracksDao().delete(mangaId)
|
||||
}
|
||||
|
||||
fun observeTrackingLog(limit: Flow<Int>): Flow<List<TrackingLogItem>> {
|
||||
return limit.flatMapLatest { limitValue ->
|
||||
combine(
|
||||
db.tracksDao.observeNewChaptersMap(),
|
||||
db.trackLogsDao.observeAll(limitValue),
|
||||
db.getTracksDao().observeNewChaptersMap(),
|
||||
db.getTrackLogsDao().observeAll(limitValue),
|
||||
) { counters, entities ->
|
||||
val countersMap = counters.toMutableMap()
|
||||
entities.map { x -> x.toTrackingLogItem(countersMap) }
|
||||
@@ -116,21 +116,21 @@ class TrackingRepository @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getLogsCount() = db.trackLogsDao.count()
|
||||
suspend fun getLogsCount() = db.getTrackLogsDao().count()
|
||||
|
||||
suspend fun clearLogs() = db.trackLogsDao.clear()
|
||||
suspend fun clearLogs() = db.getTrackLogsDao().clear()
|
||||
|
||||
suspend fun clearCounters() = db.tracksDao.clearCounters()
|
||||
suspend fun clearCounters() = db.getTracksDao().clearCounters()
|
||||
|
||||
suspend fun gc() {
|
||||
db.tracksDao.gc()
|
||||
db.trackLogsDao.gc()
|
||||
db.getTracksDao().gc()
|
||||
db.getTrackLogsDao().gc()
|
||||
}
|
||||
|
||||
suspend fun saveUpdates(updates: MangaUpdates.Success) {
|
||||
db.withTransaction {
|
||||
val track = getOrCreateTrack(updates.manga.id).mergeWith(updates)
|
||||
db.tracksDao.upsert(track)
|
||||
db.getTracksDao().upsert(track)
|
||||
if (updates.isValid && updates.newChapters.isNotEmpty()) {
|
||||
updatePercent(updates)
|
||||
val logEntity = TrackLogEntity(
|
||||
@@ -138,7 +138,7 @@ class TrackingRepository @Inject constructor(
|
||||
chapters = updates.newChapters.joinToString("\n") { x -> x.name },
|
||||
createdAt = System.currentTimeMillis(),
|
||||
)
|
||||
db.trackLogsDao.insert(logEntity)
|
||||
db.getTrackLogsDao().insert(logEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,10 +146,10 @@ class TrackingRepository @Inject constructor(
|
||||
suspend fun clearUpdates(ids: Collection<Long>) {
|
||||
when {
|
||||
ids.isEmpty() -> return
|
||||
ids.size == 1 -> db.tracksDao.clearCounter(ids.single())
|
||||
ids.size == 1 -> db.getTracksDao().clearCounter(ids.single())
|
||||
else -> db.withTransaction {
|
||||
for (id in ids) {
|
||||
db.tracksDao.clearCounter(id)
|
||||
db.getTracksDao().clearCounter(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,11 +174,11 @@ class TrackingRepository @Inject constructor(
|
||||
lastCheck = System.currentTimeMillis(),
|
||||
lastNotifiedChapterId = lastChapterId,
|
||||
)
|
||||
db.tracksDao.upsert(entity)
|
||||
db.getTracksDao().upsert(entity)
|
||||
}
|
||||
|
||||
suspend fun getCategoriesCount(): IntArray {
|
||||
val categories = db.favouriteCategoriesDao.findAll()
|
||||
val categories = db.getFavouriteCategoriesDao().findAll()
|
||||
return intArrayOf(
|
||||
categories.count { it.track },
|
||||
categories.size,
|
||||
@@ -186,19 +186,19 @@ class TrackingRepository @Inject constructor(
|
||||
}
|
||||
|
||||
suspend fun getAllFavouritesManga(): Map<FavouriteCategory, List<Manga>> {
|
||||
val categories = db.favouriteCategoriesDao.findAll()
|
||||
val categories = db.getFavouriteCategoriesDao().findAll()
|
||||
return categories.associateTo(LinkedHashMap(categories.size)) { categoryEntity ->
|
||||
categoryEntity.toFavouriteCategory() to
|
||||
db.favouritesDao.findAllManga(categoryEntity.categoryId).toMangaList()
|
||||
db.getFavouritesDao().findAllManga(categoryEntity.categoryId).toMangaList()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getAllHistoryManga(): List<Manga> {
|
||||
return db.historyDao.findAllManga().toMangaList()
|
||||
return db.getHistoryDao().findAllManga().toMangaList()
|
||||
}
|
||||
|
||||
private suspend fun getOrCreateTrack(mangaId: Long): TrackEntity {
|
||||
return db.tracksDao.find(mangaId) ?: TrackEntity(
|
||||
return db.getTracksDao().find(mangaId) ?: TrackEntity(
|
||||
mangaId = mangaId,
|
||||
totalChapters = 0,
|
||||
lastChapterId = 0L,
|
||||
@@ -209,7 +209,7 @@ class TrackingRepository @Inject constructor(
|
||||
}
|
||||
|
||||
private suspend fun updatePercent(updates: MangaUpdates.Success) {
|
||||
val history = db.historyDao.find(updates.manga.id) ?: return
|
||||
val history = db.getHistoryDao().find(updates.manga.id) ?: return
|
||||
val chapters = updates.manga.chapters
|
||||
if (chapters.isNullOrEmpty()) {
|
||||
return
|
||||
@@ -220,7 +220,7 @@ class TrackingRepository @Inject constructor(
|
||||
}
|
||||
val position = (chapters.size - updates.newChapters.size) * history.percent
|
||||
val newPercent = position / chapters.size.toFloat()
|
||||
db.historyDao.update(history.copy(percent = newPercent))
|
||||
db.getHistoryDao().update(history.copy(percent = newPercent))
|
||||
}
|
||||
|
||||
private fun TrackEntity.mergeWith(updates: MangaUpdates.Success): TrackEntity {
|
||||
|
||||
@@ -104,31 +104,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_status"
|
||||
tools:text="@tools:sample/lorem[3]" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card_details"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_default="wrap"
|
||||
app:layout_constraintHeight_max="280dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar"
|
||||
app:shapeAppearance="?shapeAppearanceCornerMedium">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView_chapters"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:scrollbars="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:itemCount="200"
|
||||
tools:listitem="@layout/item_chapter_download" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_pause"
|
||||
style="?materialButtonOutlinedStyle"
|
||||
@@ -139,7 +114,7 @@
|
||||
android:text="@string/pause"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_resume"
|
||||
app:layout_constraintTop_toBottomOf="@id/card_details"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<Button
|
||||
@@ -152,7 +127,7 @@
|
||||
android:text="@string/resume"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_cancel"
|
||||
app:layout_constraintTop_toBottomOf="@id/card_details" />
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_cancel"
|
||||
@@ -164,7 +139,7 @@
|
||||
android:text="@android:string/cancel"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/card_details"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -119,18 +119,35 @@
|
||||
android:textColor="?colorOnSurfaceVariant"
|
||||
app:drawableStartCompat="@drawable/ic_timer" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label_timer"
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_timer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/margin_normal"
|
||||
android:layout_marginTop="@dimen/margin_small"
|
||||
android:text="@string/speed"
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
android:layout_marginTop="@dimen/margin_normal"
|
||||
android:textAppearance="?textAppearanceTitleSmall"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.google.android.material.slider.Slider
|
||||
<TextView
|
||||
android:id="@+id/label_timer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/speed"
|
||||
android:textAppearance="?attr/textAppearanceTitleSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label_timer_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_small"
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
tools:text="x0.5" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<org.koitharu.kotatsu.core.ui.widgets.CubicSlider
|
||||
android:id="@+id/slider_timer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_import"
|
||||
android:orderInCategory="50"
|
||||
android:title="@string/_import"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_categories"
|
||||
android:orderInCategory="50"
|
||||
android:title="@string/settings"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_grid_size"
|
||||
android:orderInCategory="50"
|
||||
android:title="@string/grid_size"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_clear_history"
|
||||
android:orderInCategory="50"
|
||||
android:title="@string/clear_history"
|
||||
app:showAsAction="never" />
|
||||
|
||||
</menu>
|
||||
@@ -2,18 +2,58 @@
|
||||
<resources>
|
||||
<plurals name="new_chapters">
|
||||
<item quantity="zero">%1$d فصل جديد</item>
|
||||
<item quantity="one"/>
|
||||
<item quantity="two"/>
|
||||
<item quantity="few"/>
|
||||
<item quantity="one">%1$d فصل جديد</item>
|
||||
<item quantity="two">%1$d فصول جديدة</item>
|
||||
<item quantity="few">%1$d فصول جديدة</item>
|
||||
<item quantity="many">%1$d فصول جديدة</item>
|
||||
<item quantity="other"/>
|
||||
<item quantity="other">%1$d فصول جديدة</item>
|
||||
</plurals>
|
||||
<plurals name="chapters">
|
||||
<item quantity="zero">لا يوجد</item>
|
||||
<item quantity="zero">%1$d فصل</item>
|
||||
<item quantity="one">%1$d فصل</item>
|
||||
<item quantity="two">%1$d فصلين</item>
|
||||
<item quantity="few">%1$d بعض فصول</item>
|
||||
<item quantity="many">%1$d عدة فصول</item>
|
||||
<item quantity="other">أخرى</item>
|
||||
<item quantity="few">%1$d فصول</item>
|
||||
<item quantity="many">%1$d فصول</item>
|
||||
<item quantity="other">%1$d فصول</item>
|
||||
</plurals>
|
||||
<plurals name="minutes_ago">
|
||||
<item quantity="zero">%1$d دقيقة مضت</item>
|
||||
<item quantity="one">%1$d دقيقة مضت</item>
|
||||
<item quantity="two">%1$d دقائق مضت</item>
|
||||
<item quantity="few">%1$d دقائق مضت</item>
|
||||
<item quantity="many">%1$d دقائق مضت</item>
|
||||
<item quantity="other">%1$d دقائق مضت</item>
|
||||
</plurals>
|
||||
<plurals name="items">
|
||||
<item quantity="zero">%1$d عنصر</item>
|
||||
<item quantity="one">%1$d عنصر</item>
|
||||
<item quantity="two">%1$d عناصر</item>
|
||||
<item quantity="few">%1$d عناصر</item>
|
||||
<item quantity="many">%1$d عناصر</item>
|
||||
<item quantity="other">%1$d عناصر</item>
|
||||
</plurals>
|
||||
<plurals name="months_ago">
|
||||
<item quantity="zero">%1$d شهر مضا</item>
|
||||
<item quantity="one">%1$d شهر مضا</item>
|
||||
<item quantity="two">%1$d شهرين مضت</item>
|
||||
<item quantity="few">%1$d أشهر مضت</item>
|
||||
<item quantity="many">%1$d أشهر مضت</item>
|
||||
<item quantity="other">%1$d أشهر مضت</item>
|
||||
</plurals>
|
||||
<plurals name="days_ago">
|
||||
<item quantity="zero">%1$d يوم مضا</item>
|
||||
<item quantity="one">%1$d يوم مضا</item>
|
||||
<item quantity="two">%1$d يومين مضت</item>
|
||||
<item quantity="few">%1$d أيام مضت</item>
|
||||
<item quantity="many">%1$d أيام مضت</item>
|
||||
<item quantity="other">%1$d أيام مضت</item>
|
||||
</plurals>
|
||||
<plurals name="hours_ago">
|
||||
<item quantity="zero">%1$d ساعة مضت</item>
|
||||
<item quantity="one">%1$d ساعة مضت</item>
|
||||
<item quantity="two">%1$d ساعات مضت</item>
|
||||
<item quantity="few">%1$d ساعات مضت</item>
|
||||
<item quantity="many">%1$d ساعات مضت</item>
|
||||
<item quantity="other">%1$d ساعات مضت</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
@@ -156,7 +156,7 @@
|
||||
<string name="long_ago">منذ فترة</string>
|
||||
<string name="notifications_settings">إعدادات الإشعارات</string>
|
||||
<string name="save_manga">حفظ</string>
|
||||
<string name="large_manga_save_confirm">تحتوي هذه المانجا على s%. حفظ الكل؟</string>
|
||||
<string name="large_manga_save_confirm">هذه المانجا فيها %s . حفظ الكل</string>
|
||||
<string name="read_more">اقرأ المزيد</string>
|
||||
<string name="search_results">نتائج البحث</string>
|
||||
<string name="file_not_found">الملف غير موجود</string>
|
||||
@@ -172,9 +172,10 @@
|
||||
<string name="data_restored_success">استعيدت جميع البيانات</string>
|
||||
<string name="backup_information">يمكنك إنشاء نسخة احتياطية من السجل الخاص بك والمفضلة واستعادتها</string>
|
||||
<string name="available_sources">المصادر المتاحة</string>
|
||||
<string name="external_storage">التخزين الخارجي</string>
|
||||
<string name="external_storage">تخزين خارجي</string>
|
||||
<string name="silent">صامت</string>
|
||||
<string name="today">اليوم</string>
|
||||
<string name="system_default">الافتراضي</string>
|
||||
<string name="sign_in">تسجبل الدخول</string>
|
||||
<string name="domain">المجال</string>
|
||||
</resources>
|
||||
@@ -494,4 +494,15 @@
|
||||
<string name="enhanced_colors">32-бітны каляровы рэжым</string>
|
||||
<string name="suggest_new_sources_summary">Прапаноўваць крыніцы мангі, дададзеныя ў апошнім абнаўленні праграмы</string>
|
||||
<string name="online_variant">Анлайн варыянт</string>
|
||||
<string name="frequency_every_day">Кожны дзень</string>
|
||||
<string name="backup_frequency">Частата стварэння рэзервовых копій</string>
|
||||
<string name="periodic_backups_enable">Уключыць перыядычнае рэзервовае капіраванне</string>
|
||||
<string name="frequency_every_2_days">Кожныя 2 дні</string>
|
||||
<string name="frequency_once_per_week">Раз на тыдзень</string>
|
||||
<string name="periodic_backups">Перыядычнае рэзервовае капіраванне</string>
|
||||
<string name="frequency_twice_per_month">Два разы на месяц</string>
|
||||
<string name="frequency_once_per_month">Адзін раз у месяц</string>
|
||||
<string name="last_successful_backup">Апошняе паспяховае рэзервовае капіраванне: %s</string>
|
||||
<string name="backups_output_directory">Вывадны каталог рэзервовых копій</string>
|
||||
<string name="speed_value">x%.1f</string>
|
||||
</resources>
|
||||
@@ -494,4 +494,15 @@
|
||||
<string name="enhanced_colors_summary">Reduce el banding, pero puede afectar al rendimiento</string>
|
||||
<string name="by_relevance">Relevancia</string>
|
||||
<string name="online_variant">Variante en línea</string>
|
||||
<string name="frequency_every_day">Cada día</string>
|
||||
<string name="backup_frequency">Frecuencia de creación de las copias de seguridad</string>
|
||||
<string name="periodic_backups_enable">Activar las copias de seguridad periódicas</string>
|
||||
<string name="frequency_every_2_days">Cada 2 días</string>
|
||||
<string name="frequency_once_per_week">Una vez a la semana</string>
|
||||
<string name="periodic_backups">Copias de seguridad periódicas</string>
|
||||
<string name="frequency_twice_per_month">Dos veces al mes</string>
|
||||
<string name="frequency_once_per_month">Una vez al mes</string>
|
||||
<string name="backups_output_directory">Directorio para guardar la copia de seguridad</string>
|
||||
<string name="last_successful_backup">La última copia de seguridad correcta: %s</string>
|
||||
<string name="speed_value">x%.1f</string>
|
||||
</resources>
|
||||
@@ -493,4 +493,16 @@
|
||||
<string name="categories">Mga Kategorya</string>
|
||||
<string name="list_options">Opsyon sa Listahan</string>
|
||||
<string name="by_relevance">Kaugnayan</string>
|
||||
<string name="online_variant">Online na baryante</string>
|
||||
<string name="frequency_every_day">Araw araw</string>
|
||||
<string name="backup_frequency">Dalas ng paglikha ng backup</string>
|
||||
<string name="periodic_backups_enable">Paganahin ang periodic na pag-backup</string>
|
||||
<string name="frequency_every_2_days">Kada 2 araw</string>
|
||||
<string name="frequency_once_per_week">Isang beses kada linggo</string>
|
||||
<string name="periodic_backups">Mga periodic na pag-backup</string>
|
||||
<string name="frequency_twice_per_month">Dalawang beses bawat buwan</string>
|
||||
<string name="frequency_once_per_month">Isang beses bawat buwan</string>
|
||||
<string name="backups_output_directory">Output directory ng mga backup</string>
|
||||
<string name="last_successful_backup">Huling matagumpay na pag-backup: %s</string>
|
||||
<string name="speed_value">x%.1f</string>
|
||||
</resources>
|
||||
@@ -9,13 +9,13 @@
|
||||
<string name="grid">Kisi</string>
|
||||
<string name="list_mode">Mode daftar</string>
|
||||
<string name="settings">Pengaturan</string>
|
||||
<string name="remote_sources">Sumber jarak jauh</string>
|
||||
<string name="remote_sources">Sumber manga</string>
|
||||
<string name="loading_">Memuat…</string>
|
||||
<string name="computing_">Menghitung…</string>
|
||||
<string name="chapter_d_of_d">Bab %1$d dari %2$d</string>
|
||||
<string name="close">Tutup</string>
|
||||
<string name="try_again">Coba lagi</string>
|
||||
<string name="nothing_found">Nihil</string>
|
||||
<string name="nothing_found">Hasil tidak ditemukan</string>
|
||||
<string name="history_is_empty">Belum ada riwayat</string>
|
||||
<string name="read">Baca</string>
|
||||
<string name="you_have_not_favourites_yet">Belum ada favorit</string>
|
||||
@@ -37,8 +37,8 @@
|
||||
<string name="updated">Diperbarui</string>
|
||||
<string name="newest">Terbaru</string>
|
||||
<string name="by_rating">Peringkat</string>
|
||||
<string name="sort_order">Urutan penyortiran</string>
|
||||
<string name="filter">Saring</string>
|
||||
<string name="sort_order">Urutkan berdasarkan</string>
|
||||
<string name="filter">Filter</string>
|
||||
<string name="theme">Tema</string>
|
||||
<string name="light">Terang</string>
|
||||
<string name="dark">Gelap</string>
|
||||
@@ -478,4 +478,31 @@
|
||||
<string name="directories">Direktori</string>
|
||||
<string name="main_screen_sections">Bagian layar utama</string>
|
||||
<string name="to_top">Ke atas</string>
|
||||
<string name="zoom_in">Perbesar</string>
|
||||
<string name="frequency_every_day">Setiap Hari</string>
|
||||
<string name="categories">Kategori</string>
|
||||
<string name="frequency_every_2_days">Setiap 2 Hari</string>
|
||||
<string name="online_variant">Variasi Online</string>
|
||||
<string name="keep_screen_on">Biarkan Layar Menyala</string>
|
||||
<string name="zoom_out">Perkecil</string>
|
||||
<string name="keep_screen_on_summary">Jangan Matikan Layar Saat Membaca Komik</string>
|
||||
<string name="list_options">Opsi daftar</string>
|
||||
<string name="reader_zoom_buttons_summary">Apakah menampilkan tombol kontrol zoom di sudut kanan bawah</string>
|
||||
<string name="backup_frequency">Frekuensi pembuatan cadangan</string>
|
||||
<string name="suggest_new_sources">Sumber baru yang disarankan setelah pembaruan aplikasi</string>
|
||||
<string name="periodic_backups_enable">Aktifkan pencadangan berkala</string>
|
||||
<string name="moved_to_top">Bergerak ke atas</string>
|
||||
<string name="enhanced_colors_summary">Mengurangi banding, tetapi dapat mempengaruhi kinerja</string>
|
||||
<string name="frequency_once_per_week">Sekali dalam seminggu</string>
|
||||
<string name="periodic_backups">Pencadangan berkala</string>
|
||||
<string name="reader_zoom_buttons">Tampilkan tombol zoom</string>
|
||||
<string name="frequency_twice_per_month">Dua kali sebulan</string>
|
||||
<string name="by_relevance">Relevansi</string>
|
||||
<string name="state_abandoned">Istirahat</string>
|
||||
<string name="frequency_once_per_month">Sebulan sekali</string>
|
||||
<string name="enhanced_colors">mode warna 32-bit</string>
|
||||
<string name="speed_value">x%.1f</string>
|
||||
<string name="last_successful_backup">Cadangan sukses terakhir: %s</string>
|
||||
<string name="backups_output_directory">Direktori keluaran cadangan</string>
|
||||
<string name="suggest_new_sources_summary">Prompt untuk mengaktifkan sumber baru yang ditambahkan setelah memperbarui aplikasi</string>
|
||||
</resources>
|
||||
31
app/src/main/res/values-kk/plurals.xml
Normal file
31
app/src/main/res/values-kk/plurals.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<plurals name="minutes_ago">
|
||||
<item quantity="one">%1$d минут бұрын</item>
|
||||
<item quantity="other">%1$d минут бұрын</item>
|
||||
</plurals>
|
||||
<plurals name="items">
|
||||
<item quantity="one">%1$d елемент</item>
|
||||
<item quantity="other">%1$d елемент</item>
|
||||
</plurals>
|
||||
<plurals name="chapters">
|
||||
<item quantity="one">%1$d тарау</item>
|
||||
<item quantity="other">%1$d тарау</item>
|
||||
</plurals>
|
||||
<plurals name="new_chapters">
|
||||
<item quantity="one">%1$d жаңа тарау</item>
|
||||
<item quantity="other">%1$d жаңа тарау</item>
|
||||
</plurals>
|
||||
<plurals name="months_ago">
|
||||
<item quantity="one">%1$d ай бұрын</item>
|
||||
<item quantity="other">%1$d ай бұрын</item>
|
||||
</plurals>
|
||||
<plurals name="days_ago">
|
||||
<item quantity="one">%1$d күн бұрын</item>
|
||||
<item quantity="other">%1$d күн бұрын</item>
|
||||
</plurals>
|
||||
<plurals name="hours_ago">
|
||||
<item quantity="one">%1$d сағат бұрын</item>
|
||||
<item quantity="other">%1$d сағат бұрын</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="text_search_holder_secondary">Сұрауыңызды қайталап көріңіз.</string>
|
||||
<string name="text_history_holder_secondary">Шеткі мәзірден оқуға болатынды табыңыз.</string>
|
||||
<string name="text_history_holder_secondary">«Шолу» бөлімінен не оқуға болатынын табыңыз.</string>
|
||||
<string name="text_local_holder_secondary">Файл импорттаңыз не онлайн каталогтан бірдеңе сақтаңыз.</string>
|
||||
<string name="other_storage">Басқа бума</string>
|
||||
<string name="new_version_s">Жаңа нұсқа: %s</string>
|
||||
@@ -65,14 +65,14 @@
|
||||
<string name="search_on_s">%s-те іздеу</string>
|
||||
<string name="delete_manga">Маңганы жою</string>
|
||||
<string name="reader_settings">Оқыманы баптау</string>
|
||||
<string name="switch_pages">Бет ауыстыру</string>
|
||||
<string name="switch_pages">Парақтау</string>
|
||||
<string name="taps_on_edges">Шет жақты түру</string>
|
||||
<string name="clear_thumbs_cache">Нобай кәшін тазалау</string>
|
||||
<string name="search_history_cleared">Тазаланды</string>
|
||||
<string name="gestures_only">Ым ғана</string>
|
||||
<string name="internal_storage">Ішкі жады</string>
|
||||
<string name="external_storage">Сыртқы жады</string>
|
||||
<string name="domain">Домен</string>
|
||||
<string name="domain">Дәмейін</string>
|
||||
<string name="app_update_available">Жаңа нұсқа қолжетімді</string>
|
||||
<string name="open_in_browser">Уеб браузер арқылы ашу</string>
|
||||
<string name="save_manga">Сақтау</string>
|
||||
@@ -92,7 +92,7 @@
|
||||
<string name="text_local_holder_primary">Алдымен бірдеңе сақтаңыз</string>
|
||||
<string name="manga_shelf">Сөре</string>
|
||||
<string name="recent_manga">Соңғы</string>
|
||||
<string name="pages_animation">Бет анимациясы</string>
|
||||
<string name="pages_animation">Бет анимасасы</string>
|
||||
<string name="manga_save_location">Жүктеу бумасы</string>
|
||||
<string name="not_available">Қолжетімсіз</string>
|
||||
<string name="cannot_find_available_storage">Қолжетімді бума жоқ</string>
|
||||
@@ -208,4 +208,301 @@
|
||||
<string name="protect_application_subtitle">Қолданбаға кіру үшін құпиясөз енгізіңіз</string>
|
||||
<string name="confirm">Растау</string>
|
||||
<string name="password_length_hint">Құпиясөзде 4, не одан көп таңба болу керек</string>
|
||||
<string name="status_re_reading">Қайталап оқып жатырмын</string>
|
||||
<string name="detect_reader_mode">Оқу режімін өздігінен анықтау</string>
|
||||
<string name="tracking">Бақылау</string>
|
||||
<string name="email_enter_hint">Жалғастыру үшін email поштаңызды жазыңыз</string>
|
||||
<string name="disable_all">Бәрін өшіру</string>
|
||||
<string name="clear_feed">Лекті тазалау</string>
|
||||
<string name="chapters_empty">Бұл маңгада тарау жоқ</string>
|
||||
<string name="clear_all_history">Түгел тарихты тазалау</string>
|
||||
<string name="preload_pages">Беттерді алдынала жүктей беру</string>
|
||||
<string name="data_deletion">Деректі жою</string>
|
||||
<string name="show_reading_indicators">Оқу прогрессін көрсету</string>
|
||||
<string name="local_manga_processing">Сақталған маңгаңыз үдерісте</string>
|
||||
<string name="show_notification_new_chapters_off">Мәлімдеме алмайсыз, бірақ жаңа тараулар тізімде көрсетіліп тұрады</string>
|
||||
<string name="show_notification_new_chapters_on">Оқып жүрген маңгаңыздың жаңаруы туралы мәлімдеме алып тұрасыз</string>
|
||||
<string name="status_reading">Оқып жүрмін</string>
|
||||
<string name="various_languages">Түрлі тіл</string>
|
||||
<string name="removal_completed">Жойылды</string>
|
||||
<string name="edit">Өңдеу</string>
|
||||
<string name="filter_load_error">Жанр тізімі жүктеліне алмады</string>
|
||||
<string name="removed_from_history">Тарихтан жойылды</string>
|
||||
<string name="crash_text">Ақау пайда болды. Жөндеу үшін әзірлеушіге шағым жіберіңізші.</string>
|
||||
<string name="detect_reader_mode_summary">Маңга уебтүн бе екенін өздігінен анықтап береді</string>
|
||||
<string name="appwidget_recent_description">Соңғы оқыған маңгаңыз</string>
|
||||
<string name="appearance">Кейіп</string>
|
||||
<string name="bookmark_remove">Бетбелгіні алып тастау</string>
|
||||
<string name="disable_battery_optimization_summary">Аяда жаңарту іздеуді көмектеседі</string>
|
||||
<string name="status_on_hold">Кейінге қалған</string>
|
||||
<string name="last_2_hours">Соңғы 2 сағат</string>
|
||||
<string name="name">Атау</string>
|
||||
<string name="edit_category">Санатты өңдеу</string>
|
||||
<string name="bookmark_removed">Бетбелгі жойылды</string>
|
||||
<string name="select_range">Ауқымын таңдау</string>
|
||||
<string name="suggestions_excluded_genres_summary">Көргіңіз келмейтін жанрды таңдаңыз</string>
|
||||
<string name="only_using_wifi">Тек Wi-Fi арқылы</string>
|
||||
<string name="back">Кері</string>
|
||||
<string name="dns_over_https">HTTPS үстінен DNS</string>
|
||||
<string name="sync_title">Дерегіңізді үйлестіріңіз</string>
|
||||
<string name="appwidget_shelf_description">Таңдаулы маңгаңыз</string>
|
||||
<string name="send">Жіберу</string>
|
||||
<string name="bookmark_add">Бетбелгілеу</string>
|
||||
<string name="new_sources_text">Жаңа маңга дереккөзі қолжетімді</string>
|
||||
<string name="check_new_chapters_title">Жаңа тарау барын тексеріп, сол туралы мәлімдеу</string>
|
||||
<string name="logged_in_as">%s деп тіркелгенсіз</string>
|
||||
<string name="suggestions_info">Деректің бәрі тек осы құрылғы аясында қаралып, ешқайда жіберілмейді.</string>
|
||||
<string name="history_cleared">Тарих тазарды</string>
|
||||
<string name="undo">Қайтару</string>
|
||||
<string name="download_slowdown_summary">IP мекенжайыңыздың бұғатқа түспеуіне көмектеседі</string>
|
||||
<string name="text_delete_local_manga_batch">Таңдалғанды құрылғыдан жоямысыз\?</string>
|
||||
<string name="report">Шағым</string>
|
||||
<string name="download_slowdown">Жүктеп алуды баяулату</string>
|
||||
<string name="bookmark_added">Бетбелгі қойылды</string>
|
||||
<string name="sync">Үйлестіру</string>
|
||||
<string name="search_chapters">Тарау табу</string>
|
||||
<string name="always">Әрқашан</string>
|
||||
<string name="suggestions_excluded_genres">Жанрды шектеу</string>
|
||||
<string name="canceled">Доғарылды</string>
|
||||
<string name="account_already_exists">Бұндай тіркелгі бос емес</string>
|
||||
<string name="hide">Жасыру</string>
|
||||
<string name="exclude_nsfw_from_history_summary">ҰЯТСЫЗ деген маңганы оқығаныңыз тарихыңызда сақталмайды</string>
|
||||
<string name="show_reading_indicators_summary">Таңдаулы мен тарихта оқылған туынды пайызын көрсету</string>
|
||||
<string name="use_fingerprint">Қолжетімді болса саусақ ізін қолдану</string>
|
||||
<string name="onboard_text">Маңганы қай тілде оқығыңыз келетінін таңдаңыз. Кейінірек баптауда өзгертіп ала аласыз.</string>
|
||||
<string name="suggestions_updating">Ұсынысты жаңарту</string>
|
||||
<string name="percent_string_pattern">%%%1$s</string>
|
||||
<string name="chapters_will_removed_background">Тараулар аяда жойылады</string>
|
||||
<string name="default_mode">Әдепкі режім</string>
|
||||
<string name="logout">Шығу</string>
|
||||
<string name="status_completed">Аяқталған</string>
|
||||
<string name="reset_filter">Сүзгіні тазарту</string>
|
||||
<string name="status_dropped">Тастап кеткен</string>
|
||||
<string name="nsfw">18+</string>
|
||||
<string name="notifications_enable">Мәлімдеме қосу</string>
|
||||
<string name="never">Ешқашан</string>
|
||||
<string name="disable_battery_optimization">Қуат оңтайлығын өшіру</string>
|
||||
<string name="status_planned">Жоспарланған</string>
|
||||
<string name="bookmarks">Бетбелгілер</string>
|
||||
<string name="show_all">Бәрін көрсету</string>
|
||||
<string name="empty_favourite_categories">Таңдаулы санатыңыз жоқ</string>
|
||||
<string name="invalid_domain_message">Қате дәмейін</string>
|
||||
<string name="languages">Тілдер</string>
|
||||
<string name="zoom_in">Ұлғайту</string>
|
||||
<string name="captcha_required_summary">%s дұрыс істеуі үшін captcha өтіңіз</string>
|
||||
<string name="download_option_all_unread">Түгел оқылмаған тарау</string>
|
||||
<string name="restore_backup_description">Алдында жасалған жеке деректің сақтық көшірмесін импорттау</string>
|
||||
<string name="frequency_every_day">Күнде</string>
|
||||
<string name="download_started">Жүктеп алу басталды</string>
|
||||
<string name="categories">Санат</string>
|
||||
<string name="progress">Прогресс</string>
|
||||
<string name="cancel_all">Бәрін доғару</string>
|
||||
<string name="sync_host_description">Өзіңіздің үйлестіру сербірін я әдепкісін таңдай аласыз. Не істеп жатқаныңызды түсінбеңіз баспаңыз.</string>
|
||||
<string name="error_corrupted_file">Қайта жарамсыз дерек қосылды яки файыл сынған</string>
|
||||
<string name="pick_custom_directory">Жеке каталогты таңдау</string>
|
||||
<string name="no_chapters">Тарау жоқ</string>
|
||||
<string name="list_options">Тізімді реттеу</string>
|
||||
<string name="related_manga_summary">Байланыс маңга тізімін көрсету. Кейде тізім қате я мүлде болмауы мүмкін</string>
|
||||
<string name="remove_completed_downloads_confirm">Жүктеу тарихыңыз тазарады</string>
|
||||
<string name="theme_name_dynamic">Динамикалық</string>
|
||||
<string name="reader_zoom_buttons_summary">Ұлғайту батырмасын астыңғы оң жақта көрсету я көрсетпеу</string>
|
||||
<string name="pages_cache">Бет кәші</string>
|
||||
<string name="reset">Арылту</string>
|
||||
<string name="tracker_wifi_only_summary">Шектеулі желі қосылымы болса жаңа тарау қолжетімдігін тексермеу</string>
|
||||
<string name="order_added">Қосылды</string>
|
||||
<string name="enable_logging">Логтауды қосу</string>
|
||||
<string name="on_device">Құрылғыда</string>
|
||||
<string name="password">Құпиясөз</string>
|
||||
<string name="download_option_whole_manga">Маңганы толықтай</string>
|
||||
<string name="settings_apply_restart_required">Өзгерту іске қосылуы үшін қолданбаны өшіріп қосыңыз</string>
|
||||
<string name="source_disabled">Дереккөз сөніп жатыр</string>
|
||||
<string name="backup_frequency">Сақтық көшірмесінің жиілігі</string>
|
||||
<string name="data_and_privacy">Дерек пен құпиялық</string>
|
||||
<string name="clear_cookies_summary">Қате болса көмектесе алады. Түгел тіркелгінің күші жойылады</string>
|
||||
<string name="enable_logging_summary">Кей әрекетті түзеуге сақтау қою. Не екенін білмесеңіз қоспаңыз</string>
|
||||
<string name="clear_source_cookies_summary">Осы дәмейіннің кукиін тазалау. Көп жағдайда тіркелгіден шығылып кетеді</string>
|
||||
<string name="history_shortcuts">Соңғы маңганың таңбашасын көрсету</string>
|
||||
<string name="downloads_wifi_only_summary">Ұялы желіге көшкенде жүктеп алуды тоқтату</string>
|
||||
<string name="suggest_new_sources">Қолданбаны жаңартқан соң жаңа дереккөз ұсыну</string>
|
||||
<string name="import_completed">Импорт аяқталды</string>
|
||||
<string name="different_languages">Әртүрлі тіл</string>
|
||||
<string name="user_agent">UserAgent басы</string>
|
||||
<string name="ignore_ssl_errors">SSL қатеге мән бермеу</string>
|
||||
<string name="reader_info_bar">Оқымада ақпар тақтасын көрсету</string>
|
||||
<string name="periodic_backups_enable">Сақтық көшірмесін кезең-кезеңімен жасауды қосу</string>
|
||||
<string name="server_address">Сербір адресі</string>
|
||||
<string name="moved_to_top">Үстіге жылжыды</string>
|
||||
<string name="explore">Қарау</string>
|
||||
<string name="find_similar">Ұқсасын табу</string>
|
||||
<string name="storage_usage">Жадты қолдану</string>
|
||||
<string name="data_not_restored_text">Дұрыс сақтық көшірме файылын таңдағаныңызды тексеріңіз</string>
|
||||
<string name="theme_name_sakura">Сакура</string>
|
||||
<string name="view_list">Тізімді көру</string>
|
||||
<string name="unknown">Белгісіз</string>
|
||||
<string name="in_progress">Оқылып жатыр</string>
|
||||
<string name="download_option_manual_selection">Тарауды таңдап шығу</string>
|
||||
<string name="enhanced_colors_summary">Түс ыдырауын азайтады, бірақ өнімділікке әсер ете алады</string>
|
||||
<string name="importing_manga">Маңга импорттау</string>
|
||||
<string name="pause">Үзіліс</string>
|
||||
<string name="clear_new_chapters_counters">Жаңа тарау ақпарын да жою</string>
|
||||
<string name="nothing_here">Мұнда түк жоқ</string>
|
||||
<string name="remove_completed">Дайынын жою</string>
|
||||
<string name="items_limit_exceeded">Елемент сыймайды</string>
|
||||
<string name="frequency_every_2_days">Екі күн сайын</string>
|
||||
<string name="suggestions_notifications_summary">Анда-санда мәлімдеме арқылы маңга ұсынып тұру</string>
|
||||
<string name="invalid_value_message">Жарамсыз өлшем</string>
|
||||
<string name="downloads_cancelled">Жүктеп алу доғарылды</string>
|
||||
<string name="webtoon_zoom">Уебтүнді ұлғайту</string>
|
||||
<string name="theme_name_miku">Мику</string>
|
||||
<string name="data_not_restored">Дерек қалыпқа келмеді</string>
|
||||
<string name="directories">Каталог</string>
|
||||
<string name="local_manga_directories">Жергілікті маңга тізімі</string>
|
||||
<string name="manage_categories">Санатты реттеу</string>
|
||||
<string name="scrobbling_empty_hint">Оқу прогрессін бақылау үшін маңга ақпар экранындағы «Мәзірге» өтіп, «Бақылау» батырмасын басыңыз.</string>
|
||||
<string name="color_light">Жарық</string>
|
||||
<string name="web_view_unavailable">WebView қолжетімсіз: WebView провайдері орнатылғанын тексеріп көріңіз</string>
|
||||
<string name="port">Порт</string>
|
||||
<string name="color_correction_hint">Таңдалған түс баптауы осы маңга үшін сақталып тұрады</string>
|
||||
<string name="not_found_404">Контент табылмады, жойылған-мыс</string>
|
||||
<string name="got_it">Ұқтым</string>
|
||||
<string name="type">Түрі</string>
|
||||
<string name="search_hint">Маңга атын, жанрын я дереккөз атауын жазыңыз</string>
|
||||
<string name="frequency_once_per_week">Апта сайын</string>
|
||||
<string name="description">Сипаттама</string>
|
||||
<string name="periodic_backups">Сақтық көшірмесін кезең-кезеңімен жасау</string>
|
||||
<string name="reader_zoom_buttons">Ұлғайту батырмасын көрсету</string>
|
||||
<string name="sources_reorder_tip">Ретін өзгерту үшін елементті басып тұрыңыз</string>
|
||||
<string name="resume">Жалғастыру</string>
|
||||
<string name="server_error">Сербір қуып тұр (%1$d). Сәлден соң қайталап көріңіз</string>
|
||||
<string name="images_proxy_title">Суретті оңтайлау проксиі</string>
|
||||
<string name="network_unavailable_hint">Маңганы онлайн оқу үшін Wi-Fi-ды я ұялы желіні қосыңыз</string>
|
||||
<string name="no_manga_sources">Маңға дереккөзі жоқ</string>
|
||||
<string name="username">Қолданушы аты</string>
|
||||
<string name="frequency_twice_per_month">Екі апта сайын</string>
|
||||
<string name="prefetch_content">Алдын-ала жүктей беру</string>
|
||||
<string name="main_screen_sections">Басты экран бөлімдері</string>
|
||||
<string name="confirm_exit">Шығу үшін тағы бір рет басыңыз</string>
|
||||
<string name="advanced">Қосымша баптау</string>
|
||||
<string name="sync_settings">Үйлестіру баптауы</string>
|
||||
<string name="online_variant">Онлайн нұсқа</string>
|
||||
<string name="download_option_all_unread_b">Түгел оқылмаған тарау (%s)</string>
|
||||
<string name="authorization_optional">Кіру (міндетті емес)</string>
|
||||
<string name="color_dark">Күңгірт</string>
|
||||
<string name="other_cache">Басқа кәш</string>
|
||||
<string name="show_suspicious_content">Күмәнді контентті көрсету</string>
|
||||
<string name="reader_info_bar_summary">Экранның үстінгі жағында уақыт пен оқу прогрессін көрсету</string>
|
||||
<string name="allow_unstable_updates_summary">Тұрақсыз нұсқа туралы мәлімдеме алу</string>
|
||||
<string name="translations">Аударма</string>
|
||||
<string name="comics_archive_import_description">Бір не одан көп .cbz я .zip файлын таңдай аласыз, әр файыл бөлек маңга болып анықталады.</string>
|
||||
<string name="downloads_paused">Жүктеп алу тоқтап қалды</string>
|
||||
<string name="too_many_requests_message">Тым көп сұрату. Біраздан соң қайталап көріңіз</string>
|
||||
<string name="downloads_wifi_only">Wi-Fi арқылы ғана жүктеу</string>
|
||||
<string name="cancel_all_downloads_confirm">Белсенді жүктеудің бәрі жойылып, жартылай жүктелгендер жоғалып кетеді</string>
|
||||
<string name="by_relevance">Өзектілігі</string>
|
||||
<string name="related_manga">Ұқсас маңга</string>
|
||||
<string name="discard">Сақтамау</string>
|
||||
<string name="saved_manga">Сақталған маңга</string>
|
||||
<string name="manga_error_description_pattern">Қате мәліметі:<br><tt>%1$s</tt><br><br>1. Дереккөзде бар ма екенін тексеру үшін <a href=%2$s>маңганы уеб браузер арқылы</a> ашып көріңіз<br>2. <a href=kotatsu://about>Kotatsu-ның ең соңғы нұсқасын</a><br>3 қолданып отырсыз ба, тексеріп көріңіз. Мүмкін болса: әзірлеушіге қате туралы шағып жіберіңіз.</string>
|
||||
<string name="state_abandoned">Тасталған</string>
|
||||
<string name="history_shortcuts_summary">Қолданба таңбасын ұзақ басып тұрғанда соңғы маңганы қолжетімді ету</string>
|
||||
<string name="automatic_scroll">Өздігінен парақтау</string>
|
||||
<string name="download_option_first_n_chapters">Бірінші %s</string>
|
||||
<string name="keep_screen_on">Экранды сөндірмеу</string>
|
||||
<string name="paused">Тоқтап тұр</string>
|
||||
<string name="text_downloads_list_holder">Жүктеп алғаныңыз жоқ</string>
|
||||
<string name="color_correction">Түс реттеу</string>
|
||||
<string name="invalid_port_number">Порттың нөмірі қате</string>
|
||||
<string name="suggestions_wifi_only_summary">Шектеулі желі қосылымы болса ұсынысты жаңартпау</string>
|
||||
<string name="webtoon_zoom_summary">Уебтүн режімінде ұлғайту ымына рұқсат ету</string>
|
||||
<string name="categories_delete_confirm">Таңдаулы санатты шынымен жойғыңыз келе ме\?
|
||||
\nІшіндегі бар маңга жойылады, сосын оны қайтарып ала алмайсыз.</string>
|
||||
<string name="frequency_once_per_month">Ай сайын</string>
|
||||
<string name="reader_info_pattern">%1$d/%2$d-тарау %3$d/%4$d-бет</string>
|
||||
<string name="contrast">Көреғарлық</string>
|
||||
<string name="network">Желі</string>
|
||||
<string name="reader_slider">Парақтау жүгірткісін көрсету</string>
|
||||
<string name="no_manga_sources_text">Онлайн оқу үшін маңга дереккөзін қосыңыз</string>
|
||||
<string name="downloaded">Жүктеп алынған</string>
|
||||
<string name="options">Басқа</string>
|
||||
<string name="services">Қызмет</string>
|
||||
<string name="suggestions_enable_prompt">Сізге арналған маңга ұсынысын алғыңыз келе ме\?</string>
|
||||
<string name="exit_confirmation">Шығуды растау</string>
|
||||
<string name="comics_archive">Комикс мұрағаты</string>
|
||||
<string name="custom_directory">Жеке каталог</string>
|
||||
<string name="more">Тағы</string>
|
||||
<string name="theme_name_asuka">Асука</string>
|
||||
<string name="address">Адресі</string>
|
||||
<string name="import_will_start_soon">Импорт қазір басталады</string>
|
||||
<string name="compact">Жинақы</string>
|
||||
<string name="enhanced_colors">32-биттік түс режімі</string>
|
||||
<string name="folder_with_images_import_description">Мұрағат я сурет каталогын таңдай аласыз. Әр мұрағат (яки ішкі каталог) бір тарау деп анықталады.</string>
|
||||
<string name="reorder">Ретін өзгерту</string>
|
||||
<string name="default_section">Әдепкі бөлім</string>
|
||||
<string name="background">Ая</string>
|
||||
<string name="feed">Лек</string>
|
||||
<string name="speed_value">x%.1f</string>
|
||||
<string name="downloads_removed">Жүктеп алғаныңыз жойылды</string>
|
||||
<string name="pages_animation_summary">Парақтау анимасасы</string>
|
||||
<string name="no_access_to_file">Бұл файлға я каталогқа рұқсатыңыз жоқ</string>
|
||||
<string name="mark_as_current">Қазіргі деп белгілеу</string>
|
||||
<string name="random">Кездейсоқ</string>
|
||||
<string name="mirror_switching">Айнаны өздігінен таңдау</string>
|
||||
<string name="restore_summary">Бұған дейін жасалған сақтық көшірмесін қалпына келтіру</string>
|
||||
<string name="show_pages_numbers_summary">Бет нөмірін төменгі жақта көрсету</string>
|
||||
<string name="show_in_grid_view">Кесте қып көрсету</string>
|
||||
<string name="zoom_out">Кішірейту</string>
|
||||
<string name="keep_screen_on_summary">Маңга оқып отырғанда экранды сөндірмеу</string>
|
||||
<string name="download_option_next_unread_n_chapters">Келесі оқылмаған %s</string>
|
||||
<string name="clear_network_cache">Желі кәшін тазалау</string>
|
||||
<string name="voice_search">Дауыс іздеуі</string>
|
||||
<string name="enable">Қосу</string>
|
||||
<string name="import_completed_hint">Орын үнемдеу үшін түпнұсқа файлды құрылғыдан жойып тастай аласыз</string>
|
||||
<string name="theme_name_rikka">Рикка</string>
|
||||
<string name="reader_control_ltr_summary">Оң жақты я оң жақ батырманы басқан сайын бет ауысады</string>
|
||||
<string name="language">Тіл</string>
|
||||
<string name="incognito_mode">Инкогнито режімі</string>
|
||||
<string name="no_bookmarks_summary">Оқып жатқан маңгаға бетбелгі жасай аласыз</string>
|
||||
<string name="images_procy_description">Трафик қолдануды азайтып, сурет жүктеп алуды тездету үшін wsrv.nl қызметін қолданыңыз</string>
|
||||
<string name="theme_name_mamimi">Мамими</string>
|
||||
<string name="manga_branch_title_template">%1$s (%2$s)</string>
|
||||
<string name="manage">Реттеу</string>
|
||||
<string name="manga_list">Маңга тізімі</string>
|
||||
<string name="reader_control_ltr">Оқыманы эргономді басқару</string>
|
||||
<string name="disable_nsfw">ҰЯТСЫЗ-ды өшіру</string>
|
||||
<string name="last_successful_backup">Соңғы сақтық көшірме: %s</string>
|
||||
<string name="available">Қолжетімді</string>
|
||||
<string name="color_white">Ақ</string>
|
||||
<string name="network_unavailable">Желі қолжетімсіз</string>
|
||||
<string name="empty">Бос</string>
|
||||
<string name="downloads_resumed">Жүктеп алу жалғасты</string>
|
||||
<string name="details_button_tip">Қосымша реттеу көру үшін «Оқу» батырмасын басып тұрыңыз</string>
|
||||
<string name="text_unsaved_changes_prompt">Өзгерісті сақтайсыз ба\?</string>
|
||||
<string name="folder_with_images">Суреті бар бума</string>
|
||||
<string name="to_top">Үстіге</string>
|
||||
<string name="show">Көрсету</string>
|
||||
<string name="show_on_shelf">Сөреде көрсету</string>
|
||||
<string name="allow_unstable_updates">Тұрақсыз жаңартуды орнатуға рұқсат беру</string>
|
||||
<string name="sync_auth_hint">Жаңа тіркелгі аша аласыз я жаңасын жасай аласыз</string>
|
||||
<string name="theme_name_kanade">Канаде</string>
|
||||
<string name="backups_output_directory">Сақтық көшірмесінің каталогы</string>
|
||||
<string name="invert_colors">Түстерді терістету</string>
|
||||
<string name="color_theme">Түс схемасы</string>
|
||||
<string name="brightness">Ашықтық</string>
|
||||
<string name="memory_usage_pattern">%s - %s</string>
|
||||
<string name="exit_confirmation_summary">Шығып кету үшін «Кері» батырмасын екі рет басыңыз</string>
|
||||
<string name="bookmarks_removed">Бетбелгілер жойылды</string>
|
||||
<string name="theme_name_mion">Мион</string>
|
||||
<string name="mirror_switching_summary">Дереккөз дәмейіннің қатесі пайда болып, айнасы қолжетімді болса, өздігінен соған ауыстыру</string>
|
||||
<string name="no_bookmarks_yet">Бетбелгі жоқ</string>
|
||||
<string name="no_thanks">Жоқ, рақмет</string>
|
||||
<string name="suggest_new_sources_summary">Қолданбаның жаңа нұсқасында пайда болған дереккөзді ұсыну</string>
|
||||
<string name="share_logs">Логты бөлісу</string>
|
||||
<string name="speed">Жылдамдық</string>
|
||||
<string name="download_option_all_chapters">%s аударған түгел тарау</string>
|
||||
<string name="suggestion_manga">Ұсыныс: %s</string>
|
||||
<string name="color_black">Қара</string>
|
||||
<string name="removed_from_favourites">Таңдаулыдан жойылды</string>
|
||||
<string name="this_month">Осы ай</string>
|
||||
<string name="proxy">Прокси</string>
|
||||
<string name="error_no_space_left">Жадта бос орын қалмады</string>
|
||||
</resources>
|
||||
@@ -1,5 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Base.V31.Kotatsu" parent="Base.V27.Kotatsu">
|
||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/avd_splash</item>
|
||||
<item name="android:windowSplashScreenBackground">@android:color/system_neutral2_900</item>
|
||||
<item name="android:windowSplashScreenAnimationDuration">800</item>
|
||||
</style>
|
||||
|
||||
<!-- From ThemeOverlay.Material3.DynamicColors.Dark -->
|
||||
<style name="Theme.Kotatsu.Monet">
|
||||
<item name="isMaterial3DynamicColorApplied">true</item>
|
||||
|
||||
@@ -483,4 +483,25 @@
|
||||
<string name="show">Mostrar</string>
|
||||
<string name="color_black">Preto</string>
|
||||
<string name="this_month">Esse mês</string>
|
||||
<string name="frequency_every_day">Diariamente</string>
|
||||
<string name="categories">Categorias</string>
|
||||
<string name="list_options">Opções da lista</string>
|
||||
<string name="backup_frequency">Frequência de criação de backup</string>
|
||||
<string name="suggest_new_sources">Sugerir novas fontes após a atualização do aplicativo</string>
|
||||
<string name="periodic_backups_enable">Ativar backups periódicos</string>
|
||||
<string name="enhanced_colors_summary">Reduz a formação de faixas, mas pode afetar o desempenho</string>
|
||||
<string name="frequency_every_2_days">A cada 2 dias</string>
|
||||
<string name="frequency_once_per_week">Semanalmente</string>
|
||||
<string name="periodic_backups">Backups periódicos</string>
|
||||
<string name="frequency_twice_per_month">Duas vezes ao mês</string>
|
||||
<string name="online_variant">Variante on-line</string>
|
||||
<string name="by_relevance">Relevância</string>
|
||||
<string name="state_abandoned">Abandonado</string>
|
||||
<string name="keep_screen_on">Manter a tela ligada</string>
|
||||
<string name="frequency_once_per_month">Uma vez por mês</string>
|
||||
<string name="enhanced_colors">Modo de cor de 32 bits</string>
|
||||
<string name="keep_screen_on_summary">Não desligue a tela enquanto estiver lendo mangá</string>
|
||||
<string name="last_successful_backup">Último backup bem-sucedido: %s</string>
|
||||
<string name="backups_output_directory">Local de saída de backups</string>
|
||||
<string name="suggest_new_sources_summary">Solicitação para ativar fontes recém-adicionadas após a atualização do aplicativo</string>
|
||||
</resources>
|
||||
@@ -41,11 +41,11 @@
|
||||
<string name="remove">Remover</string>
|
||||
<string name="_s_deleted_from_local_storage">«%s» deletado do armazenamento local</string>
|
||||
<string name="save_page">Salvar página</string>
|
||||
<string name="page_saved">Salvou</string>
|
||||
<string name="page_saved">Salvo</string>
|
||||
<string name="share_image">Compartilhar imagem</string>
|
||||
<string name="_import">Importar</string>
|
||||
<string name="updated">Atualizado</string>
|
||||
<string name="delete">Deletar</string>
|
||||
<string name="delete">Delete</string>
|
||||
<string name="operation_not_supported">Essa operação não é suportada</string>
|
||||
<string name="clear_pages_cache">Limpar cache de página</string>
|
||||
<string name="text_file_sizes">B|kB|MB|GB|TB</string>
|
||||
@@ -66,10 +66,10 @@
|
||||
<string name="internal_storage">Armazenamento interno</string>
|
||||
<string name="external_storage">Armazenamento externo</string>
|
||||
<string name="domain">Domínio</string>
|
||||
<string name="app_update_available">Uma nova versão da app está disponível</string>
|
||||
<string name="app_update_available">Uma nova versão do app está disponível</string>
|
||||
<string name="open_in_browser">Abrir no navegador da web</string>
|
||||
<string name="large_manga_save_confirm">Este mangá tem %s. Salvar tudo isso\?</string>
|
||||
<string name="save_manga">Salve</string>
|
||||
<string name="save_manga">Salvar</string>
|
||||
<string name="notifications">Notificações</string>
|
||||
<string name="new_chapters">Novos capítulos</string>
|
||||
<string name="download">Download</string>
|
||||
@@ -483,4 +483,15 @@
|
||||
<string name="show">Mostrar</string>
|
||||
<string name="color_black">Preto</string>
|
||||
<string name="this_month">Este mês</string>
|
||||
<string name="categories">Categorias</string>
|
||||
<string name="list_options">Listar opções</string>
|
||||
<string name="suggest_new_sources">Sugira novas fontes após atualização do app</string>
|
||||
<string name="enhanced_colors_summary">Reduz faixas, mas pode afetar o desempenho</string>
|
||||
<string name="online_variant">Variante online</string>
|
||||
<string name="by_relevance">Relevância</string>
|
||||
<string name="enhanced_colors">Modo de cor 32-bit</string>
|
||||
<string name="suggest_new_sources_summary">Solicitar a ativação de fontes recém-adicionadas após atualizar o aplicativo</string>
|
||||
<string name="state_abandoned">Caiu</string>
|
||||
<string name="keep_screen_on">Manter a tela ligada</string>
|
||||
<string name="keep_screen_on_summary">Não desligue a tela enquanto estiver lendo mangá</string>
|
||||
</resources>
|
||||
@@ -494,4 +494,15 @@
|
||||
<string name="enhanced_colors">32-битный цветовой режим</string>
|
||||
<string name="suggest_new_sources_summary">Предлагать источники манги, добавленные в последнем обновлении приложения</string>
|
||||
<string name="online_variant">Онлайн вариант</string>
|
||||
<string name="frequency_every_day">Каждый день</string>
|
||||
<string name="backup_frequency">Частота создания резервных копий</string>
|
||||
<string name="periodic_backups_enable">Включить резервное копирование по расписанию</string>
|
||||
<string name="frequency_every_2_days">Каждые 2 дня</string>
|
||||
<string name="frequency_once_per_week">Раз в неделю</string>
|
||||
<string name="periodic_backups">Резервное копирование по расписанию</string>
|
||||
<string name="frequency_twice_per_month">Дважды в месяц</string>
|
||||
<string name="frequency_once_per_month">Один раз в месяц</string>
|
||||
<string name="backups_output_directory">Каталог для сохранения резервных копий</string>
|
||||
<string name="last_successful_backup">Последняя резервная копия: %s</string>
|
||||
<string name="speed_value">x%.1f</string>
|
||||
</resources>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="light">สว่าง</string>
|
||||
<string name="automatic">ตั้งค่าตามเครื่อง</string>
|
||||
<string name="text_clear_history_prompt">จะเคลียร์ประวัติการอ่านทั้งหมดแบบถาวรใช่ไหม\?</string>
|
||||
@@ -160,7 +160,7 @@
|
||||
<string name="zoom_mode_fit_center">พอดีตรงกลาง</string>
|
||||
<string name="zoom_mode_fit_height">พอดีกับความสูง</string>
|
||||
<string name="black_dark_theme">ดำ</string>
|
||||
<string name="just_now">เมื่อกี้</string>
|
||||
<string name="just_now">เมื่อเร็วนี้</string>
|
||||
<string name="clear_feed">เคลียร์ฟีด</string>
|
||||
<string name="backup_restore">สำรองและคืนค่า</string>
|
||||
<string name="create_backup">สร้างข้อมูลสำรอง</string>
|
||||
@@ -344,4 +344,29 @@
|
||||
<string name="exit_confirmation_summary">กดย้อนกลับสองครั้งเพื่อออกจากแอป</string>
|
||||
<string name="bookmarks_removed">ลบบุ๊คมาร์กแล้ว</string>
|
||||
<string name="error_no_space_left">ไม่มีพื้นที่เหลือบนอุปกรณ์แล้ว</string>
|
||||
<string name="zoom_in">ซูมเข้า</string>
|
||||
<string name="detect_reader_mode">โหมดตรวจจับเครื่องอ่านอัตโนมัติ</string>
|
||||
<string name="frequency_every_day">ทุกวัน</string>
|
||||
<string name="categories">หมวดหมู่</string>
|
||||
<string name="backup_frequency">ความถี่การสำรองข้อมูล</string>
|
||||
<string name="enabled_d_of_d" tools:ignore="PluralsCandidate">%1$d of %2$d on</string>
|
||||
<string name="unknown">ไม่ทราบ</string>
|
||||
<string name="frequency_every_2_days">ทุก 2 วัน</string>
|
||||
<string name="frequency_once_per_week">สัปดาห์ละครั้ง</string>
|
||||
<string name="reader_zoom_buttons">โชว์ปุ่มซูม</string>
|
||||
<string name="select_range">เลือกช่วง</string>
|
||||
<string name="no_manga_sources">ไม่พบแหล่งมังงะ</string>
|
||||
<string name="frequency_twice_per_month">สองครั้งต่อเดือน</string>
|
||||
<string name="keep_screen_on">เปิดหน้าจอไว้ตลอด</string>
|
||||
<string name="categories_delete_confirm">คุณแน่ใจหรือไม่ว่าต้องการลบหมวดหมู่รายการโปรดที่เลือก
|
||||
\nมังงะทั้งหมดในนั้นจะหายไปและไม่สามารถยกเลิกได้</string>
|
||||
<string name="frequency_once_per_month">เดือนละครั้ง</string>
|
||||
<string name="no_manga_sources_text">เปิดใช้งานแหล่งมังงะเพื่ออ่านมังงะออนไลน์</string>
|
||||
<string name="enhanced_colors">โหมดสี 32 บิต</string>
|
||||
<string name="background">พื้นหลัง</string>
|
||||
<string name="speed_value">x%.1f</string>
|
||||
<string name="use_fingerprint">ใช้สแกนลายนิ้วมือหากมี</string>
|
||||
<string name="zoom_out">ซูมออก</string>
|
||||
<string name="text_search_holder_secondary">โปรดลองเรียบเรียงคำค้นหา</string>
|
||||
<string name="last_successful_backup">สำรองข้อมูลสำเร็จล่าสุด: %s</string>
|
||||
</resources>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user