Merge Mihon 0.21.2 updates and use BookOasis updater
Build & Test / Build & Test App (push) Has been cancelled
Release / Extract tag name (push) Has been cancelled
Update website / update_website (release) Has been cancelled
Release / Build (push) Has been cancelled
Release / Build (FOSS) (push) Has been cancelled
Release / Create GitHub Release (push) Has been cancelled

This commit is contained in:
BookOasis Reader
2026-10-13 14:26:36 +09:00
583 changed files with 52681 additions and 30246 deletions
@@ -14,9 +14,12 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.model.SMangaUpdate
import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.supervisorScope
import kotlinx.coroutines.withContext
import kotlinx.datetime.LocalDate
import kotlinx.datetime.TimeZone
import kotlinx.datetime.atStartOfDayIn
@@ -30,7 +33,6 @@ import nl.adaptivity.xmlutil.serialization.XML
import tachiyomi.core.common.i18n.stringResource
import tachiyomi.core.common.storage.extension
import tachiyomi.core.common.storage.nameWithoutExtension
import tachiyomi.core.common.util.lang.withIOContext
import tachiyomi.core.common.util.system.ImageUtil
import tachiyomi.core.common.util.system.logcat
import tachiyomi.core.metadata.comicinfo.COMIC_INFO_FILE
@@ -85,7 +87,9 @@ class LocalSource(
override suspend fun getLatestUpdates(page: Int) = getSearchManga(page, "", LatestFilters)
override suspend fun getSearchManga(page: Int, query: String, filters: FilterList): MangasPage = withIOContext {
override suspend fun getSearchManga(page: Int, query: String, filters: FilterList): MangasPage = withContext(
Dispatchers.IO,
) {
val lastModifiedLimit = if (filters === LatestFilters) {
System.currentTimeMillis() - LATEST_THRESHOLD
} else {
@@ -159,7 +163,7 @@ class LocalSource(
}
// Manga details related
private suspend fun getMangaDetails(manga: SManga): SManga = withIOContext {
private suspend fun getMangaDetails(manga: SManga): SManga = withContext(Dispatchers.IO) {
coverManager.find(manga.url)?.let {
manga.thumbnail_url = it.uri.toString()
}
@@ -223,7 +227,7 @@ class LocalSource(
logcat(LogPriority.ERROR, e) { "Error setting manga details from local metadata for ${manga.title}" }
}
return@withIOContext manga
return@withContext manga
}
private fun <T> getComicInfoForChapter(chapter: UniFile, block: (InputStream) -> T): T? {
@@ -286,7 +290,7 @@ class LocalSource(
}
// Chapters
private suspend fun getChapterList(manga: SManga): List<SChapter> = withIOContext {
private suspend fun getChapterList(manga: SManga): List<SChapter> = withContext(Dispatchers.IO) {
val chapters = fileSystem.getFilesInMangaDirectory(manga.url)
// Only keep supported formats
.filterNot { it.name.orEmpty().startsWith('.') }
@@ -310,15 +314,21 @@ class LocalSource(
.parseChapterNumber(manga.title, this.name, this.chapter_number.toDouble())
.toFloat()
val format = Format.valueOf(chapterFile)
if (format is Format.Epub) {
format.file.epubReader(context).use { epub ->
epub.fillMetadata(manga, this)
}
} else {
getComicInfoForChapter(chapterFile) { stream ->
setChapterDetailsFromComicInfoFile(stream, this)
try {
val format = Format.valueOf(chapterFile)
if (format is Format.Epub) {
format.file.epubReader(context).use { epub ->
epub.fillMetadata(manga, this)
}
} else {
getComicInfoForChapter(chapterFile) { stream ->
setChapterDetailsFromComicInfoFile(stream, this)
}
}
} catch (e: CancellationException) {
throw e
} catch (e: Exception) {
logcat(LogPriority.ERROR, e) { "Failed to read metadata for ${chapterFile.name}" }
}
}
}