Fix vari:

- AnimeWorld
 - InfoPlus
 - Configura canale
 - Rinumerazione
This commit is contained in:
Alhaziel01
2020-09-28 17:34:02 +02:00
parent d17401ebc1
commit e3129b9b9e
13 changed files with 136 additions and 59 deletions

View File

@@ -156,7 +156,7 @@ def peliculas(item):
action='episodios'
# Controlla la lingua se assente
patronNext=r'</span></a><a href="([^"]+)"'
patronNext=r'<a href="([^"]+)" class="[^"]+" id="go-next'
typeContentDict={'movie':['movie', 'special']}
typeActionDict={'findvideos':['movie', 'special']}
def itemHook(item):

View File

@@ -1032,33 +1032,33 @@ class Tvdb(object):
fanarts = requests.get(HOST + '/series/' + str(origen['id']) + '/images/query?keyType=fanart').json()
if 'data' in fanarts:
ret_infoLabels['fanart'] = HOST_IMAGE + fanarts['data'][0]['fileName']
elif 'poster' in origen and origen['fanart']:
elif 'fanart' in origen and origen['fanart']:
ret_infoLabels['thumbnail'] = origen['fanart']
if 'overview' in origen:
if 'overview' in origen and origen['overview']:
ret_infoLabels['plot'] = origen['overview']
if 'duration' in origen and origen['duration']:
ret_infoLabels['duration'] = int(origen['duration']) * 60
if 'firstAired' in origen and origen['firstAired']:
ret_infoLabels['year'] = int(origen['firstAired'][:4])
ret_infoLabels['premiered'] = origen['firstAired'].split("-")[2] + "/" + origen['firstAired'].split("-")[1] + "/" + origen['firstAired'].split("-")[0]
if 'siteRating' in origen:
if 'siteRating' in origen and origen['siteRating']:
ret_infoLabels['rating'] = float(origen['siteRating'])
if 'siteRatingCount' in origen and origen['siteRating']:
if 'siteRatingCount' in origen and origen['siteRatingCount']:
ret_infoLabels['votes'] = origen['siteRatingCount']
if 'status' in origen:
if 'status' in origen and origen['status']:
ret_infoLabels['status'] = origen['status']
if 'network' in origen:
if 'network' in origen and origen['network']:
ret_infoLabels['studio'] = origen['network']
if 'imdbId' in origen:
if 'imdbId' in origen and origen['rating']:
ret_infoLabels['imdb_id'] = origen['imdbId']
if 'rating' in origen:
if 'rating' in origen and origen['rating']:
ret_infoLabels['mpaa'] = origen['rating']
if 'genre' in origen:
if 'genre' in origen and origen['genre']:
for genre in origen['genre']:
genre_list = ""
genre_list += genre + ', '
ret_infoLabels['genre'] = genre_list.rstrip(', ')
if 'cast' in origen:
if 'cast' in origen and origen['cast']:
dic_aux = dict((name, character) for (name, character) in l_castandrole)
l_castandrole.extend([(p['name'], p['role']) for p in origen['cast'] if p['name'] not in list(dic_aux.keys())])
ret_infoLabels['castandrole'] = l_castandrole

View File

@@ -254,7 +254,7 @@ def add_renumber_options(item, head_nfo, path):
return ret
def check_renumber_options(item):
from core.autorenumber import load, write
from platformcode.autorenumber import load, write
for key in item.channel_prefs:
if 'TVSHOW_AUTORENUMBER' in item.channel_prefs[key]:
item.channel = key
@@ -1073,7 +1073,7 @@ def add_tvshow(item, channel=None):
# Get the episode list
itemlist = getattr(channel, item.action)(item)
if itemlist and not scrapertools.find_single_match(itemlist[0].title, r'(\d+x\d+)'):
from core.autorenumber import select_type, renumber, check
from platformcode.autorenumber import select_type, renumber, check
if not check(item):
action = item.action
select_type(item)

View File

