fix exists api

This commit is contained in:
jxxghp 2024-01-06 11:20:08 +08:00
parent 9b97e478aa
commit 87111c8736

View File

@ -58,7 +58,12 @@ def exists(title: str = None,
exist: MediaServerItem = MediaServerOper(db).exists( exist: MediaServerItem = MediaServerOper(db).exists(
title=meta.name, year=year, mtype=mtype, tmdbid=tmdbid, season=season title=meta.name, year=year, mtype=mtype, tmdbid=tmdbid, season=season
) )
if not exist: if exist:
ret_info = {
"id": exist.item_id
}
"""
else:
# 服务器是否存在 # 服务器是否存在
mediainfo = MediaInfo() mediainfo = MediaInfo()
mediainfo.from_dict({ mediainfo.from_dict({
@ -75,10 +80,7 @@ def exists(title: str = None,
ret_info = { ret_info = {
"id": exist.itemid "id": exist.itemid
} }
else: """
ret_info = {
"id": exist.item_id
}
return schemas.Response(success=True if exist else False, data={ return schemas.Response(success=True if exist else False, data={
"item": ret_info "item": ret_info
}) })