fix
This commit is contained in:
@ -15,7 +15,6 @@ from app.db import get_db
|
||||
from app.db.models.user import User
|
||||
from app.log import logger
|
||||
from app.utils.web import WebUtils
|
||||
from app.utils.otp import OtpUtils
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import json
|
||||
from typing import Union, Any, List
|
||||
|
||||
from fastapi import APIRouter, BackgroundTasks, Depends
|
||||
|
@ -550,16 +550,13 @@ class MetaBase(object):
|
||||
self.year = meta.year
|
||||
# 季
|
||||
if (self.type == MediaType.TV
|
||||
and not self.begin_season):
|
||||
if self.begin_season is None and meta.begin_season is not None:
|
||||
self.begin_season = meta.begin_season
|
||||
if self.end_season is None and meta.end_season is not None:
|
||||
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
|
||||
and self.begin_season is None):
|
||||
self.begin_season = meta.begin_season
|
||||
self.end_season = meta.end_season
|
||||
self.total_season = meta.total_season
|
||||
# 开始集
|
||||
if (self.type == MediaType.TV
|
||||
and not self.begin_episode):
|
||||
and self.begin_episode is None):
|
||||
self.begin_episode = meta.begin_episode
|
||||
self.end_episode = meta.end_episode
|
||||
self.total_episode = meta.total_episode
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 app.db import db_query, db_update, Base
|
||||
|
@ -13,6 +13,12 @@ import dateutil.parser
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
|
||||
_special_domains = [
|
||||
'u2.dmhy.org',
|
||||
'pt.ecust.pp.ua',
|
||||
]
|
||||
|
||||
|
||||
class StringUtils:
|
||||
|
||||
@staticmethod
|
||||
@ -257,8 +263,9 @@ class StringUtils:
|
||||
"""
|
||||
if not url:
|
||||
return ""
|
||||
if 'u2.dmhy.org' in url:
|
||||
return 'u2.dmhy.org'
|
||||
for domain in _special_domains:
|
||||
if domain in url:
|
||||
return domain
|
||||
_, netloc = StringUtils.get_url_netloc(url)
|
||||
if netloc:
|
||||
locs = netloc.split(".")
|
||||
|
Reference in New Issue
Block a user