Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
<screenshot>resources/screenshot-03.jpg</screenshot>
<screenshot>resources/screenshot-04.jpg</screenshot>
</assets>
<source>https://github.com/aanderse/plugin.program.steam.library</source>
</extension>
</addon>
9 changes: 8 additions & 1 deletion resources/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def all_games():
xbmcplugin.addDirectoryItems(plugin.handle, directory_items)

xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_PLAYCOUNT)
xbmcplugin.endOfDirectory(plugin.handle, succeeded=True)


Expand Down Expand Up @@ -70,6 +71,7 @@ def installed_games():
xbmcplugin.addDirectoryItems(plugin.handle, directory_items)

xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_PLAYCOUNT)
xbmcplugin.endOfDirectory(plugin.handle, succeeded=True)


Expand All @@ -90,7 +92,9 @@ def recent_games():
directory_items = create_directory_items(steam_games_details)
xbmcplugin.addDirectoryItems(plugin.handle, directory_items)

xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_UNSORTED, "Last played")
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_PLAYCOUNT)
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.endOfDirectory(plugin.handle, succeeded=True)


Expand Down Expand Up @@ -128,6 +132,9 @@ def create_directory_items(app_entries):

run_url = plugin.url_for(run, appid=appid)
item = xbmcgui.ListItem(name)
item.setUniqueIDs({'steam': appid, 'steam_img_icon': app_entry['img_icon_url']})
item.setInfo('video', {'playcount': app_entry.get('playtime_forever', 0)})
item.setContentLookup(False) # Tells Kodi not to send HEAD requests (used to determine MIME type for example) to the item's run URL.

item.addContextMenuItems([('Play', 'RunPlugin(' + run_url + ')'),
('Install', 'RunPlugin(' + plugin.url_for(install, appid=appid) + ')')])
Expand Down