Skip to content

Commit

Permalink
fix: fix support for thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
hanFengSan committed Nov 7, 2024
1 parent 0da97f8 commit 7f98fda
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
6 changes: 3 additions & 3 deletions core/assets/value/version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
cn: `
* 修复exhentai/ehentai的Labeling支持问题
* 修复exhentai/ehentai的缩略图支持问题
* 目前存在缩略图尺寸自动换为Small的问题, 后续再修复
### iPad支持
Expand All @@ -15,7 +15,7 @@ eHunter-local是eHunter的本地版本, 支持Windows和MacOS. [项目主页](ht
`,
en: `
* Fixed the Labeling support issue of exhentai/ehentai
* Fixed the thumbnail support issue of exhentai/ehentai
* There is currently an issue where the thumbnail size is automatically changed to Small, which will be fixed later.
### Use in iPad
Expand All @@ -30,7 +30,7 @@ The eHunter-local is local version of eHunter, supporting Windows and MacOS. [Ho
`,
jp: `
* exhentai/ehentaiのlabelingの問題を修正しました
* exhentai/ehentaiのthumbnailの問題を修正しました
* 現在、サムネイルのサイズが自動的に「Small」に変更される問題が発生していますが、これは後で修正される予定です。
### Use in iPad
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ehunter",
"version": "2.7.6",
"version": "2.7.7",
"description": "A Vue.js project",
"author": "Alex Chen <c360785655@gmail.com>",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
version: '2.7.6',
version: '2.7.7',
homePage: 'https://github.com/hanFengSan/eHunter',
email: 'c360785655@gmail.com',
updateServer1: 'https://jp.animesales.xyz/ehunter/update.json',
Expand Down
12 changes: 9 additions & 3 deletions src/platform/eh/parser/IntroHtmlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ export class IntroHtmlParser {
}

_getThumbKeyId() {
let key = this.html.querySelector('#gdt')!.children[0].innerHTML.match(/url\(https:.*?\/cm\/.*?\//g)![0]
key = key.replace('url(', '')
let url = this.html.querySelector('#gdt')!.children[0].innerHTML.match(/url\(https.*?\)/g)![0].replace('url(', '').replace(')', '')
let key = url.replace(url.match(/[0-9-]{3,20}\./)![0], '__PLACE_HOLDER__')
// console.log('key', key)
return key
}

Expand All @@ -81,7 +82,12 @@ export class IntroHtmlParser {
let thumbKeyId = this._getThumbKeyId();
let imgList: string[] = [];
for (let i = 0; i < this._getThumbPageCount(sumOfPage); i++) {
imgList.push(`${thumbKeyId}/${albumId}-${i < 10 ? '0' + i : i}.jpg`);
if (thumbKeyId.includes('__PLACE_HOLDER__')) { // new
let url = thumbKeyId.replace('__PLACE_HOLDER__', `${albumId}-${i < 10 ? '0' + i : i}.`)
imgList.push(url);
} else {
imgList.push(`${thumbKeyId}/${albumId}-${i < 10 ? '0' + i : i}.jpg`);
}
}
return imgList;
}
Expand Down
24 changes: 12 additions & 12 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"cn":{
"title":"新版本: v2.7.6",
"version":"2.7.6",
"text":"1. 修复exhentai/ehentai的Labeling支持问题",
"title":"新版本: v2.7.7",
"version":"2.7.7",
"text":"1. 修复exhentai/ehentai的缩略图解析问题",
"time":1690647347098,
"duration":60000,
"duration":3000,
"always":true,
"operations":[
{
Expand All @@ -14,11 +14,11 @@
]
},
"en":{
"title":"New version: v2.7.6",
"version":"2.7.6",
"text":"1. Fixed the Labeling support issue of exhentai/ehentai",
"title":"New version: v2.7.7",
"version":"2.7.7",
"text":"1. Fixed the thumbnail support issue of exhentai/ehentai",
"time":1690647347098,
"duration":60000,
"duration":3000,
"always":true,
"operations":[
{
Expand All @@ -28,11 +28,11 @@
]
},
"jp":{
"title":"新しいバージョン: v2.7.6",
"version":"2.7.6",
"text":"1. exhentai/ehentaiのlabelingの問題を修正しました",
"title":"新しいバージョン: v2.7.7",
"version":"2.7.7",
"text":"1. exhentai/ehentaiのthumbnailの問題を修正しました",
"time":1690647347098,
"duration":60000,
"duration":3000,
"always":true,
"operations":[
{
Expand Down

0 comments on commit 7f98fda

Please sign in to comment.