LANraragi: Category fix + Summary (#4692)

* LRR: Drop last_used to fix categories

* LRR: Summary field

Maintain old behavior in case someone relied on it.
Tanks may encourage a standard in the future.
This commit is contained in:
RePod 2024-08-23 01:50:48 -04:00 committed by Draff
parent 89a64d0b80
commit f297323f42
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
3 changed files with 4 additions and 6 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'LANraragi'
extClass = '.LANraragiFactory'
extVersionCode = 17
extVersionCode = 18
}
apply from: "$rootDir/common.gradle"

View File

@ -7,6 +7,7 @@ data class Archive(
val arcid: String,
val isnew: String,
val tags: String?,
val summary: String?,
val title: String,
)
@ -25,7 +26,6 @@ data class ArchiveSearchResult(
@Serializable
data class Category(
val id: String,
val last_used: String,
val name: String,
val pinned: String,
)

View File

@ -242,7 +242,7 @@ open class LANraragi(private val suffix: String = "") : ConfigurableSource, Unme
private fun archiveToSManga(archive: Archive) = SManga.create().apply {
url = "/reader?id=${archive.arcid}"
title = archive.title
description = archive.title
description = if (archive.summary.isNullOrBlank()) archive.title else archive.summary
thumbnail_url = getThumbnailUri(archive.arcid)
genre = archive.tags?.replace(",", ", ")
artist = getArtist(archive.tags)
@ -406,12 +406,10 @@ open class LANraragi(private val suffix: String = "") : ConfigurableSource, Unme
private fun getCategoryPairs(categories: List<Category>): Array<Pair<String?, String>> {
// Empty pair to disable. Sort by pinned status then name for convenience.
// Web client sort is pinned > last_used but reflects between page changes.
val pin = "\uD83D\uDCCC "
// Maintain categories sync for next FilterList reset. If there's demand for it, it's now
// possible to sort by last_used similar to the web client. Maybe an option toggle?
// Maintain categories sync for next FilterList reset.
getCategories()
return listOf(Pair("", ""))