Skip to content

Commit

Permalink
Demographic and Themes added to Genres
Browse files Browse the repository at this point in the history
  • Loading branch information
Fribb committed Dec 7, 2022
1 parent dff9480 commit 69951e1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 20 additions & 0 deletions Contents/Code/utils/jikan.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,26 @@ def getDetails(self, metadata):
else:
Log.Warn("[" + self.AGENT_NAME + "] " + "Genres were not available ")

# get the themes from the JSON response and add it to the metadata
apiThemes = self.COMMON_UTILS.getJsonValue("themes", data)
if apiThemes is not None:
themesArray = self.COMMON_UTILS.getArrayFromJsonValue("name", apiThemes)
Log.Debug("[" + self.AGENT_NAME + "] " + "Theme: " + str(themesArray))
for theme in themesArray:
metadata.genres.add(str(theme))
else:
Log.Warn("[" + self.AGENT_NAME + "] " + "Themes were not available ")

# get the demographic from the JSON response and add it to the metadata
apiDemographic = self.COMMON_UTILS.getJsonValue("demographics", data)
if apiDemographic is not None:
demographicArray = self.COMMON_UTILS.getArrayFromJsonValue("name", apiDemographic)
Log.Debug("[" + self.AGENT_NAME + "] " + "Demographic: " + str(demographicArray))
for demographic in demographicArray:
metadata.genres.add(str(demographic))
else:
Log.Warn("[" + self.AGENT_NAME + "] " + "Demographics were not available ")

# get the producers from the JSON response and add it to the metadata
# Note: producers are only set on an individual episodes or a Movie, not on a show or season
#apiProducers= self.COMMON_UTILS.getJsonValue("producers", data)
Expand Down
6 changes: 3 additions & 3 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Sat, 19 Nov 2022 10:23:41 +0100
#Wed, 07 Dec 2022 07:56:44 +0100
major.number=7
minor.number=3
build.number=2
minor.number=4
build.number=0

0 comments on commit 69951e1

Please sign in to comment.