Modify get_libs_name_list to filter out non-music libraries during output.
This commit is contained in:
@@ -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)}")
|
||||
|
||||
Reference in New Issue
Block a user