mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-28 11:37:23 +08:00
fix 目录监控蓝光原盘
This commit is contained in:
@@ -527,8 +527,8 @@ class DownloadChain(ChainBase):
|
|||||||
downloaded_list.append(context)
|
downloaded_list.append(context)
|
||||||
|
|
||||||
# 电视剧整季匹配
|
# 电视剧整季匹配
|
||||||
logger.info(f"开始匹配电视剧整季:{no_exists}")
|
|
||||||
if no_exists:
|
if no_exists:
|
||||||
|
logger.info(f"开始匹配电视剧整季:{no_exists}")
|
||||||
# 先把整季缺失的拿出来,看是否刚好有所有季都满足的种子 {tmdbid: [seasons]}
|
# 先把整季缺失的拿出来,看是否刚好有所有季都满足的种子 {tmdbid: [seasons]}
|
||||||
need_seasons: Dict[int, list] = {}
|
need_seasons: Dict[int, list] = {}
|
||||||
for need_mid, need_tv in no_exists.items():
|
for need_mid, need_tv in no_exists.items():
|
||||||
@@ -631,8 +631,8 @@ class DownloadChain(ChainBase):
|
|||||||
# 全部下载完成
|
# 全部下载完成
|
||||||
break
|
break
|
||||||
# 电视剧季内的集匹配
|
# 电视剧季内的集匹配
|
||||||
logger.info(f"开始电视剧完整集匹配:{no_exists}")
|
|
||||||
if no_exists:
|
if no_exists:
|
||||||
|
logger.info(f"开始电视剧完整集匹配:{no_exists}")
|
||||||
# TMDBID列表
|
# TMDBID列表
|
||||||
need_tv_list = list(no_exists)
|
need_tv_list = list(no_exists)
|
||||||
for need_mid in need_tv_list:
|
for need_mid in need_tv_list:
|
||||||
@@ -701,8 +701,8 @@ class DownloadChain(ChainBase):
|
|||||||
logger.info(f"季 {need_season} 剩余需要集:{need_episodes}")
|
logger.info(f"季 {need_season} 剩余需要集:{need_episodes}")
|
||||||
|
|
||||||
# 仍然缺失的剧集,从整季中选择需要的集数文件下载,仅支持QB和TR
|
# 仍然缺失的剧集,从整季中选择需要的集数文件下载,仅支持QB和TR
|
||||||
logger.info(f"开始电视剧多集拆包匹配:{no_exists}")
|
|
||||||
if no_exists:
|
if no_exists:
|
||||||
|
logger.info(f"开始电视剧多集拆包匹配:{no_exists}")
|
||||||
# TMDBID列表
|
# TMDBID列表
|
||||||
no_exists_list = list(no_exists)
|
no_exists_list = list(no_exists)
|
||||||
for need_mid in no_exists_list:
|
for need_mid in no_exists_list:
|
||||||
|
|||||||
+25
-1
@@ -1,9 +1,10 @@
|
|||||||
import platform
|
import platform
|
||||||
|
import re
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
from typing import Any
|
from typing import Any, Optional
|
||||||
|
|
||||||
from apscheduler.schedulers.background import BackgroundScheduler
|
from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
from cachetools import TTLCache
|
from cachetools import TTLCache
|
||||||
@@ -217,12 +218,35 @@ class Monitor(metaclass=Singleton):
|
|||||||
:param event_path: 事件文件路径
|
:param event_path: 事件文件路径
|
||||||
:param file_size: 文件大小
|
:param file_size: 文件大小
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def __is_bluray_sub(_path: Path) -> bool:
|
||||||
|
"""
|
||||||
|
判断是否蓝光原盘目录内的子目录或文件
|
||||||
|
"""
|
||||||
|
return True if re.search(r"BDMV[/\\]STREAM", str(_path), re.IGNORECASE) else False
|
||||||
|
|
||||||
|
def __get_bluray_dir(_path: Path) -> Optional[Path]:
|
||||||
|
"""
|
||||||
|
获取蓝光原盘BDMV目录的上级目录
|
||||||
|
"""
|
||||||
|
for p in _path.parents:
|
||||||
|
if p.name == "BDMV":
|
||||||
|
return p.parent
|
||||||
|
return None
|
||||||
|
|
||||||
# 全程加锁
|
# 全程加锁
|
||||||
with lock:
|
with lock:
|
||||||
|
# 蓝光原盘文件处理
|
||||||
|
if __is_bluray_sub(event_path):
|
||||||
|
event_path = __get_bluray_dir(event_path)
|
||||||
|
if not event_path:
|
||||||
|
return
|
||||||
|
|
||||||
# TTL缓存控重
|
# TTL缓存控重
|
||||||
if self._cache.get(str(event_path)):
|
if self._cache.get(str(event_path)):
|
||||||
return
|
return
|
||||||
self._cache[str(event_path)] = True
|
self._cache[str(event_path)] = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# 开始整理
|
# 开始整理
|
||||||
self.transferchain.do_transfer(
|
self.transferchain.do_transfer(
|
||||||
|
|||||||
Reference in New Issue
Block a user