Skip to content

Commit

Permalink
Refactor code formatting and clean up JSON settings
Browse files Browse the repository at this point in the history
- Removed trailing commas in `database.d.ts` to improve code consistency.
- Reformatted `.vscode/settings.json` for better readability.
- Adjusted comment and condition formatting in `filter-vchap.ts`.
- Improved string concatenation and formatting in `player-link.ts` and `getInfoTPost.ts`.
- Added a newline in `README.md` for version 1.1.47 section.
  • Loading branch information
tachibana-shin committed Aug 29, 2024
1 parent 9234f00 commit d4fea8c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 37 deletions.
25 changes: 6 additions & 19 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,21 @@
"i18n-ally.keystyle": "flat",
"i18n-ally.localesPaths": ["src/i18n", "src/i18n/messages"],
"i18n-ally.extract.ignoredByFiles": {
"src/components/BrtPlayer.vue": [
"Space",
"Space"
],
"src/pages/[_type-normal]/[value].vue": [
""
],
"src/components/BrtPlayer.vue": ["Space", "Space"],
"src/pages/[_type-normal]/[value].vue": [""],
"src/pages/phim/_season.vue": [
"${nameSeason} (${chaps[0].name} - ${\n chaps[chaps.length - 1].name\n })",
"${name} - ${currentMetaSeason.name} Tập ${currentMetaChap.name}(${seasonId}/${currentMetaChap.id})"
],
"src/pages/tai-khoan/index.vue": [
"bg-dark text-light-9"
],
"src/pages/tai-khoan/index.vue": ["bg-dark text-light-9"],
"src/pages/lich-chieu-phim.vue": [
"\n T{{ dayTextToNum(item.day) }}\n ",
"/{{ item.month }}"
],
"src/pages/news.vue": [
"•\n {{ dayjs(item.time).locale(\"vi\").fromNow() }}\n "
],
"src/pages/tai-khoan/edit-profile.vue": [
"bg-dark text-light-9"
],
"src/pages/tai-khoan/edit-profile.vue": ["bg-dark text-light-9"],
"src/layouts/MainLayout.vue": [
"mailto:[email protected]?subject=Phản hồi ứng dụng web AnimeVsub",
"bg-dark text-light-9",
Expand All @@ -49,12 +40,8 @@
"• {{ t('_maxPage-trang', [data?.maxPage]) }}\n ",
"• {{ t('_maxPage-trang', [data?.maxPage]) }}\n "
],
"src/apis/runs/ajax/rate.ts": [
"${token_name}=${token_value}"
],
"src/components/errors/cloudflare.vue": [
")\n "
],
"src/apis/runs/ajax/rate.ts": ["${token_name}=${token_value}"],
"src/components/errors/cloudflare.vue": [")\n "],
"src/components/errors/domain-strange.vue": [
"\n {{ extensionVersion ?? \""
],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ If you find this project useful please support me through:
## News

### 1.1.47

- Fix regexp `/^\w+0+/` to `/^[^0-9.+_-]+/`

### 1.1.46
Expand All @@ -60,7 +61,6 @@ If you find this project useful please support me through:
- shallow reactive
![image](https://github.com/user-attachments/assets/e1c3bbb9-2add-4e26-af8a-22f1b2dee4c9)


### 1.0.5

- Support skip `opening` and `ending`
Expand Down
20 changes: 10 additions & 10 deletions database.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export type Database = {
isOneToOne: false
referencedRelation: "history"
referencedColumns: ["id"]
},
}
]
}
history: {
Expand Down Expand Up @@ -105,7 +105,7 @@ export type Database = {
isOneToOne: false
referencedRelation: "chaps"
referencedColumns: ["id"]
},
}
]
}
movies: {
Expand Down Expand Up @@ -149,7 +149,7 @@ export type Database = {
isOneToOne: false
referencedRelation: "playlist"
referencedColumns: ["id"]
},
}
]
}
notify: {
Expand Down Expand Up @@ -184,7 +184,7 @@ export type Database = {
isOneToOne: false
referencedRelation: "users"
referencedColumns: ["id"]
},
}
]
}
notify_chap: {
Expand Down Expand Up @@ -219,7 +219,7 @@ export type Database = {
isOneToOne: false
referencedRelation: "notify"
referencedColumns: ["id"]
},
}
]
}
playlist: {
Expand Down Expand Up @@ -257,7 +257,7 @@ export type Database = {
isOneToOne: false
referencedRelation: "users"
referencedColumns: ["id"]
},
}
]
}
users: {
Expand Down Expand Up @@ -617,7 +617,7 @@ export type Tables<
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
Database[PublicTableNameOrOptions["schema"]]["Views"])
: never = never,
: never = never
> = PublicTableNameOrOptions extends { schema: keyof Database }
? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
Expand All @@ -641,7 +641,7 @@ export type TablesInsert<
| { schema: keyof Database },
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
: never = never,
: never = never
> = PublicTableNameOrOptions extends { schema: keyof Database }
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
Insert: infer I
Expand All @@ -662,7 +662,7 @@ export type TablesUpdate<
| { schema: keyof Database },
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
: never = never,
: never = never
> = PublicTableNameOrOptions extends { schema: keyof Database }
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
Update: infer U
Expand All @@ -683,7 +683,7 @@ export type Enums<
| { schema: keyof Database },
EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
: never = never,
: never = never
> = PublicEnumNameOrOptions extends { schema: keyof Database }
? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
Expand Down
7 changes: 5 additions & 2 deletions scripts/filter-vchap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ while (true) {
console.log("Done %i / %i (%s)", i, rows?.length, row.season)
allFailure = false
} catch (err) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((err as unknown as any)?.message === "Can't find chap" && REMOVE_ROW_LOSS) {

if (
(err as unknown as any)?.message === "Can't find chap" &&

Check warning on line 48 in scripts/filter-vchap.ts

View workflow job for this annotation

GitHub Actions / Run eslint scanning

Unexpected any. Specify a different type
REMOVE_ROW_LOSS
) {
await supabase
.from("history")
.delete()
Expand Down
4 changes: 2 additions & 2 deletions src/apis/parser/__helpers__/getInfoTPost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ export function getInfoTPost(cheerio: Cheerio<Element>, now: number) {
genre,
time_release:
timeschedule.length > 0
? (countdown === undefined
? ((countdown === undefined
? undefined
: Math.round(now / 1e3 + countdown) * 1e3) ?? null
: Math.round(now / 1e3 + countdown) * 1e3) ?? null)
: undefined
}
}
6 changes: 3 additions & 3 deletions src/apis/runs/ajax/player-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ export function PlayerLink(config: {
item.file = addProtocolUrl(item.file)
} else {
await init()
item.file = `data:application/vnd.apple.mpegurl;base64,${btoa((
( await decryptM3u8(item.file) )
))}`;
item.file = `data:application/vnd.apple.mpegurl;base64,${btoa(
await decryptM3u8(item.file)
)}`

item.label = "HD"
item.preload = "auto"
Expand Down

0 comments on commit d4fea8c

Please sign in to comment.