This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def start_playback(self): | |
import xbmc | |
import xbmcgui | |
# xbmc.log(str(xbmcgui.getCurrentWindowDialogId())+'===>service.next_playlist2', level=xbmc.LOGNOTICE) | |
# xbmc.log(str(xbmc.getCondVisibility('Player.HasVideo'))+'===>service.next_playlist2', level=xbmc.LOGNOTICE) | |
for i in range(30): | |
if xbmc.getCondVisibility('Player.HasVideo'): | |
xbmc.executebuiltin('ActivateWindow(fullscreenvideo)') | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kodi-send --action='RunPlugin(plugin://plugin.video.themoviedb.helper?info=trakt_collection2)' | |
####/home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/container.py | |
def list_traktcollection2(self): | |
items = TraktAPI(tmdb='tv', login=True).get_collection2('tv', utils.try_parse_int(self.params.get('page', 1))) | |
### | |
def list_play(self): | |
if not self.params.get('type') or not self.params.get('tmdb_id'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListItem(object): | |
def __init__(self, label=None, label2=None, dbtype=None, library=None, tmdb_id=None, imdb_id=None, dbid=None, tvdb_id=None, | |
cast=None, infolabels=None, infoproperties=None, poster=None, thumb=None, icon=None, fanart=None, nextpage=None, | |
streamdetails=None, clearlogo=None, clearart=None, banner=None, landscape=None, mixed_type=None, url=None, is_folder=True): | |
self.addon = xbmcaddon.Addon() | |
self.addonpath = self.addon.getAddonInfo('path') | |
self.select_action = self.addon.getSettingInt('select_action') | |
self.label = label or 'N/A' | |
self.label2 = label2 or '' | |
self.library = library or '' # <content target= video, music, pictures, none> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def exp_fanarttv(self): | |
return True | |
# if self.params.get('fanarttv', '').capitalize() == 'False': | |
# return False | |
# if self.params.get('fanarttv', '').capitalize() == 'True': | |
# return True | |
# if self.addon.getSettingBool('widget_fanarttv_lookup') and self.params.get('widget', '').capitalize() == 'True': | |
# return True | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_fanarttv_artwork(self, item, tmdbtype=None, tmdb_id=None, tvdb_id=None): | |
if not self.fanarttv or tmdbtype not in ['movie', 'tv']: | |
return item | |
artwork, lookup_id, func = None, None, None | |
if tmdbtype == 'tv': | |
lookup_id = tvdb_id or item.get('tvdb_id') | |
func = self.fanarttv.get_tvshow_allart_lc | |
elif tmdbtype == 'movie': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################# | |
def get_tvshow_clearart(self, ftvid, *args, **kwargs): | |
artwork = self.get_artwork_best_lc(ftvid, 'tv', 'clearart', *args, **kwargs) | |
return artwork or self.get_artwork_best_lc(ftvid, 'tv', 'hdclearart', *args, **kwargs) | |
def get_tvshow_clearlogo(self, ftvid, *args, **kwargs): | |
artwork = self.get_artwork_best_lc(ftvid, 'tv', 'clearlogo', *args, **kwargs) | |
return artwork or self.get_artwork_best_lc(ftvid, 'tv', 'hdtvlogo', *args, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build_details(self): | |
self.item['id'] = self.tmdb_id | |
self.item['tmdb'] = self.tmdb_id | |
self.item['imdb'] = self.details.get('infolabels', {}).get('imdbnumber') | |
self.item['name'] = u'{0} ({1})'.format(self.item.get('title'), self.item.get('year')) | |
self.item['firstaired'] = self.details.get('infolabels', {}).get('premiered') | |
self.item['premiered'] = self.details.get('infolabels', {}).get('premiered') | |
self.item['released'] = self.details.get('infolabels', {}).get('premiered') | |
self.item['showname'] = self.item.get('title') | |
self.item['clearname'] = self.item.get('title') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def metadata_from(args): | |
metadata = { | |
'info': { | |
'title': args.get('title', ''), | |
'plot': args.get('plot', ''), | |
'genres': args.get('genre', ''), | |
'votes': args.get('votes', ''), | |
'rating': args.get('rating', ''), | |
'year': args.get('year', ''), | |
'mpaa': args.get('mpaa', ''), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl stop mediacenter | |
##addon.xml | |
<item library="context3.py"> | |
<label>TMDB Helper - Play</label> | |
<visible>String.IsEqual(ListItem.dbtype,movie) | String.IsEqual(ListItem.dbtype,episode)</visible> | |
</item> | |
##addon.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ch.action('contextmenu', 500) | |
def context_menu(self): | |
Utils.show_busy() | |
if self.listitem.getProperty('dbid') and self.listitem.getProperty('dbid') != 0: | |
dbid = self.listitem.getProperty('dbid') | |
else: | |
dbid = 0 | |
item_id = self.listitem.getProperty('id') | |
if self.type == 'tv': | |
imdb_id = Utils.fetch(TheMovieDB.get_tvshow_ids(item_id), 'imdb_id') |