Skip to content

Commit

Permalink
🎨 [annict] syobocalをLastUpdate降順で拾う
Browse files Browse the repository at this point in the history
放送予定が後ほど更新された場合に違う作品が出る
  • Loading branch information
ci7lus committed Oct 11, 2021
1 parent 996316b commit 289ff6d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/miraktest-annict/findWork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ export const detectProgramInfo = async ({
Range: StTime + endTime.format("YYYYMMDD_HHmmss"),
JOIN: ["SubTitles"],
})
const syobocalProgram = lookup.find(
(sprogram) =>
program?.startAt ||
(dayjs().isAfter(sprogram.StTime) && dayjs().isBefore(sprogram.EdTime))
)
const syobocalProgram = lookup
// LastUpdate降順
.reverse()
.find(
(sprogram) =>
program?.startAt ||
(dayjs().isAfter(sprogram.StTime) &&
dayjs().isBefore(sprogram.EdTime))
)
if (syobocalProgram) {
/*const arm = await axios.get<{ annict_id?: number }>(
"https://arm.kawaiioverflow.com/api/ids",
Expand Down

0 comments on commit 289ff6d

Please sign in to comment.