|
|
@ -11,6 +11,7 @@ from modules.icheckmovies import ICheckMovies
|
|
|
|
from modules.imdb import IMDb
|
|
|
|
from modules.imdb import IMDb
|
|
|
|
from modules.letterboxd import Letterboxd
|
|
|
|
from modules.letterboxd import Letterboxd
|
|
|
|
from modules.mal import MyAnimeList
|
|
|
|
from modules.mal import MyAnimeList
|
|
|
|
|
|
|
|
from modules.meta import PlaylistFile
|
|
|
|
from modules.notifiarr import Notifiarr
|
|
|
|
from modules.notifiarr import Notifiarr
|
|
|
|
from modules.omdb import OMDb
|
|
|
|
from modules.omdb import OMDb
|
|
|
|
from modules.plex import Plex
|
|
|
|
from modules.plex import Plex
|
|
|
@ -367,18 +368,18 @@ class ConfigFile:
|
|
|
|
|
|
|
|
|
|
|
|
self.playlist_names = []
|
|
|
|
self.playlist_names = []
|
|
|
|
self.playlist_files = []
|
|
|
|
self.playlist_files = []
|
|
|
|
if "playlists" in self.data:
|
|
|
|
|
|
|
|
logger.info("Reading in Playlist Files")
|
|
|
|
|
|
|
|
if self.data["playlists"] is None:
|
|
|
|
|
|
|
|
raise Failed("Config Error: playlists attribute is blank")
|
|
|
|
|
|
|
|
playlists_pairs = []
|
|
|
|
playlists_pairs = []
|
|
|
|
paths_to_check = self.data["playlists"] if isinstance(self.data["playlists"], list) else [self.data["playlists"]]
|
|
|
|
if "playlist_files" in self.data:
|
|
|
|
|
|
|
|
logger.info("Reading in Playlist Files")
|
|
|
|
|
|
|
|
if self.data["playlist_files"] is None:
|
|
|
|
|
|
|
|
raise Failed("Config Error: playlist_files attribute is blank")
|
|
|
|
|
|
|
|
paths_to_check = self.data["playlist_files"] if isinstance(self.data["playlist_files"], list) else [self.data["playlist_files"]]
|
|
|
|
for path in paths_to_check:
|
|
|
|
for path in paths_to_check:
|
|
|
|
if isinstance(path, dict):
|
|
|
|
if isinstance(path, dict):
|
|
|
|
def check_dict(attr):
|
|
|
|
def check_dict(attr):
|
|
|
|
if attr in path:
|
|
|
|
if attr in path:
|
|
|
|
if path[attr] is None:
|
|
|
|
if path[attr] is None:
|
|
|
|
err = f"Config Error: playlists {attr} is blank"
|
|
|
|
err = f"Config Error: playlist_files {attr} is blank"
|
|
|
|
self.errors.append(err)
|
|
|
|
self.errors.append(err)
|
|
|
|
logger.error(err)
|
|
|
|
logger.error(err)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -405,6 +406,13 @@ class ConfigFile:
|
|
|
|
logger.error(f"Config Error: Folder not found: {folder}")
|
|
|
|
logger.error(f"Config Error: Folder not found: {folder}")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
playlists_pairs.append(("File", path))
|
|
|
|
playlists_pairs.append(("File", path))
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
default_playlist_file = os.path.abspath(os.path.join(self.default_dir, "playlists.yml"))
|
|
|
|
|
|
|
|
if os.path.exists(default_playlist_file):
|
|
|
|
|
|
|
|
playlists_pairs.append(("File", default_playlist_file))
|
|
|
|
|
|
|
|
logger.warning(f"playlist_files attribute not found using {default_playlist_file} as default")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
logger.warning("playlist_files attribute not found")
|
|
|
|
for file_type, playlist_file in playlists_pairs:
|
|
|
|
for file_type, playlist_file in playlists_pairs:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
playlist_obj = PlaylistFile(self, file_type, playlist_file)
|
|
|
|
playlist_obj = PlaylistFile(self, file_type, playlist_file)
|
|
|
@ -412,8 +420,6 @@ class ConfigFile:
|
|
|
|
self.playlist_files.append(playlist_obj)
|
|
|
|
self.playlist_files.append(playlist_obj)
|
|
|
|
except Failed as e:
|
|
|
|
except Failed as e:
|
|
|
|
util.print_multiline(e, error=True)
|
|
|
|
util.print_multiline(e, error=True)
|
|
|
|
else:
|
|
|
|
|
|
|
|
logger.warning("playlists attribute not found")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.TVDb = TVDb(self, self.general["tvdb_language"])
|
|
|
|
self.TVDb = TVDb(self, self.general["tvdb_language"])
|
|
|
|
self.IMDb = IMDb(self)
|
|
|
|
self.IMDb = IMDb(self)
|
|
|
|