@@ -53,7 +53,6 @@ def renumber(itemlist, item='', typography=''):
dict_series = load(itemlist[0]) if len(itemlist) > 0 else {}
if item:
# from core.support import dbg;dbg()
item.channel = item.from_channel if item.from_channel else item.channel
title = item.fulltitle.rstrip()
already_renumbered = scrapertools.find_single_match(itemlist[0].title, r'(\d+\D\d+)')
@@ -142,7 +141,6 @@ def config_item(item, itemlist=[], typography='', active=False):
def semiautomatic_config_item(item):
logger.info()
# Configurazione Semi Automatica, utile in caso la numerazione automatica fallisca
tvdb.find_and_set_infoLabels(item)
item.channel = item.from_channel if item.from_channel else item.channel
dict_series = load(item)
@@ -295,14 +293,14 @@ def manual_renumeration(item, modify=False):
dict_series[title] = dict_renumerate
itemlist = find_episodes(item)
for item in itemlist:
Title = re.sub(r'\d+x\d+ - ', '', item.title)
for it in itemlist:
Title = re.sub(r'\d+x\d+ - ', '', it.title)
if modify == True:
ep = int(scrapertools.find_single_match(Title, r'(\d+)'))
if item.action == 'findvideos' and str(ep) not in EpisodeDict:
if it.action == 'findvideos' and str(ep) not in EpisodeDict:
_list.append(Title)
else:
if item.action == 'findvideos':
if it.action == 'findvideos':
_list.append(Title)
count = 1
@@ -317,6 +315,8 @@ def manual_renumeration(item, modify=False):
season = ''
while not season:
season = platformtools.dialog_numeric(0, config.get_localized_string(70733))
count = int(platformtools.dialog_numeric(0, config.get_localized_string(70733)))
for select in selected:
ep = int(scrapertools.find_single_match(_list[select], r'(\d+)'))
if season == '0':

View File

