Skip to content

Commit

Permalink
Merge pull request #230 from hjyssg/dev_frontend_0615
Browse files Browse the repository at this point in the history
Bug fixing
  • Loading branch information
hjyssg authored Sep 12, 2023
2 parents cb7927e + d9c21d1 commit bede8f1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/TamperMonkeyScript/EhentaiHighighliger_many_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ async function highlightEhentaiThumbnail() {

e.status = 0;
if (text.includes("翻訳") || text.includes("翻译")) {
return;
continue;
}
const rr = parse(text);
console.log(`${ii}/${nodes.length} ${text}`)
const { status, similarTitles } = await checkIfDownload(text);
e.status = status || 0;
if (status === IS_IN_PC) {
Expand Down
1 change: 1 addition & 0 deletions src/client/AdminPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export default class AdminPage extends Component {

<div className="author-link">
<a className="fab fa-github" title="Aji47's Github" href="https://github.com/hjyssg/ShiguReader" target="_blank"> Created By Aji47 </a>
<img src="/public/favicon-96x96.png"></img>
</div>
</div>)

Expand Down
2 changes: 0 additions & 2 deletions src/client/OneBook.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,6 @@ export default class OneBook extends Component {
}

onImageError() {
// https://stackoverflow.com/questions/5559578/having-links-relative-to-root
this.imgRef.src = "/error_loading.png";
this.hideSpinner()
}

Expand Down
3 changes: 3 additions & 0 deletions src/client/subcomponent/BookImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function BookImage(props, ref) {
const onImageError = (error) => {
console.error(error);
onError && onError();

// https://stackoverflow.com/questions/5559578/having-links-relative-to-root
// this.imgRef.src = "/error_loading.png";
};


Expand Down
16 changes: 11 additions & 5 deletions src/name-parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const sankuri_reg = /^サンクリ.*\d+/;
const reitaisai_reg = /^例大祭.*\d+/;
const tora_reg = /^とら祭り.*\d+/;
const komitore_reg = /^こみトレ.*\d+/;
const reg_list = [comicket_reg, air_comicket_reg, comicket_reg_2, comic_star_reg, love_live_event_reg,
const reg_list = [comicket_reg_2, comicket_reg, air_comicket_reg, comic_star_reg, love_live_event_reg,
comitea_reg, sankuri_reg, reitaisai_reg,
tora_reg, komitore_reg, /みみけっと.*\d+/,
/コミトレ.*\d+/, /FF\d+/, /iDOL SURVIVAL.*\d/i,
Expand Down Expand Up @@ -106,6 +106,16 @@ function getDateFromComiket(comiket) {

if (comiket_to_date_table[comiket]) {
result = comiket_to_date_table[comiket];
} else if (comiket.match(comicket_reg_2)) {
comiket = comiket.replace("C", "");
num = parseInt(comiket);
result = new Date(2022, 8, 13);

year = Math.floor(num / 2) + 2022;
const isSummer = num % 2 === 0;
month = isSummer ? 8 : 11;
const day = isSummer ? 10 : 28;
result = new Date(year, month, day);
} else if (comiket.match(comicket_reg)) {
comiket = comiket.replace("C", "");
num = parseInt(comiket);
Expand All @@ -122,10 +132,6 @@ function getDateFromComiket(comiket) {
} else {
result = new Date(2020, 11, 30);
}
} else if (comiket.match(comicket_reg_2)) {
comiket = comiket.replace("C", "");
num = parseInt(comiket);
result = new Date(2022, 8, 13);
} else if (comiket.match(comic_star_reg)) {
comiket = comiket.replace("COMIC1☆", "");
num = parseInt(comiket);
Expand Down
13 changes: 12 additions & 1 deletion src/test/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,16 @@ describe("name parser", () => {
});

it("tag time calculation", () => {
const C102T = parser
.getDateFromParse("(C102)[ fake_author ] apple")
.getTime();
const C101T = parser
.getDateFromParse("(C101)[ fake_author ] apple")
.getTime();
const C100T = parser
.getDateFromParse("(C100)[ fake_author ] apple")
.getTime();

const C96T = parser
.getDateFromParse("(C96)[ fake_author ] apple")
.getTime();
Expand Down Expand Up @@ -186,7 +193,11 @@ describe("name parser", () => {
assert(C91T > C87T);
assert(C85T > C84T);
assert(C84T > C72T);
assert(C101T > C96T);

assert(C100T > C96T);
assert(C101T > C100T);
assert(C102T > C101T);


const air2 = parser.getDateFromParse("(エアコミケ2) [ちんちん亭 (chin)] 12132").getTime();
assert(air2 > C96T);
Expand Down

0 comments on commit bede8f1

Please sign in to comment.