Compare commits

...

3 Commits

Author SHA1 Message Date
renovate[bot]
1e570bc965
fix(deps): update dependency me.zhanghai.android.libarchive:library to v1.1.1 (#1229)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-17 14:48:00 +06:00
Roshan Varughese
9cc7d42dd9
Re-enable fetching chapters list for entries with licenced status (#1230)
Enable Licensed
2024-09-17 14:47:04 +06:00
MajorTanya
f5c6d2e1a6
Fix Kitsu synopsis nullability (#1233)
This time, the Kitsu API docs are silent on whether this field (or
any other field) can be null/undefined/etc, but it can happen and
caused an error during search and update. This change just ensures the
attribute is nullable and is set to an empty String when it is null.
2024-09-17 14:46:37 +06:00
5 changed files with 8 additions and 22 deletions

View File

@ -2,7 +2,6 @@ package eu.kanade.presentation.util
import android.content.Context import android.content.Context
import eu.kanade.tachiyomi.network.HttpException import eu.kanade.tachiyomi.network.HttpException
import eu.kanade.tachiyomi.source.online.LicensedMangaChaptersException
import eu.kanade.tachiyomi.util.system.isOnline import eu.kanade.tachiyomi.util.system.isOnline
import tachiyomi.core.common.i18n.stringResource import tachiyomi.core.common.i18n.stringResource
import tachiyomi.data.source.NoResultsException import tachiyomi.data.source.NoResultsException
@ -25,7 +24,6 @@ val Throwable.formattedMessage: String
is NoResultsException -> return stringResource(MR.strings.no_results_found) is NoResultsException -> return stringResource(MR.strings.no_results_found)
is SourceNotInstalledException -> return stringResource(MR.strings.loader_not_implemented_error) is SourceNotInstalledException -> return stringResource(MR.strings.loader_not_implemented_error)
is LicensedMangaChaptersException -> return stringResource(MR.strings.licensed_manga_chapters_error)
} }
return when (val className = this::class.simpleName) { return when (val className = this::class.simpleName) {
"Exception", "IOException" -> message ?: className "Exception", "IOException" -> message ?: className

View File

@ -25,7 +25,7 @@ data class KitsuListSearchResult(
title = manga.canonicalTitle title = manga.canonicalTitle
total_chapters = manga.chapterCount ?: 0 total_chapters = manga.chapterCount ?: 0
cover_url = manga.posterImage?.original ?: "" cover_url = manga.posterImage?.original ?: ""
summary = manga.synopsis summary = manga.synopsis ?: ""
tracking_url = KitsuApi.mangaUrl(remote_id) tracking_url = KitsuApi.mangaUrl(remote_id)
publishing_status = manga.status publishing_status = manga.status
publishing_type = manga.mangaType ?: "" publishing_type = manga.mangaType ?: ""
@ -73,7 +73,7 @@ data class KitsuListSearchItemIncludedAttributes(
val chapterCount: Long?, val chapterCount: Long?,
val mangaType: String?, val mangaType: String?,
val posterImage: KitsuSearchItemCover?, val posterImage: KitsuSearchItemCover?,
val synopsis: String, val synopsis: String?,
val startDate: String?, val startDate: String?,
val status: String, val status: String,
) )

View File

@ -32,7 +32,7 @@ jsoup = "org.jsoup:jsoup:1.18.1"
disklrucache = "com.jakewharton:disklrucache:2.0.2" disklrucache = "com.jakewharton:disklrucache:2.0.2"
unifile = "com.github.tachiyomiorg:unifile:e0def6b3dc" unifile = "com.github.tachiyomiorg:unifile:e0def6b3dc"
libarchive = "me.zhanghai.android.libarchive:library:1.1.0" libarchive = "me.zhanghai.android.libarchive:library:1.1.1"
sqlite-framework = { module = "androidx.sqlite:sqlite-framework", version.ref = "sqlite" } sqlite-framework = { module = "androidx.sqlite:sqlite-framework", version.ref = "sqlite" }
sqlite-ktx = { module = "androidx.sqlite:sqlite-ktx", version.ref = "sqlite" } sqlite-ktx = { module = "androidx.sqlite:sqlite-ktx", version.ref = "sqlite" }

View File

@ -647,7 +647,6 @@
<!-- missing prompt after Compose rewrite #7901 --> <!-- missing prompt after Compose rewrite #7901 -->
<string name="no_more_results">No more results</string> <string name="no_more_results">No more results</string>
<string name="no_results_found">No results found</string> <string name="no_results_found">No results found</string>
<string name="licensed_manga_chapters_error">Licensed - No chapters to show</string>
<string name="local_source">Local source</string> <string name="local_source">Local source</string>
<string name="other_source">Other</string> <string name="other_source">Other</string>
<string name="last_used_source">Last used</string> <string name="last_used_source">Last used</string>

View File

@ -251,28 +251,19 @@ abstract class HttpSource : CatalogueSource {
* *
* @param manga the manga to update. * @param manga the manga to update.
* @return the chapters for the manga. * @return the chapters for the manga.
* @throws LicensedMangaChaptersException if a manga is licensed and therefore no chapters are available.
*/ */
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
override suspend fun getChapterList(manga: SManga): List<SChapter> { override suspend fun getChapterList(manga: SManga): List<SChapter> {
if (manga.status == SManga.LICENSED) {
throw LicensedMangaChaptersException()
}
return fetchChapterList(manga).awaitSingle() return fetchChapterList(manga).awaitSingle()
} }
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getChapterList")) @Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getChapterList"))
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> { override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
return if (manga.status != SManga.LICENSED) { return client.newCall(chapterListRequest(manga))
client.newCall(chapterListRequest(manga))
.asObservableSuccess() .asObservableSuccess()
.map { response -> .map { response ->
chapterListParse(response) chapterListParse(response)
} }
} else {
Observable.error(LicensedMangaChaptersException())
}
} }
/** /**
@ -472,5 +463,3 @@ abstract class HttpSource : CatalogueSource {
*/ */
override fun getFilterList() = FilterList() override fun getFilterList() = FilterList()
} }
class LicensedMangaChaptersException : RuntimeException()