diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/Suwayomi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/Suwayomi.kt index 11f3738e5..00606b658 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/Suwayomi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/Suwayomi.kt @@ -88,7 +88,12 @@ class Suwayomi(private val context: Context, id: Long) : TrackService(id), Enhan override fun getAcceptedSources(): List = listOf("eu.kanade.tachiyomi.extension.all.tachidesk.Tachidesk") - override suspend fun match(manga: DomainManga): TrackSearch = api.getTrackSearch(manga.url) + override suspend fun match(manga: DomainManga): TrackSearch? = + try { + api.getTrackSearch(manga.url) + } catch (e: Exception) { + null + } override fun isTrackFrom(track: DomainTrack, manga: DomainManga, source: Source?): Boolean = source?.let { accept(it) } == true diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskApi.kt index 73af958c9..91dc7dd0b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskApi.kt @@ -29,7 +29,6 @@ class TachideskApi { .dns(Dns.SYSTEM) // don't use DNS over HTTPS as it breaks IP addressing .build() fun headersBuilder(): Headers.Builder = Headers.Builder().apply { - add("User-Agent", network.defaultUserAgent) if (basePassword.isNotEmpty() && baseLogin.isNotEmpty()) { val credentials = Credentials.basic(baseLogin, basePassword) add("Authorization", credentials) @@ -56,7 +55,7 @@ class TachideskApi { TrackSearch.create(TrackManager.SUWAYOMI).apply { title = manga.title cover_url = "$url/thumbnail" - summary = manga.description + summary = manga.description.orEmpty() tracking_url = url total_chapters = manga.chapterCount.toInt() publishing_status = manga.status diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskDto.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskDto.kt index 5fae55d0c..27aef1af7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskDto.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskDto.kt @@ -5,21 +5,21 @@ import kotlinx.serialization.Serializable @Serializable data class SourceDataClass( val id: String, - val name: String?, - val lang: String?, - val iconUrl: String?, + val name: String, + val lang: String, + val iconUrl: String, /** The Source provides a latest listing */ - val supportsLatest: Boolean?, + val supportsLatest: Boolean, /** The Source implements [ConfigurableSource] */ - val isConfigurable: Boolean?, + val isConfigurable: Boolean, /** The Source class has a @Nsfw annotation */ - val isNsfw: Boolean?, + val isNsfw: Boolean, /** A nicer version of [name] */ - val displayName: String?, + val displayName: String, ) @Serializable @@ -29,33 +29,33 @@ data class MangaDataClass( val url: String, val title: String, - val thumbnailUrl: String, + val thumbnailUrl: String?, val initialized: Boolean, - val artist: String, - val author: String, - val description: String, + val artist: String?, + val author: String?, + val description: String?, val genre: List, val status: String, val inLibrary: Boolean, val inLibraryAt: Long, - val source: SourceDataClass, + val source: SourceDataClass?, - val meta: Map = emptyMap(), + val meta: Map, - val realUrl: String, - var lastFetchedAt: Long, - var chaptersLastFetchedAt: Long, + val realUrl: String?, + val lastFetchedAt: Long?, + val chaptersLastFetchedAt: Long?, val freshData: Boolean, - val unreadCount: Long, - val downloadCount: Long, - val chapterCount: Long, + val unreadCount: Long?, + val downloadCount: Long?, + val chapterCount: Long, // actually is nullable server side, but should be set at this time val lastChapterRead: ChapterDataClass?, - val age: Long, - val chaptersAge: Long, + val age: Long?, + val chaptersAge: Long?, ) @Serializable @@ -93,5 +93,8 @@ data class ChapterDataClass( val pageCount: Int, /** total chapter count, used to calculate if there's a next and prev chapter */ - val chapterCount: Int, + val chapterCount: Int?, + + /** used to store client specific values */ + val meta: Map, )