Skip to content

ClipStudioReader: extlib 1.6 - #18134

Open
furaibo9714 wants to merge 2 commits into
keiyoushi:mainfrom
furaibo9714:clipstudioreader-1.6
Open

ClipStudioReader: extlib 1.6#18134
furaibo9714 wants to merge 2 commits into
keiyoushi:mainfrom
furaibo9714:clipstudioreader-1.6

Conversation

@furaibo9714

Copy link
Copy Markdown
Contributor

Checklist:

  • Updated versionCode value in build.gradle.kts
  • Updated baseVersionCode in build.gradle.kts (if updated multisrc theme code)
  • Referenced all related issues in the PR body (e.g. "Closes #xyz")
  • Set the contentWarning configuration in build.gradle.kts appropriately
  • Have not changed source names
  • Have explicitly kept the id if a source's name or language were changed
  • Have tested the modifications by compiling and running the extension through Android Studio
  • Have removed web_hi_res_512.png when adding a new extension
  • This PR is AI-assisted, I have reviewed the changes manually and confirmed they are not slop


override fun headersBuilder() = super.headersBuilder()
.set("Referer", "$baseUrl/")
override fun Headers.Builder.configureHeaders() = add("Referer", "$baseUrl/")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

referer is added by default

// EPUB-based path
val tokenUrl = "$baseUrl/api/tokens/viewer?content_id=$contentId".toHttpUrl()
val tokenResponse = client.newCall(GET(tokenUrl, headers)).execute()
val tokenResponse = client.get(tokenUrl, headers)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

headers are passed implicitly, no need to pass them yourself


val faceResponse = client.newCall(GET(faceUrl, headers)).execute()
val faceResponse = client.get(faceUrl, headers)
if (!faceResponse.isSuccessful) throw Exception("HTTP error ${faceResponse.code} while fetching face.xml")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client.get ensures http success


private val domain = baseUrl.toHttpUrl().host
private val preferences by getPreferencesLazy()
private val rscHeaders = headersBuilder()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private val rscHeaders = headersBuilder()
private val rscHeaders get() = headersBuilder()


override val supportsLatest = true

private val domain = baseUrl.toHttpUrl().host

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private val domain = baseUrl.toHttpUrl().host
private val domain get() = baseUrl.toHttpUrl().host

Comment on lines +38 to +39
addInterceptor(Deobfuscator())
addInterceptor(ImageInterceptor())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call super.configureClient instead

status = if (statusText.contains("完結")) SManga.COMPLETED else SManga.ONGOING
val hideLocked = preferences.getBoolean(HIDE_LOCKED_PREF_KEY, false)

val sManga = if (fetchDetails) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have all the info already, return both unconditionally

}

override fun getFilterList(): FilterList = FilterList(
override fun getFilterList(data: kotlinx.serialization.json.JsonElement?): FilterList = FilterList(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants