Ricerca Globale Risultati Verificati raggruppati

This commit is contained in:
Alhaziel01
2020-12-05 13:02:30 +01:00
committed by marco
parent 00a4195da8
commit ce4a810804
3 changed files with 32 additions and 43 deletions

View File

@@ -282,18 +282,18 @@ class SearchWindow(xbmcgui.WindowXML):
pass
self.count += 1
if self.item.mode == 'all': self.update(channel, results)
else: self.update(channel, valid + other)
self.update(channel, valid, other if other else results)
def makeItem(self, url):
item = Item().fromurl(url)
logger.debug()
channelParams = channeltools.get_channel_parameters(item.channel)
thumb = item.thumbnail if item.thumbnail else 'Infoplus/' + item.contentType.replace('show', '') + '.png'
logger.info('THUMB', thumb)
it = xbmcgui.ListItem(item.title)
it.setProperties({'thumb': thumb, 'fanart': item.fanart, 'verified': item.verified, 'plot': item.plot,
'year': '[' + str(item.year if item.year else item.infoLabels.get('year', '')) + ']',
'item': url})
'item': url, 'channel':channelParams['title']})
if item.server:
color = scrapertools.find_single_match(item.alive, r'(FF[^\]]+)')
it.setProperties({'channel': channeltools.get_channel_parameters(item.channel).get('title', ''),
@@ -303,10 +303,35 @@ class SearchWindow(xbmcgui.WindowXML):
return it
def update(self, channel, results):
def update(self, channel, valid, results):
if self.exit:
return
logger.debug('Search on channel', channel)
if self.item.mode != 'all' and 'valid' not in self.results:
self.results['valid'] = 0
item = xbmcgui.ListItem('valid')
item.setProperties({'thumb': 'valid.png',
'position': '0',
'results': '0'})
self.channels.append(item)
pos = self.CHANNELS.getSelectedPosition()
self.CHANNELS.reset()
self.CHANNELS.addItems(self.channels)
self.CHANNELS.selectItem(pos)
self.setFocusId(CHANNELS)
if valid:
item = self.CHANNELS.getListItem(0)
resultsList = item.getProperty('items')
for result in valid:
resultsList += result.tourl() + '|'
item.setProperty('items',resultsList)
self.channels[0].setProperty('results', str(len(resultsList.split('|')) - 1))
channelResults = self.CHANNELS.getListItem(0).getProperty('items').split('|')
items = []
for result in channelResults:
if result: items.append(self.makeItem(result))
self.RESULTS.reset()
self.RESULTS.addItems(items)
if results:
resultsList = ''
channelParams = channeltools.get_channel_parameters(channel)
@@ -316,8 +341,7 @@ class SearchWindow(xbmcgui.WindowXML):
item = xbmcgui.ListItem(name)
item.setProperties({'thumb': channelParams['thumbnail'],
'position': '0',
'results': str(len(results)),
'verified': results[0].verified
'results': str(len(results))
})
for result in results:
resultsList += result.tourl() + '|'
@@ -343,6 +367,7 @@ class SearchWindow(xbmcgui.WindowXML):
if result: items.append(self.makeItem(result))
self.RESULTS.reset()
self.RESULTS.addItems(items)
percent = (float(self.count) / len(self.searchActions)) * 100
self.LOADING.setVisible(False)
self.PROGRESS.setPercent(percent)

View File

@@ -73,7 +73,7 @@
<!-- <font>font30_title</font> -->
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(102).ListItem.Label] [B][COLOR FFAAAAAA]$INFO[Container(102).ListItem.Property(year)] [CR]$INFO[Container(101).ListItem.Label][/COLOR][/B]</label>
<label>$INFO[Container(102).ListItem.Label] [B][COLOR FFAAAAAA]$INFO[Container(102).ListItem.Property(year)] [CR]$INFO[Container(102).ListItem.Property(channel)][/COLOR][/B]</label>
<align>left</align>
<aligny>center</aligny>
</control>
@@ -139,15 +139,6 @@
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
<control type="image">
<description>Item Verified</description>
<top>315</top>
<left>145</left>
<width>20</width>
<height>20</height>
<texture colordiffuse="FF0082C2">$INFO[ListItem.Property(verified)]</texture>
<aspectratio>scale</aspectratio>
</control>
</itemlayout>
<focusedlayout height="570" width="380">
<control type="image">
@@ -172,15 +163,6 @@
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
<control type="image">
<description>Item Verified</description>
<top>15</top>
<left>330</left>
<width>40</width>
<height>40</height>
<texture colordiffuse="FF0082C2">$INFO[ListItem.Property(verified)]</texture>
<aspectratio>scale</aspectratio>
</control>
</focusedlayout>
</control>
</control> <!-- END Search Result Group -->
@@ -259,15 +241,6 @@
<align>center</align>
<aligny>center</aligny>
</control>
<control type="image">
<description>Verified</description>
<top>5</top>
<left>5</left>
<width>30</width>
<height>30</height>
<texture colordiffuse="880082C2">$INFO[ListItem.Property(verified)]</texture>
<aspectratio>scale</aspectratio>
</control>
</itemlayout>
<focusedlayout height="150" width="150">
<control type="image">
@@ -288,15 +261,6 @@
<texture colordiffuse="880082C2">white.png</texture>
<aspectratio>scale</aspectratio>
</control>
<control type="image">
<description>Verified</description>
<top>5</top>
<left>5</left>
<width>30</width>
<height>30</height>
<texture colordiffuse="FF0082C2">$INFO[ListItem.Property(verified)]</texture>
<aspectratio>scale</aspectratio>
</control>
<control type="textbox">
<description>Results Count</description>
<left>110</left>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB