This commit is contained in:
jxxghp
2024-04-19 12:31:38 +08:00
parent 148984ad0e
commit 0679a32659
5 changed files with 15 additions and 13 deletions

View File

@ -15,7 +15,6 @@ from app.db import get_db
from app.db.models.user import User from app.db.models.user import User
from app.log import logger from app.log import logger
from app.utils.web import WebUtils from app.utils.web import WebUtils
from app.utils.otp import OtpUtils
router = APIRouter() router = APIRouter()

View File

@ -1,4 +1,3 @@
import json
from typing import Union, Any, List from typing import Union, Any, List
from fastapi import APIRouter, BackgroundTasks, Depends from fastapi import APIRouter, BackgroundTasks, Depends

View File

@ -550,16 +550,13 @@ class MetaBase(object):
self.year = meta.year self.year = meta.year
# 季 # 季
if (self.type == MediaType.TV if (self.type == MediaType.TV
and not self.begin_season): and self.begin_season is None):
if self.begin_season is None and meta.begin_season is not None: self.begin_season = meta.begin_season
self.begin_season = meta.begin_season self.end_season = meta.end_season
if self.end_season is None and meta.end_season is not None: self.total_season = meta.total_season
self.end_season = meta.end_season
if self.total_season is None and meta.total_season is not None:
self.total_season = meta.total_season
# 开始集 # 开始集
if (self.type == MediaType.TV if (self.type == MediaType.TV
and not self.begin_episode): and self.begin_episode is None):
self.begin_episode = meta.begin_episode self.begin_episode = meta.begin_episode
self.end_episode = meta.end_episode self.end_episode = meta.end_episode
self.total_episode = meta.total_episode self.total_episode = meta.total_episode

View File

@ -1,6 +1,6 @@
from datetime import datetime from datetime import datetime
from sqlalchemy import Boolean, Column, Integer, String, Sequence from sqlalchemy import Column, Integer, String, Sequence
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from app.db import db_query, db_update, Base from app.db import db_query, db_update, Base

View File

@ -13,6 +13,12 @@ import dateutil.parser
from app.schemas.types import MediaType from app.schemas.types import MediaType
_special_domains = [
'u2.dmhy.org',
'pt.ecust.pp.ua',
]
class StringUtils: class StringUtils:
@staticmethod @staticmethod
@ -257,8 +263,9 @@ class StringUtils:
""" """
if not url: if not url:
return "" return ""
if 'u2.dmhy.org' in url: for domain in _special_domains:
return 'u2.dmhy.org' if domain in url:
return domain
_, netloc = StringUtils.get_url_netloc(url) _, netloc = StringUtils.get_url_netloc(url)
if netloc: if netloc:
locs = netloc.split(".") locs = netloc.split(".")