mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-09-27 00:27:23 +00:00
picacg: re-login if login expires while loading comic information
This commit is contained in:
14
picacg.js
14
picacg.js
@@ -3,7 +3,7 @@ class Picacg extends ComicSource {
|
||||
|
||||
key = "picacg"
|
||||
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
|
||||
minAppVersion = "1.0.0"
|
||||
|
||||
@@ -445,7 +445,17 @@ class Picacg extends ComicSource {
|
||||
})
|
||||
return comics
|
||||
}
|
||||
let [info, eps, related] = await Promise.all([infoLoader(), epsLoader(), relatedLoader()])
|
||||
let info, eps, related
|
||||
try {
|
||||
[info, eps, related] = await Promise.all([infoLoader(), epsLoader(), relatedLoader()])
|
||||
}
|
||||
catch (e) {
|
||||
if (e === 'Invalid status code: 401') {
|
||||
await this.account.reLogin();
|
||||
[info, eps, related] = await Promise.all([infoLoader(), epsLoader(), relatedLoader()]);
|
||||
}
|
||||
throw e
|
||||
}
|
||||
let tags = {}
|
||||
if(info.author) {
|
||||
tags['Author'] = [info.author];
|
||||
|
Reference in New Issue
Block a user