Skip to content

Commit

Permalink
Trimmed whitespace from notification time strings in tests and parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed Aug 25, 2024
1 parent 706226a commit 50380b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/apis/parser/ajax/notification.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe("notification", () => {
"http://cdn.animevietsub.cc/data/banner/2021/08/31/animevsub-4WKr3mgTnu.jpg",
name: "Hôn Thê Cúc Cu",
chap: "Tập 24_END",
time: " 5 ngày trước",
time: "5 ngày trước",
path: "/phim/kakkou-no-iinazuke-a4260/tap-24end-86965.html",
id: "5606932"
},
Expand All @@ -87,7 +87,7 @@ describe("notification", () => {
"http://cdn.animevietsub.cc/data/banner/2022/04/15/animevsub-wo4DTBXCyd.png",
name: "Summertime Render",
chap: "Tập 25_END",
time: " 6 ngày trước",
time: "6 ngày trước",
path: "/phim/summertime-render-a4504/tap-25end-86906.html",
id: "5589667"
},
Expand All @@ -96,7 +96,7 @@ describe("notification", () => {
"http://cdn.animevietsub.cc/data/banner/2022/07/08/animevsub-gvZ0OWMdaI.jpg",
name: "Yofukashi no Uta",
chap: "Tập 13_END",
time: " 1 tuần trước",
time: "1 tuần trước",
path: "/phim/call-of-the-night-a4536/tap-13end-86895.html",
id: "5581144"
},
Expand All @@ -105,7 +105,7 @@ describe("notification", () => {
"http://cdn.animevietsub.cc/data/banner/2022/09/08/animevsub-MThn4jJ9eT.jpg",
name: "DanMachi IV",
chap: "Tập 11_END",
time: " 1 tuần trước",
time: "1 tuần trước",
path: "/phim/danmachi-iv-a4289/tap-11end-86893.html",
id: "5577127"
},
Expand All @@ -114,7 +114,7 @@ describe("notification", () => {
"http://cdn.animevietsub.cc/data/banner/2022/06/03/animevsub-ixE7rWSfjK.jpg",
name: "Ma Vương Đi Làm Mùa 2",
chap: "Tập 12_END",
time: " 1 tuần trước",
time: "1 tuần trước",
path: "/phim/hataraku-maou-sama-2nd-season-a4257/tap-12end-86892.html",
id: "5573509"
},
Expand All @@ -123,7 +123,7 @@ describe("notification", () => {
"http://cdn.animevietsub.cc/data/banner/2022/06/16/animevsub-WTbLjxxodb.jpg",
name: "Overlord IV",
chap: "Tập 13_END",
time: " 1 tuần trước",
time: "1 tuần trước",
path: "/phim/overlord-iv-a4263/tap-13end-86859.html",
id: "5559895"
}
Expand Down
2 changes: 1 addition & 1 deletion src/apis/parser/ajax/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function AjaxNotification(html: string) {
.find(".notification-text")
.find("strong")
.map((_i, item) => $(item).text())
const time = $item.find(".notification-time").text()
const time = $item.find(".notification-time").text().trim()
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const path = getPathName($item.find("a").attr("href")!)
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand Down

0 comments on commit 50380b5

Please sign in to comment.