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