Skip to content

Commit

Permalink
Merge pull request #67 from xpadev-net/fix/custom-comment-downloader
Browse files Browse the repository at this point in the history
[修正] コメントダウンロード時にコメント数の指定が機能していなかった不具合を修正
  • Loading branch information
xpadev-net authored Feb 12, 2024
2 parents 08ea6e1 + 7a92817 commit 0451d80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions electron/lib/cookies/chromium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ const getChromiumCookies = async (
db,
`SELECT host_key, name, value, encrypted_value, path, expires_utc, ${secureColumn} FROM cookies`,
)) as chromiumCookies[];
const decryptor = await (process.platform === "win32"
? getWindowsDecryptor
: getMacDecryptor)(profile);
const decryptor = await (
process.platform === "win32" ? getWindowsDecryptor : getMacDecryptor
)(profile);
const cookies: Cookies = {};
for (const row of rows) {
if (row.host_key.match(/\.nicovideo\.jp/)) {
Expand Down
8 changes: 4 additions & 4 deletions electron/lib/niconico/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ const downloadV3V1CustomComment = async (
}),
});
const res = (await req.json()) as unknown;
const threads = (res as V1Raw)?.data?.threads;
if (!NiconiComments.typeGuard.v1.threads(threads))
const thread = (res as V1Raw)?.data?.threads[0];
if (!NiconiComments.typeGuard.v1.thread(thread))
throw new Error("failed to get comments");
threadComments.push(...convertV3ToFormatted(threads, userList));
threadComments.push(...convertV3ToFormatted([thread], userList));
if (option.end.type === "date") {
updateProgress(total * threadTotal, total * threadId + start - when);
} else {
Expand All @@ -172,7 +172,7 @@ const downloadV3V1CustomComment = async (
);
}
if (
threads.length < 5 ||
thread.comments.length < 5 ||
threadComments[threadComments.length - 1]?.id < 5
)
break;
Expand Down

0 comments on commit 0451d80

Please sign in to comment.