Skip to content

Commit

Permalink
Added image support for a very limited number of TV shows
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiumee authored and Hiumee committed Nov 9, 2020
1 parent 09f77ea commit eb91478
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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.2.8"
version="1.3.0"
provider-name="Hiumee">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
Expand Down
11 changes: 10 additions & 1 deletion default.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import time
import re
import requests

from lib import discordpresence

Expand All @@ -13,6 +14,12 @@ def log(msg):
'570950300446359552']


def getShowImage(showTitle):
if showTitle in AVAIABLE_IMAGES:
return AVAIABLE_IMAGES[showTitle]
return "default"


def removeKodiTags(text):
log("Removing tags for: " + text)

Expand Down Expand Up @@ -121,7 +128,7 @@ def getEpisodeDetails(self, data):

def craftEpisodeState(self, data):
activity = {}
activity['assets'] = {'large_image' : 'default',
activity['assets'] = {'large_image' : getShowImage(data.getTVShowTitle()),
'large_text' : data.getTVShowTitle()}

state = self.getEpisodeState(data)
Expand Down Expand Up @@ -319,6 +326,8 @@ def onSettingsChanged(self):
drp.updateSettings()
drp.updatePresence()

AVAIABLE_IMAGES = json.loads(requests.get("https://hiumee.github.io/kodi/custom.json").text)

monitor = MyMonitor()
player = MyPlayer()

Expand Down

0 comments on commit eb91478

Please sign in to comment.