Skip to content

Commit 1cb15ca

Browse files
authored
Merge pull request #777 from EstrellaXD/3.1-dev
3.1.14
2 parents f47f77d + 66518fd commit 1cb15ca

33 files changed

Lines changed: 9030 additions & 6601 deletions

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,3 @@ dev-dist
216216

217217
# test file
218218
test.*
219-
test_*

backend/src/module/models/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from os.path import expandvars
22
from typing import Literal
33

4-
from pydantic import BaseModel, Field
4+
from pydantic import BaseModel, Field, validator
55

66

77
class Program(BaseModel):
@@ -102,6 +102,12 @@ class ExperimentalOpenAI(BaseModel):
102102
"", description="Azure OpenAI deployment id, ignored when api type is openai"
103103
)
104104

105+
@validator("api_base")
106+
def validate_api_base(cls, value: str):
107+
if value == "https://api.openai.com/":
108+
return "https://api.openai.com/v1"
109+
return value
110+
105111

106112
class Config(BaseModel):
107113
program: Program = Program()

backend/src/module/parser/analyser/torrent_parser.py

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -69,36 +69,37 @@ def torrent_parser(
6969
file_type: str = "media",
7070
) -> EpisodeFile | SubtitleFile:
7171
media_path = get_path_basename(torrent_path)
72-
for rule in RULES:
73-
if torrent_name:
74-
match_obj = re.match(rule, torrent_name, re.I)
75-
else:
76-
match_obj = re.match(rule, media_path, re.I)
77-
if match_obj:
78-
group, title = get_group(match_obj.group(1))
79-
if not season:
80-
title, season = get_season_and_title(title)
81-
else:
82-
title, _ = get_season_and_title(title)
83-
episode = int(match_obj.group(2))
84-
suffix = Path(torrent_path).suffix
85-
if file_type == "media":
86-
return EpisodeFile(
87-
media_path=torrent_path,
88-
group=group,
89-
title=title,
90-
season=season,
91-
episode=episode,
92-
suffix=suffix,
93-
)
94-
elif file_type == "subtitle":
95-
language = get_subtitle_lang(media_path)
96-
return SubtitleFile(
97-
media_path=torrent_path,
98-
group=group,
99-
title=title,
100-
season=season,
101-
language=language,
102-
episode=episode,
103-
suffix=suffix,
104-
)
72+
match_names = [torrent_name, media_path]
73+
if torrent_name is None:
74+
match_names = match_names[1:]
75+
for match_name in match_names:
76+
for rule in RULES:
77+
match_obj = re.match(rule, match_name, re.I)
78+
if match_obj:
79+
group, title = get_group(match_obj.group(1))
80+
if not season:
81+
title, season = get_season_and_title(title)
82+
else:
83+
title, _ = get_season_and_title(title)
84+
episode = int(match_obj.group(2))
85+
suffix = Path(torrent_path).suffix
86+
if file_type == "media":
87+
return EpisodeFile(
88+
media_path=torrent_path,
89+
group=group,
90+
title=title,
91+
season=season,
92+
episode=episode,
93+
suffix=suffix,
94+
)
95+
elif file_type == "subtitle":
96+
language = get_subtitle_lang(media_path)
97+
return SubtitleFile(
98+
media_path=torrent_path,
99+
group=group,
100+
title=title,
101+
season=season,
102+
language=language,
103+
episode=episode,
104+
suffix=suffix,
105+
)

webui/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"@vueuse/components": "^10.4.1",
2323
"@vueuse/core": "^8.9.4",
2424
"axios": "^0.27.2",
25-
"lodash": "^4.17.21",
2625
"naive-ui": "^2.34.4",
2726
"pinia": "^2.1.3",
2827
"rxjs": "^7.8.1",
@@ -42,19 +41,19 @@
4241
"@storybook/testing-library": "0.0.14-next.2",
4342
"@storybook/vue3": "^7.0.12",
4443
"@storybook/vue3-vite": "^7.0.12",
45-
"@types/lodash": "^4.14.194",
4644
"@types/node": "^18.16.14",
4745
"@unocss/preset-attributify": "^0.55.3",
4846
"@unocss/preset-rem-to-px": "^0.51.13",
4947
"@unocss/reset": "^0.51.13",
50-
"@vitejs/plugin-vue": "^4.2.0",
48+
"@vitejs/plugin-vue": "^4.2.3",
5149
"@vitejs/plugin-vue-jsx": "^3.1.0",
5250
"@vue/runtime-dom": "^3.3.4",
5351
"eslint": "^8.41.0",
5452
"eslint-config-prettier": "^8.8.0",
5553
"eslint-plugin-storybook": "^0.6.12",
5654
"husky": "^8.0.3",
5755
"prettier": "^2.8.8",
56+
"radash": "^12.1.0",
5857
"sass": "^1.62.1",
5958
"storybook": "^7.0.12",
6059
"typescript": "^4.9.5",

0 commit comments

Comments
 (0)