Merge remote-tracking branch 'origin/development' into development

This commit is contained in:
morpheus65535 2025-03-05 09:13:55 -05:00
commit fdc80ed63e
9 changed files with 82 additions and 60 deletions

View file

@ -177,28 +177,41 @@ class ZimukuProvider(Provider):
] # remove ext because it can be an archive type
language = Language("eng")
language_list = []
for img in sub.find("td", class_="tac lang").find_all("img"):
if (
"china" in img.attrs["src"]
and "hongkong" in img.attrs["src"]
):
language = Language("zho").add(Language('zho', 'TW', None))
logger.debug("language:" + str(language))
language = Language("zho").add(Language('zho', 'TW', None))
language_list.append(language)
elif (
"china" in img.attrs["src"]
or "jollyroger" in img.attrs["src"]
):
logger.debug("language chinese simplified found: " + str(language))
language = Language("zho")
language_list.append(language)
elif "hongkong" in img.attrs["src"]:
logger.debug("language chinese traditional found: " + str(language))
language = Language('zho', 'TW', None)
break
language_list.append(language)
sub_page_link = urljoin(self.server_url, a.attrs["href"])
backup_session = copy.deepcopy(self.session)
backup_session.headers["Referer"] = link
subs.append(
self.subtitle_class(language, sub_page_link, name, backup_session, year)
)
# Mark each language of the subtitle as its own subtitle, and add it to the list, when handling archives or subtitles
# with multiple languages to ensure each language is identified as its own subtitle since they are the same archive file
# but will have its own file when downloaded and extracted.
for language in language_list:
subs.append(
self.subtitle_class(language, sub_page_link, name, backup_session, year)
)
return subs

View file

