Skip to content

Commit

Permalink
Update: for eps == 0 bangumi, get it every time even cached
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdjiji committed Sep 21, 2022
1 parent 613268a commit 8b384f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/get-bgm-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ const getBangumi = async (bgm, cachePath) => {
try {
const read = await JSON.parse(await fs.readFile(savedPath));
if (read.id === bangumi_id) {
return read;
if (read?.eps > 0) {
return read;
}
} else {
throw new Error(`Id not match when trying to load id = ${bangumi_id}`);
}
throw new Error(`Id not match when trying to load id=${bangumi_id}`);
} catch (error) {
// invalid bangumi
console.error(error);
Expand Down

0 comments on commit 8b384f0

Please # to comment.