mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Only export images for supported media types
This commit is contained in:
parent
693c0ba658
commit
746295aa16
1 changed files with 11 additions and 9 deletions
|
@ -1378,6 +1378,12 @@ class Export(object):
|
||||||
elif self.file_format not in ('json', 'csv'):
|
elif self.file_format not in ('json', 'csv'):
|
||||||
logger.error("Tautulli Exporter :: Export called but invalid file_format '%s' provided.", self.file_format)
|
logger.error("Tautulli Exporter :: Export called but invalid file_format '%s' provided.", self.file_format)
|
||||||
return
|
return
|
||||||
|
elif self.metadata_level not in self.METADATA_LEVELS:
|
||||||
|
logger.error("Tautulli Exporter :: Export called with invalid metadata_level '%s'.", self.metadata_level)
|
||||||
|
return
|
||||||
|
elif self.media_info_level not in self.MEDIA_INFO_LEVELS:
|
||||||
|
logger.error("Tautulli Exporter :: Export called with invalid media_info_level '%s'.", self.media_info_level)
|
||||||
|
return
|
||||||
|
|
||||||
plex = Plex(plexpy.CONFIG.PMS_URL, plexpy.CONFIG.PMS_TOKEN)
|
plex = Plex(plexpy.CONFIG.PMS_URL, plexpy.CONFIG.PMS_TOKEN)
|
||||||
|
|
||||||
|
@ -1412,8 +1418,9 @@ class Export(object):
|
||||||
|
|
||||||
elif self.section_id:
|
elif self.section_id:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Tautulli Exporter :: Export called with section_id %s, metadata_level %d, media_info_level %d",
|
"Tautulli Exporter :: Export called with section_id %s, "
|
||||||
self.section_id, self.metadata_level, self.media_info_level)
|
"metadata_level %d, media_info_level %d, include_images %s",
|
||||||
|
self.section_id, self.metadata_level, self.media_info_level, self.include_images)
|
||||||
|
|
||||||
library = plex.get_library(str(self.section_id))
|
library = plex.get_library(str(self.section_id))
|
||||||
self.media_type = library.type
|
self.media_type = library.type
|
||||||
|
@ -1432,15 +1439,10 @@ class Export(object):
|
||||||
logger.error("Tautulli Exporter :: Cannot export media type '%s'", self.media_type)
|
logger.error("Tautulli Exporter :: Cannot export media type '%s'", self.media_type)
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.metadata_level not in self.METADATA_LEVELS:
|
if self.include_images and self.media_type not in ('movie', 'show', 'season', 'artist', 'album'):
|
||||||
logger.error("Tautulli Exporter :: Export called with invalid metadata_level '%s'.", self.metadata_level)
|
self.include_images = False
|
||||||
return
|
|
||||||
elif self.media_info_level not in self.METADATA_LEVELS:
|
|
||||||
logger.error("Tautulli Exporter :: Export called with invalid media_info_level '%s'.", self.media_info_level)
|
|
||||||
return
|
|
||||||
|
|
||||||
self.filename = '{}.{}'.format(helpers.clean_filename(filename), self.file_format)
|
self.filename = '{}.{}'.format(helpers.clean_filename(filename), self.file_format)
|
||||||
|
|
||||||
self.export_id = self.add_export()
|
self.export_id = self.add_export()
|
||||||
if not self.export_id:
|
if not self.export_id:
|
||||||
logger.error("Tautulli Exporter :: Failed to export '%s'", self.filename)
|
logger.error("Tautulli Exporter :: Failed to export '%s'", self.filename)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue