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() self._connect_check()
try: try:
libraries = self.server.library.sections() libraries = self.server.library.sections()
lib_names = [lib.title for lib in libraries] music_libs = [lib for lib in libraries if getattr(lib, "type", None) == MUSIC_LIBRARY_TYPE]
logger.info(f"Fetched {len(lib_names)} library names from the server.") 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 return lib_names
except Exception as e: except Exception as e:
logger.warning(f"Failed to fetch library names: {str(e)}") logger.warning(f"Failed to fetch library names: {str(e)}")