def finish_container(self):
if self.params.get('random'):
return
for k, v in self.params.items():
if not k or not v:
continue
try:
xbmcplugin.setProperty(self.handle, u'Param.{}'.format(k), u'{}'.format(v)) # Set params to container properties
except Exception as exc:
utils.kodi_log(u'Error: {}\nUnable to set Param.{} to {}'.format(exc, k, v), 1)
if self.item_dbtype in ['movie', 'tvshow', 'episode']:
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_EPISODE) if self.item_dbtype == 'episode' else None
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_TITLE_IGNORE_THE)
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_LASTPLAYED)
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_PLAYCOUNT)
xbmcplugin.endOfDirectory(self.handle, updateListing=self.updatelisting)