@ -9,12 +9,12 @@
"version": "1.0.0",
"license": "GPL-3",
"dependencies": {
"@mantine/core": "^7.16.3",
"@mantine/dropzone": "^7.16.3",
"@mantine/form": "^7.16.3",
"@mantine/hooks": "^7.16.3",
"@mantine/modals": "^7.16.3",
"@mantine/notifications": "^7.16.3",
"@mantine/core": "^7.17.0",
"@mantine/dropzone": "^7.17.0",
"@mantine/form": "^7.17.0",
"@mantine/hooks": "^7.17.0",
"@mantine/modals": "^7.17.0",
"@mantine/notifications": "^7.17.0",
"@tanstack/react-query": "^5.64.1",
"@tanstack/react-table": "^8.19.2",
"axios": "^1.7.4",
@ -2785,9 +2785,9 @@
}
},
"node_modules/@mantine/core": {
"version": "7.16.3",
"resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.16.3.tgz",
"integrity": "sha512-cxhIpfd2i0Zmk9TKdejYAoIvWouMGhzK3OOX+VRViZ5HEjnTQCGl2h3db56ThqB6NfVPCno6BPbt5lwekTtmuQ==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.17.0.tgz",
"integrity": "sha512-AU5UFewUNzBCUXIq5Jk6q402TEri7atZW61qHW6P0GufJ2W/JxGHRvgmHOVHTVIcuWQRCt9SBSqZoZ/vHs9LhA==",
"license": "MIT",
"dependencies": {
"@floating-ui/react": "^0.26.28",
@ -2798,7 +2798,7 @@
"type-fest": "^4.27.0"
},
"peerDependencies": {
"@mantine/hooks": "7.16.3",
"@mantine/hooks": "7.17.0",
"react": "^18.x || ^19.x",
"react-dom": "^18.x || ^19.x"
}
@ -2815,24 +2815,24 @@
}
},
"node_modules/@mantine/dropzone": {
"version": "7.16.3",
"resolved": "https://registry.npmjs.org/@mantine/dropzone/-/dropzone-7.16.3.tgz",
"integrity": "sha512-JWKmRMuV0DfgIQWvvtRfokaIopezg2AwxxcXrHs5xxxN1EfiTQWB+aQjz0ISwcAk1gtjLEKHowqsBNbna+BEKw==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@mantine/dropzone/-/dropzone-7.17.0.tgz",
"integrity": "sha512-1BGOH/Fs1xxsVl6JUxFAElwqdmtj1nrzc7QSV3vs3xh7zAIAH6wqeor8j8+yycxz4lCfehHSaVAyDDv3AFsX8w==",
"license": "MIT",
"dependencies": {
"react-dropzone-esm": "15.2.0"
},
"peerDependencies": {
"@mantine/core": "7.16.3",
"@mantine/hooks": "7.16.3",
"@mantine/core": "7.17.0",
"@mantine/hooks": "7.17.0",
"react": "^18.x || ^19.x",
"react-dom": "^18.x || ^19.x"
}
},
"node_modules/@mantine/form": {
"version": "7.16.3",
"resolved": "https://registry.npmjs.org/@mantine/form/-/form-7.16.3.tgz",
"integrity": "sha512-GqomUG2Ri5adxYsTU1S5IhKRPcqTG5JkPvMERns8PQAcUz/lvzsnk3wY1v4K5CEbCAdpimle4bSsZTM9g697vg==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@mantine/form/-/form-7.17.0.tgz",
"integrity": "sha512-LONdeb+wL8h9fvyQ339ZFLxqrvYff+b+H+kginZhnr45OBTZDLXNVAt/YoKVFEkynF9WDJjdBVrXKcOZvPgmrA==",
"license": "MIT",
"dependencies": {
"fast-deep-equal": "^3.1.3",
@ -2843,46 +2843,46 @@
}
},
"node_modules/@mantine/hooks": {
"version": "7.16.3",
"resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.16.3.tgz",
"integrity": "sha512-B94FBWk5Sc81tAjV+B3dGh/gKzfqzpzVC/KHyBRWOOyJRqeeRbI/FAaJo4zwppyQo1POSl5ArdyjtDRrRIj2SQ==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.17.0.tgz",
"integrity": "sha512-vo3K49mLy1nJ8LQNb5KDbJgnX0xwt3Y8JOF3ythjB5LEFMptdLSSgulu64zj+QHtzvffFCsMb05DbTLLpVP/JQ==",
"license": "MIT",
"peerDependencies": {
"react": "^18.x || ^19.x"
}
},
"node_modules/@mantine/modals": {
"version": "7.16.3",
"resolved": "https://registry.npmjs.org/@mantine/modals/-/modals-7.16.3.tgz",
"integrity": "sha512-BJuDzRugK6xLbuFTTo8NLJumVvVmSYsNVcEtmlXOWTE3NkDGktBXGKo8V1B0XfJ9/d/rZw7HCE0p4i76MtA+bQ==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@mantine/modals/-/modals-7.17.0.tgz",
"integrity": "sha512-4sfiFxIxMxfm2RH4jXMN+cr8tFS5AexXG4TY7TRN/ySdkiWtFVvDe5l2/KRWWeWwDUb7wQhht8Ompj5KtexlEA==",
"license": "MIT",
"peerDependencies": {
"@mantine/core": "7.16.3",
"@mantine/hooks": "7.16.3",
"@mantine/core": "7.17.0",
"@mantine/hooks": "7.17.0",
"react": "^18.x || ^19.x",
"react-dom": "^18.x || ^19.x"
}
},
"node_modules/@mantine/notifications": {
"version": "7.16.3",
"resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-7.16.3.tgz",
"integrity": "sha512-wtEME9kSYfXWYmAmQUZ8c+rwNmhdWRBaW1mlPdQsPkzMqkv4q6yy0IpgwcnuHStSG9EHaQBXazmVxMZJdEAWBQ==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-7.17.0.tgz",
"integrity": "sha512-xejr1WW02NrrrE4HPDoownILJubcjLLwCDeTk907ZeeHKBEPut7RukEq6gLzOZBhNhKdPM+vCM7GcbXdaLZq/Q==",
"license": "MIT",
"dependencies": {
"@mantine/store": "7.16.3",
"@mantine/store": "7.17.0",
"react-transition-group": "4.4.5"
},
"peerDependencies": {
"@mantine/core": "7.16.3",
"@mantine/hooks": "7.16.3",
"@mantine/core": "7.17.0",
"@mantine/hooks": "7.17.0",
"react": "^18.x || ^19.x",
"react-dom": "^18.x || ^19.x"
}
},
"node_modules/@mantine/store": {
"version": "7.16.3",
"resolved": "https://registry.npmjs.org/@mantine/store/-/store-7.16.3.tgz",
"integrity": "sha512-6M2M5+0BrRtnVv+PUmr04tY1RjPqyapaHplo90uK1NMhP/1EIqrwTL9KoEtCNCJ5pog1AQtu0bj0QPbqUvxwLg==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@mantine/store/-/store-7.17.0.tgz",
"integrity": "sha512-nhWRYRLqvAjrD/ApKCXxuHyTWg2b5dC06Z5gmO8udj4pBgndNf9nmCl+Of90H6bgOa56moJA7UQyXoF1SfxqVg==",
"license": "MIT",
"peerDependencies": {
"react": "^18.x || ^19.x"

View file

@ -13,12 +13,12 @@
},
"private": true,
"dependencies": {
"@mantine/core": "^7.16.3",
"@mantine/dropzone": "^7.16.3",
"@mantine/form": "^7.16.3",
"@mantine/hooks": "^7.16.3",
"@mantine/modals": "^7.16.3",
"@mantine/notifications": "^7.16.3",
"@mantine/core": "^7.17.0",
"@mantine/dropzone": "^7.17.0",
"@mantine/form": "^7.17.0",
"@mantine/hooks": "^7.17.0",
"@mantine/modals": "^7.17.0",
"@mantine/notifications": "^7.17.0",
"@tanstack/react-query": "^5.64.1",
"@tanstack/react-table": "^8.19.2",
"axios": "^1.7.4",

View file

@ -28,11 +28,11 @@ const FrameRateForm: FunctionComponent<Props> = ({ selections, onSubmit }) => {
},
validate: {
from: FormUtils.validation(
(value) => value > 0,
(value: number) => value > 0,
"The From value must be larger than 0",
),
to: FormUtils.validation(
(value) => value > 0,
(value: number) => value > 0,
"The To value must be larger than 0",
),
},

View file

@ -114,10 +114,10 @@ const MovieUploadForm: FunctionComponent<Props> = ({
})),
},
validate: {
files: FormUtils.validation((values) => {
files: FormUtils.validation((values: SubtitleFile[]) => {
return (
values.find(
(v) =>
(v: SubtitleFile) =>
v.language === null ||
v.validateResult === undefined ||
v.validateResult.state === "error",

View file

@ -70,10 +70,10 @@ const ProfileEditForm: FunctionComponent<Props> = ({
initialValues: profile,
validate: {
name: FormUtils.validation(
(value) => value.length > 0,
(value: string) => value.length > 0,
"Must have a name",
),
tag: FormUtils.validation((value) => {
tag: FormUtils.validation((value: string | undefined) => {
if (!value) {
return true;
}
@ -81,7 +81,7 @@ const ProfileEditForm: FunctionComponent<Props> = ({
return /^[a-z_0-9-]+$/.test(value);
}, "Only lowercase alphanumeric characters, underscores (_) and hyphens (-) are allowed"),
items: FormUtils.validation(
(value) => value.length > 0,
(value: Language.ProfileItem[]) => value.length > 0,
"Must contain at least 1 language",
),
},

View file

@ -128,9 +128,9 @@ const SeriesUploadForm: FunctionComponent<Props> = ({
},
validate: {
files: FormUtils.validation(
(values) =>
(values: SubtitleFile[]) =>
values.find(
(v) =>
(v: SubtitleFile) =>
v.language === null ||
v.episode === null ||
v.validateResult === undefined ||

View file

@ -32,11 +32,20 @@ const TimeOffsetForm: FunctionComponent<Props> = ({ selections, onSubmit }) => {
ms: 0,
},
validate: {
hour: FormUtils.validation((v) => v >= 0, "Hour must be larger than 0"),
min: FormUtils.validation((v) => v >= 0, "Minute must be larger than 0"),
sec: FormUtils.validation((v) => v >= 0, "Second must be larger than 0"),
hour: FormUtils.validation(
(v: number) => v >= 0,
"Hour must be larger than 0",
),
min: FormUtils.validation(
(v: number) => v >= 0,
"Minute must be larger than 0",
),
sec: FormUtils.validation(
(v: number) => v >= 0,
"Second must be larger than 0",
),
ms: FormUtils.validation(
(v) => v >= 0,
(v: number) => v >= 0,
"Millisecond must be larger than 0",
),
},

View file

@ -57,7 +57,7 @@ const NotificationForm: FunctionComponent<Props> = ({
"Please select a notification provider",
),
url: FormUtils.validation(
(value) => value.trim().length !== 0,
(value: string) => value.trim().length !== 0,
"URL must not be empty",
),
},