Skip to content

Commit

Permalink
Fix Kodi support and work around some Giant Bomb bustedness
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Porter committed Dec 28, 2014
1 parent 011e9b7 commit 083c383
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
XBMC_PROFILE?=$(HOME)/.xbmc
ADDON_NAME=plugin.video.giantbomb
ADDON_VERSION=4.1.1
ADDON_INSTALL_DIR=$(XBMC_PROFILE)/addons/$(ADDON_NAME)

.PHONY: uninstall-dev
Expand All @@ -12,7 +13,7 @@ install-dev: uninstall-dev

.PHONY: package
package:
zip $(ADDON_NAME).zip $(ADDON_NAME)
zip -r $(ADDON_NAME)-$(ADDON_VERSION).zip $(ADDON_NAME)

.PHONY: test
test:
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.giantbomb/addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.giantbomb"
name="Giant Bomb"
version="4.0.0"
version="4.1.1"
provider-name="Jim">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
Expand Down
6 changes: 6 additions & 0 deletions plugin.video.giantbomb/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[B]4.1.1[/B]
- Fix support for Kodi 14

[B]4.1.0[/B]
- Show watch history for videos

[B]4.0.0[/B]
- Display more metadata for videos
- Add podcast support
Expand Down
8 changes: 8 additions & 0 deletions plugin.video.giantbomb/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,18 @@ def list_videos(data, page, plugin_params=None):
# XXX: This assumes the URL already has a query string!
remote_url += '&' + urllib.urlencode({ 'api_key': gb.api_key })

# XXX: Work around https URLs in the Latest videos section
remote_url = re.sub(r'^https:', 'http:', remote_url)

fileid = videodb.get_file_id(remote_url)
name = video['name']
date = time.strptime(video['publish_date'], '%Y-%m-%d %H:%M:%S')

# XXX: Work around broken thumbnail URLs in the Latest videos section
thumb = video['image']['super_url']
if thumb[0] == '/':
thumb = 'http://static.giantbomb.com' + thumb

li = xbmcgui.ListItem(name, iconImage='DefaultVideo.png',
thumbnailImage=video['image']['super_url'])
li.setInfo('video', infoLabels={
Expand Down
2 changes: 2 additions & 0 deletions plugin.video.giantbomb/resources/lib/videodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def __init__(self, path=None):
path = 'special://profile/Database/MyVideos75.db'
elif xbmc.__version__ == '2.14.0':
path = 'special://profile/Database/MyVideos78.db'
elif xbmc.__version__ == '2.19.0':
path = 'special://profile/Database/MyVideos90.db'
else:
raise Exception('Unknown XBMC Python version: ' +
xbmc.__version__)
Expand Down

0 comments on commit 083c383

Please sign in to comment.