fix 匹配download_hash
This commit is contained in:
@ -79,4 +79,8 @@ class TransferHistoryOper(DbOper):
|
|||||||
"""
|
"""
|
||||||
新增转移历史
|
新增转移历史
|
||||||
"""
|
"""
|
||||||
|
if kwargs.get("src"):
|
||||||
|
transferhistory = TransferHistory.get_by_src(self._db, kwargs.get("src"))
|
||||||
|
if transferhistory:
|
||||||
|
transferhistory.delete(self._db, transferhistory.id)
|
||||||
return TransferHistory(**kwargs).create(self._db)
|
return TransferHistory(**kwargs).create(self._db)
|
@ -264,8 +264,7 @@ class DirMonitor(_PluginBase):
|
|||||||
|
|
||||||
# 获取downloadhash
|
# 获取downloadhash
|
||||||
download_hash = self.get_download_hash(file_name=os.path.basename(event_path),
|
download_hash = self.get_download_hash(file_name=os.path.basename(event_path),
|
||||||
mediainfo=mediainfo,
|
tmdb_id=mediainfo.tmdb_id)
|
||||||
file_meta=file_meta)
|
|
||||||
|
|
||||||
# 新增转移成功历史记录
|
# 新增转移成功历史记录
|
||||||
self.transferhis.add_force(
|
self.transferhis.add_force(
|
||||||
@ -306,16 +305,11 @@ class DirMonitor(_PluginBase):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("目录监控发生错误:%s - %s" % (str(e), traceback.format_exc()))
|
logger.error("目录监控发生错误:%s - %s" % (str(e), traceback.format_exc()))
|
||||||
|
|
||||||
def get_download_hash(self, file_name, mediainfo, file_meta):
|
def get_download_hash(self, file_name, tmdb_id):
|
||||||
"""
|
"""
|
||||||
获取download_hash
|
获取download_hash
|
||||||
"""
|
"""
|
||||||
downloadHis = self.downloadhis.get_last_by(mtype=mediainfo.type.value,
|
downloadHis = self.downloadhis.get_last_by(tmdbid=tmdb_id)
|
||||||
title=mediainfo.title,
|
|
||||||
year=mediainfo.year,
|
|
||||||
season=file_meta.season,
|
|
||||||
episode=file_meta.episode,
|
|
||||||
tmdbid=mediainfo.tmdb_id)
|
|
||||||
if downloadHis:
|
if downloadHis:
|
||||||
for his in downloadHis:
|
for his in downloadHis:
|
||||||
# qb
|
# qb
|
||||||
|
Reference in New Issue
Block a user