update
This commit is contained in:
parent
85399580cb
commit
4b3c714261
@ -2,28 +2,37 @@ from config.config import Config
|
||||
from tmdbv3api import TMDb, Movie, Collection
|
||||
from plexapi.server import PlexServer
|
||||
from fuzzywuzzy import fuzz
|
||||
from models.movie_collection import MovieCollection
|
||||
|
||||
# Instantiate Tmdb object
|
||||
tmdb = TMDb()
|
||||
tmdb.api_key = Config.tmdbApiKey
|
||||
tmdb.language = Config.tmdbLanguage
|
||||
|
||||
# Instantiate movie object
|
||||
# Instantiate TMDb movie & collection object
|
||||
tmdbMovie = Movie()
|
||||
tmdbCollection = Collection()
|
||||
|
||||
# Connect to Plex Server
|
||||
baseurl = Config.plexBaseUrl
|
||||
token = Config.plexToken
|
||||
plex = PlexServer(baseurl, token)
|
||||
|
||||
# Create empty lists
|
||||
AvailablePlexCollectionsMovies = []
|
||||
PlexMovieList = []
|
||||
MatchingList = []
|
||||
TMDbCollection = []
|
||||
MovieCollectionFinal = []
|
||||
|
||||
movies = plex.library.section('Movies')
|
||||
for video in movies.search():
|
||||
PlexMovieList.append(video.title)
|
||||
# Retrieve the library Movies from Plex
|
||||
plexMoviesLibrary = plex.library.section('Movies')
|
||||
|
||||
for movie in plexMoviesLibrary.all():
|
||||
for collection in movie.collections:
|
||||
if collection.tag and collection.tag not in AvailablePlexCollectionsMovies:
|
||||
AvailablePlexCollectionsMovies.append(collection.tag)
|
||||
PlexMovieList.append(movie.title)
|
||||
|
||||
i = 0
|
||||
|
||||
|
4
models/movie_collection.py
Normal file
4
models/movie_collection.py
Normal file
@ -0,0 +1,4 @@
|
||||
class MovieCollection:
|
||||
def __init__(self, id, title):
|
||||
self.collectionTitle = title
|
||||
self.collectionId = id
|
Loading…
Reference in New Issue
Block a user