Skip to content

Commit 9be2855

Browse files
committed
[metadata.tvshows.themoviedb.org.python] v1.7.5
- added option to split keyart from posters - fixed sorting and trimming so that landscape and keyart aren't deleted fixes from KodiAI review
1 parent 13cce3b commit 9be2855

7 files changed

Lines changed: 45 additions & 10 deletions

File tree

metadata.tvshows.themoviedb.org.python/addon.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
<addon id="metadata.tvshows.themoviedb.org.python"
33
name="TMDb TV Shows"
4-
version="1.7.4"
4+
version="1.7.5"
55
provider-name="Team Kodi">
66
<requires>
77
<import addon="xbmc.python" version="3.0.0"/>
@@ -10,8 +10,9 @@
1010
<extension point="xbmc.metadata.scraper.tvshows" library="main.py" cachepersistence="00:15"/>
1111
<extension point="xbmc.addon.metadata">
1212
<reuselanguageinvoker>true</reuselanguageinvoker>
13-
<news>1.7.4
14-
fix for breaking change to TMDB API for fanart
13+
<news>1.7.5
14+
added option to split keyart from posters
15+
fixed sorting and trimming so that landscape and keyart aren't deleted
1516
</news>
1617
<platform>all</platform>
1718
<license>GPL-3.0-or-later</license>

metadata.tvshows.themoviedb.org.python/changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.7.5
2+
added option to split keyart from posters
3+
fixed sorting and trimming so that landscape and keyart aren't deleted
4+
15
1.7.4
26
fix for breaking change to TMDB API for fanart
37

metadata.tvshows.themoviedb.org.python/libs/data_utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,7 @@ def set_show_artwork(show_info, list_item):
213213
fanart_list = []
214214
for image in image_list:
215215
theurl, previewurl = get_image_urls(image)
216-
if (image.get('iso_639_1') != None and image.get('iso_639_1').lower() != 'xx') and SOURCE_SETTINGS["CATLANDSCAPE"] and theurl:
217-
vtag.addAvailableArtwork(
218-
theurl, arttype="landscape", preview=previewurl)
219-
elif theurl:
216+
if theurl:
220217
fanart_list.append({'image': theurl})
221218
if fanart_list:
222219
list_item.setAvailableFanart(fanart_list)

metadata.tvshows.themoviedb.org.python/libs/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def getSourceSettings():
8484
settings["KEEPTITLE"] = source_settings.get(
8585
'keeporiginaltitle', addon.getSettingBool('keeporiginaltitle'))
8686
settings["CATLANDSCAPE"] = source_settings.get('cat_landscape', True)
87+
settings["CATKEYART"] = source_settings.get('cat_keyart', True)
8788
settings["STUDIOCOUNTRY"] = source_settings.get('studio_country', False)
8889
settings["ENABTRAILER"] = source_settings.get(
8990
'enab_trailer', addon.getSettingBool('enab_trailer'))

metadata.tvshows.themoviedb.org.python/libs/tmdb.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,32 @@ def _sort_image_types(imagelist):
478478
:param imagelist:
479479
:return: imagelist
480480
"""
481+
source_settings = settings.getSourceSettings()
482+
new_imagelist = {}
481483
for image_type, images in imagelist.items():
482-
imagelist[image_type] = _image_sort(images, image_type)
483-
return imagelist
484+
if image_type == "backdrops":
485+
backdrops = []
486+
landscape = []
487+
for image in images:
488+
if (image.get('iso_639_1') is not None and image.get('iso_639_1').lower() != 'xx') and source_settings["CATLANDSCAPE"]:
489+
landscape.append(image)
490+
else:
491+
backdrops.append(image)
492+
new_imagelist['landscape'] = _image_sort(landscape, 'landscape')
493+
new_imagelist['backdrops'] = _image_sort(backdrops, 'backdrops')
494+
elif image_type == 'posters':
495+
posters = []
496+
keyart = []
497+
for image in images:
498+
if (image.get('iso_639_1') is None or image.get('iso_639_1').lower() == 'xx') and source_settings["CATKEYART"]:
499+
keyart.append(image)
500+
else:
501+
posters.append(image)
502+
new_imagelist['posters'] = _image_sort(posters, 'posters')
503+
new_imagelist['keyart'] = _image_sort(keyart, 'keyart')
504+
else:
505+
new_imagelist[image_type] = _image_sort(images, image_type)
506+
return new_imagelist
484507

485508

486509
def _image_sort(images, image_type):

metadata.tvshows.themoviedb.org.python/resources/language/resource.language.en_gb/strings.po

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ msgctxt "#30009"
6464
msgid "Use different language for images"
6565
msgstr ""
6666

67-
# empty strings from 30009 to 30099
67+
msgctxt "#30010"
68+
msgid "Categorize posters without text as key art"
69+
msgstr ""
70+
71+
# empty strings from 30011 to 30099
6872

6973
msgctxt "#30100"
7074
msgid "Fanart.tv"

metadata.tvshows.themoviedb.org.python/resources/settings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@
230230
<default>true</default>
231231
<control type="toggle"/>
232232
</setting>
233+
<setting id="cat_keyart" type="boolean" label="30010" help="">
234+
<level>0</level>
235+
<default>true</default>
236+
<control type="toggle"/>
237+
</setting>
233238
<setting id="studio_country" type="boolean" label="30006" help="">
234239
<level>0</level>
235240
<default>false</default>

0 commit comments

Comments
 (0)