fix:修复代码兼容性写法

This commit is contained in:
jxxghp
2025-03-23 09:00:24 +08:00
parent ee94c2af32
commit 79411a7350
5 changed files with 55 additions and 62 deletions

View File

@@ -138,15 +138,14 @@ class Plex:
if hidden and self._sync_libraries and "all" not in self._sync_libraries \
and str(library.key) not in self._sync_libraries:
continue
match library.type:
case "movie":
library_type = MediaType.MOVIE.value
image_list = self.__get_library_images(library.key, 1)
case "show":
library_type = MediaType.TV.value
image_list = self.__get_library_images(library.key, 2)
case _:
continue
if library.type == "movie":
library_type = MediaType.MOVIE.value
image_list = self.__get_library_images(library.key, 1)
elif library.type == "show":
library_type = MediaType.TV.value
image_list = self.__get_library_images(library.key, 2)
else:
continue
libraries.append(
schemas.MediaServerLibrary(
id=library.key,