Merge pull request #197 from thsrite/main
This commit is contained in:
commit
2a455becc7
@ -24,3 +24,7 @@ class PluginData(Base):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def del_plugin_data_by_key(db: Session, plugin_id: str, key: str):
|
def del_plugin_data_by_key(db: Session, plugin_id: str, key: str):
|
||||||
return db.query(PluginData).filter(PluginData.plugin_id == plugin_id, PluginData.key == key).delete()
|
return db.query(PluginData).filter(PluginData.plugin_id == plugin_id, PluginData.key == key).delete()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_plugin_data_by_plugin_id(db: Session, plugin_id: str):
|
||||||
|
return db.query(PluginData).filter(PluginData.plugin_id == plugin_id).all()
|
||||||
|
@ -57,3 +57,10 @@ class PluginDataOper(DbOper):
|
|||||||
清空插件数据
|
清空插件数据
|
||||||
"""
|
"""
|
||||||
PluginData.truncate(self._db)
|
PluginData.truncate(self._db)
|
||||||
|
|
||||||
|
def get_data_all(self, plugin_id: str) -> Any:
|
||||||
|
"""
|
||||||
|
获取插件所有数据
|
||||||
|
:param plugin_id: 插件id
|
||||||
|
"""
|
||||||
|
return PluginData.get_plugin_data_by_plugin_id(self._db, plugin_id)
|
||||||
|
@ -74,3 +74,9 @@ class TransferHistoryOper(DbOper):
|
|||||||
清空转移记录
|
清空转移记录
|
||||||
"""
|
"""
|
||||||
TransferHistory.truncate(self._db)
|
TransferHistory.truncate(self._db)
|
||||||
|
|
||||||
|
def add_force(self, **kwargs):
|
||||||
|
"""
|
||||||
|
新增转移历史
|
||||||
|
"""
|
||||||
|
return TransferHistory(**kwargs).create(self._db)
|
@ -261,7 +261,7 @@ class DirMonitor(_PluginBase):
|
|||||||
episode=file_meta.episode,
|
episode=file_meta.episode,
|
||||||
tmdbid=mediainfo.tmdb_id)
|
tmdbid=mediainfo.tmdb_id)
|
||||||
# 新增转移成功历史记录
|
# 新增转移成功历史记录
|
||||||
self.transferhis.add(
|
self.transferhis.add_force(
|
||||||
src=event_path,
|
src=event_path,
|
||||||
dest=str(transferinfo.target_path),
|
dest=str(transferinfo.target_path),
|
||||||
mode=settings.TRANSFER_TYPE,
|
mode=settings.TRANSFER_TYPE,
|
||||||
|
@ -512,23 +512,20 @@ class MediaSyncDel(_PluginBase):
|
|||||||
year = transferhis.year
|
year = transferhis.year
|
||||||
# 删除种子任务
|
# 删除种子任务
|
||||||
if self._del_source:
|
if self._del_source:
|
||||||
del_source = False
|
# 1、直接删除源文件
|
||||||
|
if transferhis.src and Path(transferhis.src).suffix in settings.RMT_MEDIAEXT:
|
||||||
|
source_name = os.path.basename(transferhis.src)
|
||||||
|
source_path = str(transferhis.src).replace(source_name, "")
|
||||||
|
self.delete_media_file(filedir=source_path,
|
||||||
|
filename=source_name)
|
||||||
if transferhis.download_hash:
|
if transferhis.download_hash:
|
||||||
try:
|
try:
|
||||||
# 判断种子是否被删除完
|
# 2、判断种子是否被删除完
|
||||||
self.handle_torrent(history_id=transferhis.id,
|
self.handle_torrent(history_id=transferhis.id,
|
||||||
src=transferhis.src,
|
src=transferhis.src,
|
||||||
torrent_hash=transferhis.download_hash)
|
torrent_hash=transferhis.download_hash)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("删除种子失败,尝试删除源文件:%s" % str(e))
|
logger.error("删除种子失败,尝试删除源文件:%s" % str(e))
|
||||||
del_source = True
|
|
||||||
|
|
||||||
# 直接删除源文件
|
|
||||||
if del_source:
|
|
||||||
source_name = os.path.basename(transferhis.src)
|
|
||||||
source_path = str(transferhis.src).replace(source_name, "")
|
|
||||||
self.delete_media_file(filedir=source_path,
|
|
||||||
filename=source_name)
|
|
||||||
|
|
||||||
logger.info(f"同步删除 {msg} 完成!")
|
logger.info(f"同步删除 {msg} 完成!")
|
||||||
|
|
||||||
@ -564,8 +561,6 @@ class MediaSyncDel(_PluginBase):
|
|||||||
# 保存历史
|
# 保存历史
|
||||||
self.save_data("history", history)
|
self.save_data("history", history)
|
||||||
|
|
||||||
self.save_data("last_time", datetime.datetime.now())
|
|
||||||
|
|
||||||
def sync_del_by_log(self):
|
def sync_del_by_log(self):
|
||||||
"""
|
"""
|
||||||
emby删除媒体库同步删除历史记录
|
emby删除媒体库同步删除历史记录
|
||||||
@ -593,7 +588,6 @@ class MediaSyncDel(_PluginBase):
|
|||||||
|
|
||||||
# 遍历删除
|
# 遍历删除
|
||||||
for del_media in del_medias:
|
for del_media in del_medias:
|
||||||
del_time = del_media.get("time")
|
|
||||||
# 媒体类型 Movie|Series|Season|Episode
|
# 媒体类型 Movie|Series|Season|Episode
|
||||||
media_type = del_media.get("type")
|
media_type = del_media.get("type")
|
||||||
# 媒体名称 蜀山战纪
|
# 媒体名称 蜀山战纪
|
||||||
@ -661,23 +655,20 @@ class MediaSyncDel(_PluginBase):
|
|||||||
self._transferhis.delete(transferhis.id)
|
self._transferhis.delete(transferhis.id)
|
||||||
# 删除种子任务
|
# 删除种子任务
|
||||||
if self._del_source:
|
if self._del_source:
|
||||||
del_source = False
|
# 1、直接删除源文件
|
||||||
|
if transferhis.src and Path(transferhis.src).suffix in settings.RMT_MEDIAEXT:
|
||||||
|
source_name = os.path.basename(transferhis.src)
|
||||||
|
source_path = str(transferhis.src).replace(source_name, "")
|
||||||
|
self.delete_media_file(filedir=source_path,
|
||||||
|
filename=source_name)
|
||||||
if transferhis.download_hash:
|
if transferhis.download_hash:
|
||||||
try:
|
try:
|
||||||
# 判断种子是否被删除完
|
# 2、判断种子是否被删除完
|
||||||
self.handle_torrent(history_id=transferhis.id,
|
self.handle_torrent(history_id=transferhis.id,
|
||||||
src=transferhis.src,
|
src=transferhis.src,
|
||||||
torrent_hash=transferhis.download_hash)
|
torrent_hash=transferhis.download_hash)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("删除种子失败,尝试删除源文件:%s" % str(e))
|
logger.error("删除种子失败,尝试删除源文件:%s" % str(e))
|
||||||
del_source = True
|
|
||||||
|
|
||||||
# 直接删除源文件
|
|
||||||
if del_source:
|
|
||||||
source_name = os.path.basename(transferhis.src)
|
|
||||||
source_path = str(transferhis.src).replace(source_name, "")
|
|
||||||
self.delete_media_file(filedir=source_path,
|
|
||||||
filename=source_name)
|
|
||||||
|
|
||||||
logger.info(f"同步删除 {msg} 完成!")
|
logger.info(f"同步删除 {msg} 完成!")
|
||||||
|
|
||||||
|
@ -4,8 +4,11 @@ import sqlite3
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from app.db.downloadhistory_oper import DownloadHistoryOper
|
from app.db.downloadhistory_oper import DownloadHistoryOper
|
||||||
|
from app.db.models.plugin import PluginData
|
||||||
from app.db.plugindata_oper import PluginDataOper
|
from app.db.plugindata_oper import PluginDataOper
|
||||||
from app.db.transferhistory_oper import TransferHistoryOper
|
from app.db.transferhistory_oper import TransferHistoryOper
|
||||||
|
from app.modules.qbittorrent import Qbittorrent
|
||||||
|
from app.modules.transmission import Transmission
|
||||||
from app.plugins import _PluginBase
|
from app.plugins import _PluginBase
|
||||||
from typing import Any, List, Dict, Tuple
|
from typing import Any, List, Dict, Tuple
|
||||||
from app.log import logger
|
from app.log import logger
|
||||||
@ -41,60 +44,60 @@ class NAStoolSync(_PluginBase):
|
|||||||
_nt_db_path = None
|
_nt_db_path = None
|
||||||
_path = None
|
_path = None
|
||||||
_site = None
|
_site = None
|
||||||
_transfer = None
|
|
||||||
_plugin = None
|
|
||||||
_download = None
|
|
||||||
_downloader = None
|
_downloader = None
|
||||||
|
_supp = False
|
||||||
|
qb = None
|
||||||
|
tr = None
|
||||||
|
|
||||||
def init_plugin(self, config: dict = None):
|
def init_plugin(self, config: dict = None):
|
||||||
self._transferhistory = TransferHistoryOper()
|
self._transferhistory = TransferHistoryOper()
|
||||||
self._plugindata = PluginDataOper()
|
self._plugindata = PluginDataOper()
|
||||||
self._downloadhistory = DownloadHistoryOper()
|
self._downloadhistory = DownloadHistoryOper()
|
||||||
|
|
||||||
if config:
|
if config:
|
||||||
self._clear = config.get("clear")
|
self._clear = config.get("clear")
|
||||||
self._nt_db_path = config.get("nt_db_path")
|
self._nt_db_path = config.get("nt_db_path")
|
||||||
self._path = config.get("path")
|
self._path = config.get("path")
|
||||||
self._site = config.get("site")
|
self._site = config.get("site")
|
||||||
self._transfer = config.get("transfer")
|
|
||||||
self._plugin = config.get("plugin")
|
|
||||||
self._downloader = config.get("downloader")
|
self._downloader = config.get("downloader")
|
||||||
self._download = config.get("download")
|
self._supp = config.get("supp")
|
||||||
|
|
||||||
|
if self._nt_db_path:
|
||||||
|
self.qb = Qbittorrent()
|
||||||
|
self.tr = Transmission()
|
||||||
|
|
||||||
if self._nt_db_path and (self._transfer or self._plugin or self._download):
|
|
||||||
# 读取sqlite数据
|
# 读取sqlite数据
|
||||||
gradedb = sqlite3.connect(self._nt_db_path)
|
gradedb = sqlite3.connect(self._nt_db_path)
|
||||||
# 创建游标cursor来执行executeSQL语句
|
# 创建游标cursor来执行executeSQL语句
|
||||||
cursor = gradedb.cursor()
|
cursor = gradedb.cursor()
|
||||||
|
|
||||||
# 转移历史记录
|
download_history = self.get_nt_download_history(cursor)
|
||||||
if self._transfer:
|
plugin_history = self.get_nt_plugin_history(cursor)
|
||||||
transfer_history = self.get_nt_transfer_history(cursor)
|
transfer_history = self.get_nt_transfer_history(cursor)
|
||||||
# 导入历史记录
|
|
||||||
self.sync_transfer_history(transfer_history)
|
|
||||||
# 插件历史记录
|
|
||||||
if self._plugin:
|
|
||||||
plugin_history = self.get_nt_plugin_history(cursor)
|
|
||||||
# 导入插件记录
|
|
||||||
self.sync_plugin_history(plugin_history)
|
|
||||||
# 下载历史记录
|
|
||||||
if self._download:
|
|
||||||
download_history = self.get_nt_download_history(cursor)
|
|
||||||
# 导入下载记录
|
|
||||||
self.sync_download_history(download_history)
|
|
||||||
|
|
||||||
# 关闭游标
|
# 关闭游标
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
|
# 导入下载记录
|
||||||
|
if download_history:
|
||||||
|
self.sync_download_history(download_history)
|
||||||
|
|
||||||
|
# 导入插件记录
|
||||||
|
if plugin_history:
|
||||||
|
self.sync_plugin_history(plugin_history)
|
||||||
|
|
||||||
|
# 导入历史记录
|
||||||
|
if transfer_history:
|
||||||
|
self.sync_transfer_history(transfer_history)
|
||||||
|
|
||||||
self.update_config(
|
self.update_config(
|
||||||
{
|
{
|
||||||
"clear": False,
|
"clear": False,
|
||||||
"nt_db_path": self._nt_db_path,
|
"nt_db_path": "",
|
||||||
"path": self._path,
|
"path": self._path,
|
||||||
"downloader": self._downloader,
|
"downloader": self._downloader,
|
||||||
"site": self._site,
|
"site": self._site,
|
||||||
"transfer": False,
|
"supp": self._supp
|
||||||
"plugin": False,
|
|
||||||
"download": False,
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -231,25 +234,128 @@ class NAStoolSync(_PluginBase):
|
|||||||
logger.info("MoviePilot转移记录已清空")
|
logger.info("MoviePilot转移记录已清空")
|
||||||
self._transferhistory.truncate()
|
self._transferhistory.truncate()
|
||||||
|
|
||||||
|
# 转种后种子hash
|
||||||
|
transfer_hash = []
|
||||||
|
|
||||||
|
# 获取所有的转种数据
|
||||||
|
transfer_datas = self._plugindata.get_data_all("TorrentTransfer")
|
||||||
|
if transfer_datas:
|
||||||
|
if not isinstance(transfer_datas, list):
|
||||||
|
transfer_datas = [transfer_datas]
|
||||||
|
|
||||||
|
for transfer_data in transfer_datas:
|
||||||
|
if not transfer_data or not isinstance(transfer_data, PluginData):
|
||||||
|
continue
|
||||||
|
# 转移后种子hash
|
||||||
|
transfer_value = transfer_data.value
|
||||||
|
transfer_value = json.loads(transfer_value)
|
||||||
|
if not isinstance(transfer_value, dict):
|
||||||
|
transfer_value = json.loads(transfer_value)
|
||||||
|
to_hash = transfer_value.get("to_download_id")
|
||||||
|
# 转移前种子hash
|
||||||
|
transfer_hash.append(to_hash)
|
||||||
|
|
||||||
|
# 获取tr、qb所有种子
|
||||||
|
qb_torrents, _ = self.qb.get_torrents()
|
||||||
|
tr_torrents, _ = self.tr.get_torrents(ids=transfer_hash)
|
||||||
|
tr_torrents_all, _ = self.tr.get_torrents()
|
||||||
|
|
||||||
# 处理数据,存入mp数据库
|
# 处理数据,存入mp数据库
|
||||||
for history in transfer_history:
|
for history in transfer_history:
|
||||||
msrc = history[0]
|
msrc_path = history[0]
|
||||||
mdest = history[1]
|
msrc_filename = history[1]
|
||||||
mmode = history[2]
|
mdest_path = history[2]
|
||||||
mtype = history[3]
|
mdest_filename = history[3]
|
||||||
mcategory = history[4]
|
mmode = history[4]
|
||||||
mtitle = history[5]
|
mtype = history[5]
|
||||||
myear = history[6]
|
mcategory = history[6]
|
||||||
mtmdbid = history[7]
|
mtitle = history[7]
|
||||||
mseasons = history[8]
|
myear = history[8]
|
||||||
mepisodes = history[9]
|
mtmdbid = history[9]
|
||||||
mimage = history[10]
|
mseasons = history[10]
|
||||||
mdownload_hash = history[11]
|
mepisodes = history[11]
|
||||||
mdate = history[12]
|
mimage = history[12]
|
||||||
|
mdownload_hash = history[13]
|
||||||
|
mdate = history[14]
|
||||||
|
|
||||||
if not msrc or not mdest:
|
if not msrc_path or not mdest_path:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
msrc = msrc_path + "/" + msrc_filename
|
||||||
|
mdest = mdest_path + "/" + mdest_filename
|
||||||
|
|
||||||
|
# 尝试补充download_id
|
||||||
|
if self._supp and not mdownload_hash:
|
||||||
|
logger.debug(f"转移记录 {mtitle} 缺失download_hash,尝试补充……")
|
||||||
|
# 种子名称
|
||||||
|
torrent_name = str(msrc_path).split("/")[-1]
|
||||||
|
torrent_name2 = str(msrc_path).split("/")[-2]
|
||||||
|
|
||||||
|
# 处理下载器
|
||||||
|
for torrent in qb_torrents:
|
||||||
|
if str(torrent.get("name")) == str(torrent_name) \
|
||||||
|
or str(torrent.get("name")) == str(torrent_name2):
|
||||||
|
mdownload_hash = torrent.get("hash")
|
||||||
|
torrent_name = str(torrent.get("name"))
|
||||||
|
break
|
||||||
|
|
||||||
|
# 处理辅种器
|
||||||
|
if not mdownload_hash:
|
||||||
|
for torrent in tr_torrents:
|
||||||
|
if str(torrent.get("name")) == str(torrent_name) \
|
||||||
|
or str(torrent.get("name")) == str(torrent_name2):
|
||||||
|
mdownload_hash = torrent.get("hashString")
|
||||||
|
torrent_name = str(torrent.get("name"))
|
||||||
|
break
|
||||||
|
|
||||||
|
# 继续补充 遍历所有种子,按照添加升序升序,第一个种子是初始种子
|
||||||
|
if not mdownload_hash:
|
||||||
|
mate_torrents = []
|
||||||
|
for torrent in tr_torrents_all:
|
||||||
|
if str(torrent.get("name")) == str(torrent_name) \
|
||||||
|
or str(torrent.get("name")) == str(torrent_name2):
|
||||||
|
mate_torrents.append(torrent)
|
||||||
|
|
||||||
|
# 匹配上则按照时间升序
|
||||||
|
if mate_torrents:
|
||||||
|
if len(mate_torrents) > 1:
|
||||||
|
mate_torrents = sorted(mate_torrents, key=lambda x: x.added_date)
|
||||||
|
# 最早添加的hash是下载的hash
|
||||||
|
mdownload_hash = mate_torrents[0].get("hashString")
|
||||||
|
torrent_name = str(mate_torrents[0].get("name"))
|
||||||
|
# 补充转种记录
|
||||||
|
self._plugindata.save(plugin_id="TorrentTransfer",
|
||||||
|
key=f"qbittorrent-{mdownload_hash}",
|
||||||
|
value={
|
||||||
|
"to_download": "transmission",
|
||||||
|
"to_download_id": mdownload_hash,
|
||||||
|
"delete_source": True}
|
||||||
|
)
|
||||||
|
# 补充辅种记录
|
||||||
|
if len(mate_torrents) > 1:
|
||||||
|
self._plugindata.save(plugin_id="IYUUAutoSeed",
|
||||||
|
key=mdownload_hash,
|
||||||
|
value=[{"downloader": "transmission",
|
||||||
|
"torrents": [torrent.get("hashString") for torrent in
|
||||||
|
mate_torrents[1:]]}]
|
||||||
|
)
|
||||||
|
|
||||||
|
# 补充下载历史
|
||||||
|
self._downloadhistory.add(
|
||||||
|
path=msrc_filename,
|
||||||
|
type=mtype,
|
||||||
|
title=mtitle,
|
||||||
|
year=myear,
|
||||||
|
tmdbid=mtmdbid,
|
||||||
|
seasons=mseasons,
|
||||||
|
episodes=mepisodes,
|
||||||
|
image=mimage,
|
||||||
|
download_hash=mdownload_hash,
|
||||||
|
torrent_name=torrent_name,
|
||||||
|
torrent_description="",
|
||||||
|
torrent_site=""
|
||||||
|
)
|
||||||
|
|
||||||
# 处理路径映射
|
# 处理路径映射
|
||||||
if self._path:
|
if self._path:
|
||||||
paths = self._path.split("\n")
|
paths = self._path.split("\n")
|
||||||
@ -259,7 +365,7 @@ class NAStoolSync(_PluginBase):
|
|||||||
mdest = mdest.replace(sub_paths[0], sub_paths[1]).replace('\\', '/')
|
mdest = mdest.replace(sub_paths[0], sub_paths[1]).replace('\\', '/')
|
||||||
|
|
||||||
# 存库
|
# 存库
|
||||||
self._transferhistory.add(
|
self._transferhistory.add_force(
|
||||||
src=msrc,
|
src=msrc,
|
||||||
dest=mdest,
|
dest=mdest,
|
||||||
mode=mmode,
|
mode=mmode,
|
||||||
@ -346,8 +452,10 @@ class NAStoolSync(_PluginBase):
|
|||||||
"""
|
"""
|
||||||
sql = '''
|
sql = '''
|
||||||
SELECT
|
SELECT
|
||||||
t.SOURCE_PATH || '/' || t.SOURCE_FILENAME AS src,
|
t.SOURCE_PATH AS src_path,
|
||||||
t.DEST_PATH || '/' || t.DEST_FILENAME AS dest,
|
t.SOURCE_FILENAME AS src_filename,
|
||||||
|
t.DEST_PATH AS dest_path,
|
||||||
|
t.DEST_FILENAME AS dest_filename,
|
||||||
CASE
|
CASE
|
||||||
t.MODE
|
t.MODE
|
||||||
WHEN '硬链接' THEN
|
WHEN '硬链接' THEN
|
||||||
@ -381,7 +489,7 @@ class NAStoolSync(_PluginBase):
|
|||||||
t.DATE AS date
|
t.DATE AS date
|
||||||
FROM
|
FROM
|
||||||
TRANSFER_HISTORY t
|
TRANSFER_HISTORY t
|
||||||
LEFT JOIN ( SELECT * FROM DOWNLOAD_HISTORY GROUP BY TMDBID ) d ON t.TITLE = d.TITLE
|
LEFT JOIN ( SELECT * FROM DOWNLOAD_HISTORY GROUP BY TMDBID ) d ON t.TMDBID = d.TMDBID
|
||||||
AND t.TYPE = d.TYPE;
|
AND t.TYPE = d.TYPE;
|
||||||
'''
|
'''
|
||||||
cursor.execute(sql)
|
cursor.execute(sql)
|
||||||
@ -395,7 +503,7 @@ class NAStoolSync(_PluginBase):
|
|||||||
return nt_historys
|
return nt_historys
|
||||||
|
|
||||||
def get_state(self) -> bool:
|
def get_state(self) -> bool:
|
||||||
return True if self._transfer or self._plugin or self._download else False
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_command() -> List[Dict[str, Any]]:
|
def get_command() -> List[Dict[str, Any]]:
|
||||||
@ -409,197 +517,163 @@ class NAStoolSync(_PluginBase):
|
|||||||
拼装插件配置页面,需要返回两块数据:1、页面配置;2、数据结构
|
拼装插件配置页面,需要返回两块数据:1、页面配置;2、数据结构
|
||||||
"""
|
"""
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
'component': 'VForm',
|
'component': 'VForm',
|
||||||
'content': [
|
'content': [
|
||||||
{
|
{
|
||||||
'component': 'VRow',
|
'component': 'VRow',
|
||||||
'content': [
|
'content': [
|
||||||
{
|
{
|
||||||
'component': 'VCol',
|
'component': 'VCol',
|
||||||
'props': {
|
'props': {
|
||||||
'cols': 12,
|
'cols': 12,
|
||||||
'md': 3
|
'md': 6
|
||||||
},
|
},
|
||||||
'content': [
|
'content': [
|
||||||
{
|
{
|
||||||
'component': 'VSwitch',
|
'component': 'VSwitch',
|
||||||
'props': {
|
'props': {
|
||||||
'model': 'clear',
|
'model': 'clear',
|
||||||
'label': '清空记录'
|
'label': '清空记录'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'component': 'VCol',
|
'component': 'VCol',
|
||||||
'props': {
|
'props': {
|
||||||
'cols': 12,
|
'cols': 12,
|
||||||
'md': 3
|
'md': 6
|
||||||
},
|
},
|
||||||
'content': [
|
'content': [
|
||||||
{
|
{
|
||||||
'component': 'VSwitch',
|
'component': 'VSwitch',
|
||||||
'props': {
|
'props': {
|
||||||
'model': 'transfer',
|
'model': 'supp',
|
||||||
'label': '转移记录'
|
'label': '补充数据'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
{
|
]
|
||||||
'component': 'VCol',
|
},
|
||||||
'props': {
|
{
|
||||||
'cols': 12,
|
'component': 'VRow',
|
||||||
'md': 3
|
'content': [
|
||||||
},
|
{
|
||||||
'content': [
|
'component': 'VCol',
|
||||||
{
|
'props': {
|
||||||
'component': 'VSwitch',
|
'cols': 12,
|
||||||
'props': {
|
},
|
||||||
'model': 'plugin',
|
'content': [
|
||||||
'label': '插件记录'
|
{
|
||||||
}
|
'component': 'VTextField',
|
||||||
}
|
'props': {
|
||||||
]
|
'model': 'nt_db_path',
|
||||||
},
|
'label': 'NAStool数据库user.db路径',
|
||||||
{
|
}
|
||||||
'component': 'VCol',
|
}
|
||||||
'props': {
|
]
|
||||||
'cols': 12,
|
}
|
||||||
'md': 3
|
]
|
||||||
},
|
},
|
||||||
'content': [
|
{
|
||||||
{
|
'component': 'VRow',
|
||||||
'component': 'VSwitch',
|
'content': [
|
||||||
'props': {
|
{
|
||||||
'model': 'download',
|
'component': 'VCol',
|
||||||
'label': '下载记录'
|
'props': {
|
||||||
}
|
'cols': 12,
|
||||||
}
|
},
|
||||||
]
|
'content': [
|
||||||
},
|
{
|
||||||
]
|
'component': 'VTextarea',
|
||||||
},
|
'props': {
|
||||||
{
|
'model': 'path',
|
||||||
'component': 'VRow',
|
'rows': '2',
|
||||||
'content': [
|
'label': '历史记录路径映射',
|
||||||
{
|
'placeholder': 'NAStool路径:MoviePilot路径(一行一个)'
|
||||||
'component': 'VCol',
|
}
|
||||||
'props': {
|
}
|
||||||
'cols': 12,
|
]
|
||||||
},
|
}
|
||||||
'content': [
|
]
|
||||||
{
|
},
|
||||||
'component': 'VTextField',
|
{
|
||||||
'props': {
|
'component': 'VRow',
|
||||||
'model': 'nt_db_path',
|
'content': [
|
||||||
'label': 'NAStool数据库user.db路径',
|
{
|
||||||
}
|
'component': 'VCol',
|
||||||
}
|
'props': {
|
||||||
]
|
'cols': 12,
|
||||||
}
|
},
|
||||||
]
|
'content': [
|
||||||
},
|
{
|
||||||
{
|
'component': 'VTextarea',
|
||||||
'component': 'VRow',
|
'props': {
|
||||||
'content': [
|
'model': 'downloader',
|
||||||
{
|
'rows': '2',
|
||||||
'component': 'VCol',
|
'label': '插件数据下载器映射',
|
||||||
'props': {
|
'placeholder': 'NAStool下载器id:qbittorrent|transmission(一行一个)'
|
||||||
'cols': 12,
|
}
|
||||||
},
|
}
|
||||||
'content': [
|
]
|
||||||
{
|
}
|
||||||
'component': 'VTextarea',
|
]
|
||||||
'props': {
|
},
|
||||||
'model': 'path',
|
{
|
||||||
'rows': '2',
|
'component': 'VRow',
|
||||||
'label': '历史记录路径映射',
|
'content': [
|
||||||
'placeholder': 'NAStool路径:MoviePilot路径(一行一个)'
|
{
|
||||||
}
|
'component': 'VCol',
|
||||||
}
|
'props': {
|
||||||
]
|
'cols': 12,
|
||||||
}
|
},
|
||||||
]
|
'content': [
|
||||||
},
|
{
|
||||||
{
|
'component': 'VTextarea',
|
||||||
'component': 'VRow',
|
'props': {
|
||||||
'content': [
|
'model': 'site',
|
||||||
{
|
'label': '下载历史站点映射',
|
||||||
'component': 'VCol',
|
'placeholder': 'NAStool站点名:MoviePilot站点名(一行一个)'
|
||||||
'props': {
|
}
|
||||||
'cols': 12,
|
}
|
||||||
},
|
]
|
||||||
'content': [
|
}
|
||||||
{
|
]
|
||||||
'component': 'VTextarea',
|
},
|
||||||
'props': {
|
{
|
||||||
'model': 'downloader',
|
'component': 'VRow',
|
||||||
'rows': '2',
|
'content': [
|
||||||
'label': '插件数据下载器映射',
|
{
|
||||||
'placeholder': 'NAStool下载器id:qbittorrent|transmission(一行一个)'
|
'component': 'VCol',
|
||||||
}
|
'props': {
|
||||||
}
|
'cols': 12,
|
||||||
]
|
},
|
||||||
}
|
'content': [
|
||||||
]
|
{
|
||||||
},
|
'component': 'VAlert',
|
||||||
{
|
'props': {
|
||||||
'component': 'VRow',
|
'text': '开启清空记录时,会在导入历史数据之前删除MoviePilot之前的记录。'
|
||||||
'content': [
|
'如果转移记录很多,同步时间可能会长(3-10分钟),'
|
||||||
{
|
'所以点击确定后页面没反应是正常现象,后台正在处理。'
|
||||||
'component': 'VCol',
|
'如果开启补充数据,会获取tr、qb种子,补充转移记录中download_hash缺失的情况(同步删除需要)。'
|
||||||
'props': {
|
}
|
||||||
'cols': 12,
|
}
|
||||||
},
|
]
|
||||||
'content': [
|
}
|
||||||
{
|
]
|
||||||
'component': 'VTextarea',
|
}
|
||||||
'props': {
|
]
|
||||||
'model': 'site',
|
}
|
||||||
'label': '下载历史站点映射',
|
], {
|
||||||
'placeholder': 'NAStool站点名:MoviePilot站点名(一行一个)'
|
"clear": False,
|
||||||
}
|
"supp": False,
|
||||||
}
|
"nt_db_path": "",
|
||||||
]
|
"path": "",
|
||||||
}
|
"downloader": "",
|
||||||
]
|
"site": "",
|
||||||
},
|
}
|
||||||
{
|
|
||||||
'component': 'VRow',
|
|
||||||
'content': [
|
|
||||||
{
|
|
||||||
'component': 'VCol',
|
|
||||||
'props': {
|
|
||||||
'cols': 12,
|
|
||||||
},
|
|
||||||
'content': [
|
|
||||||
{
|
|
||||||
'component': 'VAlert',
|
|
||||||
'props': {
|
|
||||||
'text': '只有开启转移记录、插件记录、下载记录其中之一插件才会启用。'
|
|
||||||
'开启清空记录时,会在导入历史数据之前删除MoviePilot之前的记录。'
|
|
||||||
'如果转移记录很多,同步时间可能会长,'
|
|
||||||
'所以点击确定后页面没反应是正常现象,后台正在处理。'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
], {
|
|
||||||
"clear": False,
|
|
||||||
"transfer": False,
|
|
||||||
"plugin": False,
|
|
||||||
"download": False,
|
|
||||||
"nt_db_path": "",
|
|
||||||
"path": "",
|
|
||||||
"downloader": "",
|
|
||||||
"site": "",
|
|
||||||
}
|
|
||||||
|
|
||||||
def get_page(self) -> List[dict]:
|
def get_page(self) -> List[dict]:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user