@@ -28,6 +28,8 @@ RATING_ICON = 30005
RATING = 30006
TRAILER = 30007
SEARCH = 30008
NEXT = 30009
PREVIOUS = 30010
LOADING = 30011
COMMANDS = 30012
RECOMANDED = TRAILERS = 30500
@@ -118,12 +120,11 @@ class MainWindow(xbmcgui.WindowXMLDialog):
if not rating: rating = 'N/A'
self.getControl(FANART).setImage(fanart)
self.getControl(RATING).setText(rating)
if self.getFocus() > 0:
cast, actors = get_cast(self.getControl(self.getFocusId()).getSelectedItem())
self.getControl(ACTORS).reset()
self.getControl(ACTORS).addItems(actors)
self.getControl(CAST).reset()
self.getControl(CAST).addItems(cast)
cast, actors = get_cast(self.getControl(self.getFocusId()).getSelectedItem())
self.getControl(ACTORS).reset()
self.getControl(ACTORS).addItems(actors)
self.getControl(CAST).reset()
self.getControl(CAST).addItems(cast)
action = action.getId()
if action in [BACKSPACE]:
self.close()
@@ -344,6 +345,75 @@ class TrailerWindow(xbmcgui.WindowXMLDialog):
elif action in [EXIT]:
self.close()
class images(xbmcgui.WindowDialog):
def __init__(self, *args, **kwargs):
self.tmdb = kwargs.get("tmdb", {})
self.imdb = kwargs.get("imdb", {})
self.mal = kwargs.get("mal", {})
self.fanartv = kwargs.get("fanartv", {})
self.image_list = []
for key, value in self.tmdb.items():
for detail in value: self.image_list.append('http://image.tmdb.org/t/p/original' + detail["file_path"])
for image in self.imdb: self.image_list.append(image["src"])
for image, title in self.mal: self.image_list.append(image)
for key, value in self.fanartv.items():
for image in value: self.image_list.append(image["url"])
#### Kodi 18 Compatibility ####
if config.get_platform(True)['num_version'] < 18: self.setCoordinateResolution(2)
log
self.background = xbmcgui.ControlImage(0, 0, 1280, 720, imagepath('white'), colorDiffuse='FF232323')
self.addControl(self.background)
main_image = self.image_list[0] if self.image_list else ''
self.main_image = xbmcgui.ControlImage(0, 0, 1280, 720, main_image, 2)
self.addControl(self.main_image)
self.close_btn = xbmcgui.ControlButton(0, 0, 1280, 720, '' ,'', '')
self.addControl(self.close_btn)
# BUTTON LEFT
self.btn_left = xbmcgui.ControlButton(0, 330, 60, 60, '', imagepath('previous_focus'), imagepath('previous_nofocus'))
self.addControl(self.btn_left)
self.btn_left.setAnimations([('WindowOpen', 'effect=slide start=-60,0 end=0,0 delay=100 time=200'),('WindowClose', 'effect=slide start=0,0 end=-60,0 delay=100 time=200')])
# BUTTON RIGHT
self.btn_right = xbmcgui.ControlButton(1220, 330, 60, 60, '', imagepath('next_focus'), imagepath('next_nofocus'))
self.addControl(self.btn_right)
self.btn_right.setAnimations([('WindowOpen', 'effect=slide start=60,0 end=0,0 delay=100 time=200'),('WindowClose', 'effect=slide start=0,0 end=60,0 delay=100 time=200')])
self.count = 0
def onAction(self, action):
if action in [BACKSPACE, EXIT]:
self.close()
if action in [RIGHT, DOWN]:
self.count += 1
if self.count > len(self.image_list) -1: self.count = 0
self.main_image.setImage(self.image_list[self.count])
if action in [LEFT, UP]:
self.count -= 1
if self.count < 0: self.count = len(self.image_list) -1
self.main_image.setImage(self.image_list[self.count])
def onControl(self, control):
if control.getId() == self.btn_right.getId():
self.count += 1
if self.count > len(self.image_list) -1: self.count = 0
self.main_image.setImage(self.image_list[self.count])
elif control.getId() == self.btn_left.getId():
self.count -= 1
if self.count < 0: self.count = len(self.image_list) -1
self.main_image.setImage(self.image_list[self.count])
else:
self.close()
def get_recomendations(info):
recommendations = [info]

View File

