GravureBlogger: make categories optional (#1401)

* GravureBlogger: make categories optional

* remove author field

only contains source name
This commit is contained in:
AwkwardPeak7 2024-02-19 23:45:53 +05:00 committed by GitHub
parent cc5696dd7a
commit bfe5f4217a
3 changed files with 9 additions and 17 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 1
baseVersionCode = 2

View File

@ -4,12 +4,12 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class BloggerDto(
class BloggerDto(
val feed: BloggerFeedDto,
)
@Serializable
data class BloggerFeedDto(
class BloggerFeedDto(
@SerialName("openSearch\$totalResults") val totalResults: BloggerTextDto,
@SerialName("openSearch\$startIndex") val startIndex: BloggerTextDto,
@SerialName("openSearch\$itemsPerPage") val itemsPerPage: BloggerTextDto,
@ -18,32 +18,26 @@ data class BloggerFeedDto(
)
@Serializable
data class BloggerFeedEntryDto(
class BloggerFeedEntryDto(
val published: BloggerTextDto,
val category: List<BloggerCategoryDto>,
val category: List<BloggerCategoryDto>? = emptyList(),
val title: BloggerTextDto,
val content: BloggerTextDto,
val link: List<BloggerLinkDto>,
val author: List<BloggerAuthorDto>,
)
@Serializable
data class BloggerLinkDto(
class BloggerLinkDto(
val rel: String,
val href: String,
)
@Serializable
data class BloggerCategoryDto(
class BloggerCategoryDto(
val term: String,
)
@Serializable
data class BloggerAuthorDto(
val name: BloggerTextDto,
)
@Serializable
data class BloggerTextDto(
class BloggerTextDto(
@SerialName("\$t") val t: String,
)

View File

@ -1,6 +1,5 @@
package eu.kanade.tachiyomi.multisrc.gravureblogger
import android.annotation.SuppressLint
import android.os.Build
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
@ -23,7 +22,6 @@ import uy.kohesive.injekt.injectLazy
import java.text.SimpleDateFormat
import java.util.Locale
@SuppressLint("ObsoleteSdkInt")
abstract class GravureBlogger(
override val name: String,
override val baseUrl: String,
@ -61,7 +59,7 @@ abstract class GravureBlogger(
setUrlWithoutDomain(entry.link.first { it.rel == "alternate" }.href + "#${entry.published.t}")
title = entry.title.t
thumbnail_url = content.selectFirst("img")?.absUrl("src")
genre = entry.category.joinToString { it.term }
genre = entry.category?.joinToString { it.term }
status = SManga.COMPLETED
update_strategy = UpdateStrategy.ONLY_FETCH_ONCE
initialized = true