feat: unify media recognition and music lifecycle

This commit is contained in:
jxxghp
2026-08-12 06:51:58 +08:00
parent b018646f61
commit 97dba2a8ae
96 changed files with 4677 additions and 719 deletions

View File

@@ -517,14 +517,14 @@ class Plex:
result_dict[""] = lib_key
if "" in result_dict:
# 如果有匹配失败的,刷新整个库
self._plex.library.update()
refreshed = self._plex.library.update()
return refreshed is not False
else:
# 否则一个一个刷新
for path, lib_key in result_dict.items():
logger.info(f"刷新媒体库:{lib_key} - {path}")
self._plex.query(f'/library/sections/{lib_key}/refresh?path={quote_plus(Path(path).parent.as_posix())}')
return None
return None
return True
@staticmethod
def __find_librarie(path: Path, libraries: List[Any]) -> Tuple[str, Optional[Path]]: