Fix Cerca Trailer
This commit is contained in:
@@ -1421,8 +1421,9 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
||||
# if it is a video library file send to mark as seen
|
||||
if strm or item.strm_path: item.options['strm'] = True
|
||||
# if player_mode == 1: item.options['continue'] = True
|
||||
from platformcode import xbmc_videolibrary
|
||||
xbmc_videolibrary.mark_auto_as_watched(item)
|
||||
if not mediaurl.startswith('plugin'):
|
||||
from platformcode import xbmc_videolibrary
|
||||
xbmc_videolibrary.mark_auto_as_watched(item)
|
||||
|
||||
# for cases where the audio playback window appears in place of the video one
|
||||
if item.focusOnVideoPlayer:
|
||||
|
||||
@@ -93,15 +93,16 @@ def buscartrailer(item, trailers=[]):
|
||||
if item.infoLabels['trailer'] and not trailers:
|
||||
url = item.infoLabels['trailer']
|
||||
if "youtube" in url:
|
||||
url = url.replace("embed/", "watch?v=")
|
||||
title, url, server = servertools.findvideos(url)[0]
|
||||
url = url.replace("embed/", "watch?v=").replace('plugin://plugin.video.youtube/play/?video_id=', 'https://www.youtube.com/watch?v=')
|
||||
finded = servertools.findvideos(url)[0]
|
||||
title = finded[0]
|
||||
url = finded[1]
|
||||
server = finded[2]
|
||||
title = "Trailer [" + server + "]"
|
||||
itemlist.append(item.clone(title=title, url=url, server=server, action="play"))
|
||||
try:
|
||||
for trailer in trailers:
|
||||
title = trailer['name'] + " [" + trailer['size'] + "p] (" + trailer['language'].replace("en",
|
||||
"ING").replace(
|
||||
"it", "ITA") + ") [tmdb/youtube]"
|
||||
title = trailer['name'] + " [" + trailer['size'] + "p] (" + trailer['language'].replace("en", "ING").replace( "it", "ITA") + ") [tmdb/youtube]"
|
||||
itemlist.append(item.clone(action="play", title=title, url=trailer['url'], server="youtube"))
|
||||
except:
|
||||
import traceback
|
||||
@@ -175,10 +176,11 @@ def tmdb_trailers(item, dialog, tipo="movie"):
|
||||
for vid in tmdb_search.get_videos():
|
||||
if vid['type'].lower() == 'trailer':
|
||||
title = vid['name']
|
||||
it = del_id(item.clone(action="play", title=title, title2="TMDB(youtube) - " + vid['language'].replace("en", "ING").replace("it", "ITA") + " [" + vid['size'] + "p]", url=vid['url'], server="youtube"))
|
||||
it = del_id(item.clone(action="play", title=title, title2="TMDB(youtube) - " + vid['language'].replace("en", "ING").replace("it", "ITA") + " [" + vid['size'] + "p]", url=vid['url'], server="youtube", window=True))
|
||||
itemlist.append(it)
|
||||
|
||||
if vid['language'] == def_lang and not found: # play now because lang is correct and TMDB is trusted
|
||||
logger.debug('TMDB PLAY ITEM', it)
|
||||
found = True
|
||||
launcher.run(it)
|
||||
dialog.close()
|
||||
@@ -274,10 +276,9 @@ try:
|
||||
def onInit(self):
|
||||
try:
|
||||
self.control_list = self.getControl(6)
|
||||
self.getControl(5).setNavigation(self.control_list, self.control_list, self.control_list,
|
||||
self.control_list)
|
||||
self.getControl(3).setEnabled(0)
|
||||
self.getControl(3).setVisible(0)
|
||||
self.getControl(5).setNavigation(self.control_list, self.control_list, self.control_list, self.control_list)
|
||||
self.getControl(8).setEnabled(0)
|
||||
self.getControl(8).setVisible(0)
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -309,7 +310,7 @@ try:
|
||||
|
||||
def onAction(self, action):
|
||||
global window_select, result
|
||||
if action == 92 or action == 110:
|
||||
if action in [92, 110, 10]:
|
||||
result = "no_video"
|
||||
self.close()
|
||||
window_select.pop()
|
||||
@@ -318,8 +319,9 @@ try:
|
||||
del window_select
|
||||
else:
|
||||
window_select[-1].doModal()
|
||||
|
||||
try:
|
||||
if (action == 7 or action == 100) and self.getFocusId() == 6:
|
||||
if action in [7, 100] and self.getFocusId() == 6:
|
||||
selectitem = self.control_list.getSelectedItem()
|
||||
item = Item().fromurl(selectitem.getProperty("item_copy"))
|
||||
if item.action == "play" and self.item.windowed:
|
||||
|
||||
Reference in New Issue
Block a user