fix bug
This commit is contained in:
parent
042d091598
commit
b789bfc979
@ -5,6 +5,7 @@ from sqlalchemy.orm import Session
|
|||||||
|
|
||||||
from app import schemas
|
from app import schemas
|
||||||
from app.chain.media import MediaChain
|
from app.chain.media import MediaChain
|
||||||
|
from app.core.metainfo import MetaInfo
|
||||||
from app.core.security import verify_token
|
from app.core.security import verify_token
|
||||||
from app.db import get_db
|
from app.db import get_db
|
||||||
from app.db.mediaserver_oper import MediaServerOper
|
from app.db.mediaserver_oper import MediaServerOper
|
||||||
@ -51,8 +52,11 @@ def exists(title: str = None,
|
|||||||
"""
|
"""
|
||||||
判断本地是否存在
|
判断本地是否存在
|
||||||
"""
|
"""
|
||||||
|
meta = MetaInfo(title)
|
||||||
|
if not season:
|
||||||
|
season = meta.begin_season
|
||||||
exist = MediaServerOper(db).exists(
|
exist = MediaServerOper(db).exists(
|
||||||
title=title, year=year, mtype=mtype, tmdbid=tmdbid, season=season
|
title=meta.name, year=year, mtype=mtype, tmdbid=tmdbid, season=season
|
||||||
)
|
)
|
||||||
return schemas.Response(success=True if exist else False, data={
|
return schemas.Response(success=True if exist else False, data={
|
||||||
"item": exist or {}
|
"item": exist or {}
|
||||||
|
@ -399,6 +399,11 @@ class MediaInfo:
|
|||||||
# 简介
|
# 简介
|
||||||
if not self.overview:
|
if not self.overview:
|
||||||
self.overview = info.get("intro") or info.get("card_subtitle") or ""
|
self.overview = info.get("intro") or info.get("card_subtitle") or ""
|
||||||
|
# 从简介中提取年份
|
||||||
|
if self.overview and not self.year:
|
||||||
|
match = re.search(r'\d{4}', self.overview)
|
||||||
|
if match:
|
||||||
|
self.year = match.group()
|
||||||
# 导演和演员
|
# 导演和演员
|
||||||
if not self.directors:
|
if not self.directors:
|
||||||
self.directors = info.get("directors") or []
|
self.directors = info.get("directors") or []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user