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

@@ -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