Skip to content

Commit

Permalink
修复空媒体库导致报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
x1ao4 committed Oct 24, 2023
1 parent 05f3c5d commit 919cc39
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plex-edition-manager/plex-edition-manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ def get_movies(server, token):
for library in libraries:
if library['type'] == 'movie':
library_key = library['key']
library_movies = requests.get(f'{server}/library/sections/{library_key}/all', headers=headers).json()['MediaContainer']['Metadata']
movies.extend(library_movies)
response = requests.get(f'{server}/library/sections/{library_key}/all', headers=headers).json()
if 'MediaContainer' in response and 'Metadata' in response['MediaContainer']:
library_movies = response['MediaContainer']['Metadata']
movies.extend(library_movies)
return movies

# 判断版本
Expand Down

0 comments on commit 919cc39

Please sign in to comment.