Skip to content

Commit

Permalink
default to media server 1 for old nh entries
Browse files Browse the repository at this point in the history
  • Loading branch information
az4521 committed Dec 7, 2024
1 parent aa29537 commit 2990a5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class NHentai(context: Context) : HttpSource(), LewdSource<NHentaiSearchMetadata
emptyList()
} else {
metadata.pageImageTypes.mapIndexed { index, s ->
val imageUrl = imageUrlFromType(metadata.mediaId!!, metadata.mediaServer!!, index + 1, s)
val imageUrl = imageUrlFromType(metadata.mediaId!!, metadata.mediaServer ?: 1, index + 1, s)
Page(index, imageUrl!!, imageUrl)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ class NHentaiSearchMetadata : RaisedSearchMetadata() {
override fun copyTo(manga: SManga) {
nhId?.let { manga.url = nhIdToPath(it) }

if (mediaId != null && mediaServer != null) {
if (mediaId != null) {
val server = mediaServer ?: 1
val hqThumbs = Injekt.get<PreferencesHelper>().eh_nh_useHighQualityThumbs().get()
typeToExtension(if (hqThumbs) coverImageType else thumbnailImageType)?.let {
manga.thumbnail_url = "https://t$mediaServer.nhentai.net/galleries/$mediaId/${if (hqThumbs) {
manga.thumbnail_url = "https://t$server.nhentai.net/galleries/$mediaId/${if (hqThumbs) {
"cover"
} else {
"thumb"
Expand Down

0 comments on commit 2990a5e

Please sign in to comment.