Skip to content

Commit

Permalink
Add option to show directors
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiumee committed Jan 6, 2024
1 parent 9fa93ca commit 2edf20e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="service.discord.richpresence"
name="Discord Rich Presence"
version="1.7.0"
version="1.7.1"
provider-name="Hiumee">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
Expand Down
16 changes: 16 additions & 0 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ def getEpisodeState(self, data):
return data.getTVShowTitle()
if self.settings['episode_state'] == 2:
return data.getGenre()
if self.settings['episode_state'] == 3:
directors = data.getDirectors()
if directors:
return ", ".join(directors)
return None

def getEpisodeDetails(self, data):
Expand All @@ -134,6 +138,10 @@ def getEpisodeDetails(self, data):
return '{}x{:02} {}'.format(data.getSeason(),data.getEpisode(),removeKodiTags(data.getTitle()))
if self.settings['episode_details'] == 2:
return data.getGenre()
if self.settings['episode_details'] == 3:
directors = data.getDirectors()
if directors:
return ", ".join(directors)
return None

def craftEpisodeState(self, data):
Expand All @@ -156,13 +164,21 @@ def getMovieState(self, data):
return data.getGenre()
if self.settings['movie_state'] == 1:
return removeKodiTags(data.getTitle())
if self.settings['movie_state'] == 2:
directors = data.getDirectors()
if directors:
return ", ".join(directors)
return None

def getMovieDetails(self, data):
if self.settings['movie_details'] == 0:
return removeKodiTags(data.getTitle())
if self.settings['movie_details'] == 1:
return data.getGenre()
if self.settings['movie_details'] == 3:
directors = data.getDirectors()
if directors:
return ", ".join(directors)
return None

def craftMovieState(self, data):
Expand Down
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ msgctxt "#32016"
msgid "Top text"
msgstr ""

msgctxt "#32017"
msgid "Directors"
msgstr ""

msgctxt "#32020"
msgid "Episode"
msgstr ""
Expand Down
9 changes: 4 additions & 5 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
</category>
<category label="32010">
<setting label="32011" type="lsep"/>
<setting label="32016" type="enum" id="movie_details" lvalues="32014|32013|32015"/>
<setting label="32012" type="enum" id="movie_state" lvalues="32013|32014|32015"/>
<setting label="32016" type="enum" id="movie_details" lvalues="32014|32013|32017|32015"/>
<setting label="32012" type="enum" id="movie_state" lvalues="32013|32014|32017|32015"/>
<setting label="32023" type="bool" id="display_time" default="true"/>
<setting label="32020" type="lsep"/>
<setting label="32016" type="enum" id="episode_details" lvalues="32022|32021|32013|32015"/>
<setting label="32012" type="enum" id="episode_state" lvalues="32021|32022|32013|32015"/>
<setting label="32016" type="enum" id="episode_state" lvalues="32021|32022|32013|32015"/>
<setting label="32016" type="enum" id="episode_details" lvalues="32022|32021|32013|32017|32015"/>
<setting label="32012" type="enum" id="episode_state" lvalues="32021|32022|32013|32017|32015"/>
</category>
</settings>

0 comments on commit 2edf20e

Please sign in to comment.