mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-31 23:16:54 +00:00
fix
This commit is contained in:
@@ -9,6 +9,7 @@ from typing import List, Tuple, Dict, Any, Optional
|
|||||||
from apscheduler.schedulers.background import BackgroundScheduler
|
from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
from apscheduler.triggers.cron import CronTrigger
|
from apscheduler.triggers.cron import CronTrigger
|
||||||
|
|
||||||
|
from app import schemas
|
||||||
from app.chain.transfer import TransferChain
|
from app.chain.transfer import TransferChain
|
||||||
from app.core.config import settings
|
from app.core.config import settings
|
||||||
from app.core.event import eventmanager, Event
|
from app.core.event import eventmanager, Event
|
||||||
@@ -31,7 +32,7 @@ class MediaSyncDel(_PluginBase):
|
|||||||
# 插件图标
|
# 插件图标
|
||||||
plugin_icon = "mediasyncdel.png"
|
plugin_icon = "mediasyncdel.png"
|
||||||
# 插件版本
|
# 插件版本
|
||||||
plugin_version = "1.5"
|
plugin_version = "1.4"
|
||||||
# 插件作者
|
# 插件作者
|
||||||
plugin_author = "thsrite"
|
plugin_author = "thsrite"
|
||||||
# 作者主页
|
# 作者主页
|
||||||
@@ -110,7 +111,7 @@ class MediaSyncDel(_PluginBase):
|
|||||||
"path": "/delete_history",
|
"path": "/delete_history",
|
||||||
"endpoint": self.delete_history,
|
"endpoint": self.delete_history,
|
||||||
"methods": ["GET"],
|
"methods": ["GET"],
|
||||||
"summary": "删除历史记录"
|
"summary": "删除订阅历史记录"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -125,7 +126,7 @@ class MediaSyncDel(_PluginBase):
|
|||||||
if not historys:
|
if not historys:
|
||||||
return schemas.Response(success=False, message="未找到历史记录")
|
return schemas.Response(success=False, message="未找到历史记录")
|
||||||
# 删除指定记录
|
# 删除指定记录
|
||||||
historys = [h for h in historys if f"{h.get("title")}:{h.get("tmdb_id")}" != key]
|
historys = [h for h in historys if f"{h.get('title')}:{h.get('tmdb_id')}" != key]
|
||||||
self.save_data('history', historys)
|
self.save_data('history', historys)
|
||||||
return schemas.Response(success=True, message="删除成功")
|
return schemas.Response(success=True, message="删除成功")
|
||||||
|
|
||||||
@@ -470,6 +471,7 @@ class MediaSyncDel(_PluginBase):
|
|||||||
for history in historys:
|
for history in historys:
|
||||||
htype = history.get("type")
|
htype = history.get("type")
|
||||||
title = history.get("title")
|
title = history.get("title")
|
||||||
|
tmdb_id = history.get("tmdb_id")
|
||||||
year = history.get("year")
|
year = history.get("year")
|
||||||
season = history.get("season")
|
season = history.get("season")
|
||||||
episode = history.get("episode")
|
episode = history.get("episode")
|
||||||
@@ -567,7 +569,7 @@ class MediaSyncDel(_PluginBase):
|
|||||||
'api': 'plugin/MediaSyncDel/delete_history',
|
'api': 'plugin/MediaSyncDel/delete_history',
|
||||||
'method': 'get',
|
'method': 'get',
|
||||||
'params': {
|
'params': {
|
||||||
'key': f"{title}:{tmdbid}",
|
'key': f"{title}:{tmdb_id}",
|
||||||
'apikey': settings.API_TOKEN
|
'apikey': settings.API_TOKEN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user