@@ -371,32 +371,30 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
def add_control_text(self, c):
if xbmcgui.ControlEdit == ControlEdit:
control = xbmcgui.ControlEdit(0, -100, self.controls_width, self.height_control, c["label"],
os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'), 0,
textColor=c["color"], font=self.font, isPassword=c["hidden"], window=self)
control = xbmcgui.ControlEdit(0, -100, self.controls_width, self.height_control,
c["label"], self.font, c["color"], '', 1 | 4,
focusTexture='',
noFocusTexture='')
if c['hidden']: control.setType(xbmcgui.INPUT_TYPE_PASSWORD)
else:
control = xbmcgui.ControlEdit(0, -100, self.controls_width, self.height_control,
c["label"], self.font, c["color"], '', 1 | 4, isPassword=c["hidden"],
focusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
noFocusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'))
image = xbmcgui.ControlImage(0, -100, self.controls_width + 10, self.height_control, os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'))
self.addControl(image)
self.addControl(control)
image.setVisibleCondition('Control.HasFocus(%s)' % control.getId(), True)
control.setVisible(False)
control.setLabel(c["label"])
# frodo fix
s = self.values[c["id"]]
if s is None:
s = ''
if s is None: s = c['default'] if 'default' in c else ''
control.setText(s)
# control.setText(self.values[c["id"]])
control.setWidth(self.controls_width + 10)
control.setWidth(self.controls_width-10)
control.setHeight(self.height_control)
c["control"] = control
c['image'] = image
def add_control_bool(self, c):
# Old versions do not support some textures
@@ -405,24 +403,34 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
label=c["label"], font=self.font, textColor=c["color"],
focusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
noFocusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'))
else:
elif xbmcgui.__version__ in ["3.0", "3.0.0"]:
control = xbmcgui.ControlRadioButton(0, -100, self.controls_width + 20,
self.height_control, label=c["label"], font=self.font,
textColor=c["color"],
focusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
noFocusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'),
focusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
noFocusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
focusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'),
noFocusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'))
else:
control = xbmcgui.ControlRadioButton(0, -100, self.controls_width + 20,
self.height_control, label=c["label"], font=self.font,
textColor=c["color"],
focusTexture='',
noFocusTexture='',
focusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
noFocusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
focusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'),
noFocusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'))
image = xbmcgui.ControlImage(0, -100, self.controls_width + 10, self.height_control, os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'))
self.addControl(image)
self.addControl(control)
image.setVisibleCondition('Control.HasFocus(%s)' % control.getId(), True)
control.setVisible(False)
control.setRadioDimension(x=self.controls_width - (self.height_control - 5), y=0, width=self.height_control - 5, height=self.height_control - 5)
control.setSelected(self.values[c["id"]])
c["control"] = control
c['image'] = image
def onInit(self):
self.getControl(10004).setEnabled(False)
@@ -446,8 +454,6 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
self.getControl(10006).setLabel(self.custom_button['label'])
else:
self.getControl(10006).setVisible(False)
# self.getControl(10004).setPosition(self.getControl(10004).getPosition()[0], self.getControl(10004).getPosition()[1])
# self.getControl(10005).setPosition(self.getControl(10005).getPosition()[0], self.getControl(10005).getPosition()[1])
# Control Area Dimensions
self.controls_width = self.getControl(10007).getWidth() - 30
@@ -543,15 +549,17 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
c["y"] = self.controls_pos_y + visible_count * self.height_control
visible_count += 1
if c["type"] != "list":
if c["type"] == "bool": c["control"].setPosition(self.controls_pos_x, c["y"])
else: c["control"].setPosition(self.controls_pos_x, c["y"])
else:
if c["type"] == "list":
c["control"].setPosition(self.controls_pos_x, c["y"])
if xbmcgui.__version__ == "1.2": c["label"].setPosition(self.controls_pos_x + self.controls_width - 30, c["y"])
else: c["label"].setPosition(self.controls_pos_x, c["y"])
else:
if c["type"] == "bool": c["control"].setPosition(self.controls_pos_x, c["y"])
elif c['type'] == 'text': c["control"].setPosition(self.controls_pos_x +10, c["y"])
else: c["control"].setPosition(self.controls_pos_x, c["y"])
if c['type'] in ['bool', 'text']:c['image'].setPosition(self.controls_pos_x, c["y"])
self.set_visible(c, True)
# Calculate the position and size of the ScrollBar

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

View File

@@ -864,7 +864,7 @@ def get_episodes(item):
itemlist = []
if episodes and not scrapertools.find_single_match(episodes[0].title, r'(\d+.\d+)') and item.channel not in ['videolibrary'] and item.action != 'season':
from core.autorenumber import select_type, renumber, check
from platformcode.autorenumber import select_type, renumber, check
# support.dbg()
if not check(item):
select_type(item)

View File

@@ -469,7 +469,6 @@ def findvideos(item):
item_json = Item().fromjson(filetools.read(json_path))
list_servers = []
# from core.support import dbg;dbg()
try:
# FILTERTOOLS
@@ -995,13 +994,13 @@ def delete(item):
heading = config.get_localized_string(70085)
if item.multichannel:
# Get channel list
channels = []
opciones = []
for k in list(item.library_urls.keys()):
if k != "downloads":
opciones.append(config.get_localized_string(70086) % k.capitalize())
channels.append(k)
if item.dead == '':
opciones = []
channels = []
for k in list(item.library_urls.keys()):
if k != "downloads":
opciones.append(config.get_localized_string(70086) % k.capitalize())
channels.append(k)
opciones.insert(0, heading)
index = platformtools.dialog_select(config.get_localized_string(30163), opciones)