update
This commit is contained in:
parent
261c00fc91
commit
936d2858c3
@ -22,7 +22,8 @@ baseurl = Config.plexBaseUrl
|
||||
token = Config.plexToken
|
||||
plex = PlexServer(baseurl, token)
|
||||
|
||||
plexMoviesLibrary = plex.library.section('Movies')
|
||||
def MovieCollectionList(library):
|
||||
plexMoviesLibrary = plex.library.section(library)
|
||||
plexMoviesLibrary = plexMoviesLibrary.search()
|
||||
|
||||
MoviesList = []
|
||||
@ -78,8 +79,9 @@ while i < len(MoviesList):
|
||||
count = 0
|
||||
|
||||
logger.info(f"Found a total of {len(MovieListFinal)} collections, updating config file now !")
|
||||
return MovieListFinal
|
||||
|
||||
def UpdateYAML(configFile):
|
||||
def UpdateYAML(configFile, MovieListFinal):
|
||||
try:
|
||||
with open(configFile, 'r') as f:
|
||||
try:
|
||||
@ -114,7 +116,10 @@ def UpdateYAML(configFile):
|
||||
urllib.request.urlretrieve(Config.tmdbImgUrl + f"{collection.MovieTMDbCollectionPosterPath}",
|
||||
Config.PlexAutoCollectionConfigFileImagesPath + f"/{collection.MovieTMDbCollectionName}/poster.jpeg")
|
||||
|
||||
UpdateYAML(Config.PlexAutoCollectionConfigFilePath)
|
||||
#UpdateYAML(Config.PlexAutoCollectionConfigFilePath4K)
|
||||
MovieListFinal = MovieCollectionList('Movies')
|
||||
UpdateYAML(Config.PlexAutoCollectionConfigFilePath, MovieListFinal)
|
||||
|
||||
MovieListFinal = MovieCollectionList('4K Movies')
|
||||
UpdateYAML(Config.PlexAutoCollectionConfigFilePath4K)
|
||||
|
||||
logger.info(f"All collections have been updated in plex...")
|
Loading…
x
Reference in New Issue
Block a user