Modify get_libs_name_list to filter out non-music libraries during output.

This commit is contained in:
2025-11-27 08:11:27 +09:00
parent f943105948
commit 355886e797
+5 -2
View File
@@ -137,8 +137,11 @@ class PlexClient:
self._connect_check()
try:
libraries = self.server.library.sections()
lib_names = [lib.title for lib in libraries]
logger.info(f"Fetched {len(lib_names)} library names from the server.")
music_libs = [lib for lib in libraries if getattr(lib, "type", None) == MUSIC_LIBRARY_TYPE]
lib_names = [lib.title for lib in music_libs]
logger.info(
f"Fetched {len(lib_names)} music library names from the server (type='{MUSIC_LIBRARY_TYPE}')."
)
return lib_names
except Exception as e:
logger.warning(f"Failed to fetch library names: {str(e)}")