mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
feat(event): add source tracking in download event
This commit is contained in:
+20
-2
@@ -391,6 +391,15 @@ class SubscribeChain(ChainBase, metaclass=Singleton):
|
||||
continue
|
||||
|
||||
# 自动下载
|
||||
source_keyword = {
|
||||
'id': subscribe.id,
|
||||
'name': subscribe.name,
|
||||
'year': subscribe.year,
|
||||
'type': subscribe.type,
|
||||
'season': subscribe.season,
|
||||
'tmdbid': subscribe.tmdbid
|
||||
}
|
||||
source = f"Subscribe|{source_keyword}"
|
||||
downloads, lefts = self.downloadchain.batch_download(
|
||||
contexts=matched_contexts,
|
||||
no_exists=no_exists,
|
||||
@@ -399,7 +408,7 @@ class SubscribeChain(ChainBase, metaclass=Singleton):
|
||||
save_path=subscribe.save_path,
|
||||
media_category=subscribe.media_category,
|
||||
downloader=subscribe.downloader,
|
||||
source="Subscribe"
|
||||
source=source
|
||||
)
|
||||
|
||||
# 判断是否应完成订阅
|
||||
@@ -784,6 +793,15 @@ class SubscribeChain(ChainBase, metaclass=Singleton):
|
||||
|
||||
# 开始批量择优下载
|
||||
logger.info(f'{mediainfo.title_year} 匹配完成,共匹配到{len(_match_context)}个资源')
|
||||
source_keyword = {
|
||||
'id': subscribe.id,
|
||||
'name': subscribe.name,
|
||||
'year': subscribe.year,
|
||||
'type': subscribe.type,
|
||||
'season': subscribe.season,
|
||||
'tmdbid': subscribe.tmdbid
|
||||
}
|
||||
source = f"Subscribe|{source_keyword}"
|
||||
downloads, lefts = self.downloadchain.batch_download(contexts=_match_context,
|
||||
no_exists=no_exists,
|
||||
userid=subscribe.username,
|
||||
@@ -791,7 +809,7 @@ class SubscribeChain(ChainBase, metaclass=Singleton):
|
||||
save_path=subscribe.save_path,
|
||||
media_category=subscribe.media_category,
|
||||
downloader=subscribe.downloader,
|
||||
source="Subscribe")
|
||||
source=source)
|
||||
# 判断是否要完成订阅
|
||||
self.finish_subscribe_or_not(subscribe=subscribe, meta=meta, mediainfo=mediainfo,
|
||||
downloads=downloads, lefts=lefts)
|
||||
|
||||
Reference in New Issue
Block a user