Disattivato animepertutti e cerca con kod
This commit is contained in:
@@ -14,12 +14,12 @@
|
|||||||
<menu id="kodi.core.main">
|
<menu id="kodi.core.main">
|
||||||
<item library="updatetvshow.py">
|
<item library="updatetvshow.py">
|
||||||
<label>70269</label>
|
<label>70269</label>
|
||||||
<visible>String.StartsWith(ListItem.FileNameAndPath, 'plugin://plugin.video.kod/') + String.IsEqual(ListItem.dbtype,tvshow)</visible>
|
<visible>String.IsEqual(ListItem.dbtype,tvshow)</visible>
|
||||||
</item>
|
|
||||||
<item library="externalsearch.py">
|
|
||||||
<label>90001</label>
|
|
||||||
<visible>!String.StartsWith(ListItem.FileNameAndPath, 'plugin://plugin.video.kod/') + [String.IsEqual(ListItem.dbtype,tvshow) | String.IsEqual(ListItem.dbtype,movie)]</visible>
|
|
||||||
</item>
|
</item>
|
||||||
|
<!-- <item library="externalsearch.py">-->
|
||||||
|
<!-- <label>90001</label>-->
|
||||||
|
<!-- <visible>!String.StartsWith(ListItem.FileNameAndPath, plugin://plugin.video.kod/) + [String.IsEqual(ListItem.dbtype,tvshow) | String.IsEqual(ListItem.dbtype,movie)]</visible>-->
|
||||||
|
<!-- </item>-->
|
||||||
</menu>
|
</menu>
|
||||||
</extension>
|
</extension>
|
||||||
<extension point="xbmc.addon.metadata">
|
<extension point="xbmc.addon.metadata">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "animeleggendari",
|
"id": "animeleggendari",
|
||||||
"name": "AnimePerTutti",
|
"name": "AnimePerTutti",
|
||||||
"active": true,
|
"active": false,
|
||||||
"language": ["ita", "sub-ita"],
|
"language": ["ita", "sub-ita"],
|
||||||
"thumbnail": "animepertutti.png",
|
"thumbnail": "animepertutti.png",
|
||||||
"bannermenu": "animepertutti.png",
|
"bannermenu": "animepertutti.png",
|
||||||
|
|||||||
+57
-59
@@ -10,73 +10,71 @@ from core import tmdb
|
|||||||
from core.item import Item
|
from core.item import Item
|
||||||
|
|
||||||
def execute_search():
|
def execute_search():
|
||||||
"""
|
"""
|
||||||
Gather the selected ListItem's attributes in order to compute the `Item` parameters
|
Gather the selected ListItem's attributes in order to compute the `Item` parameters
|
||||||
and perform the KOD's globalsearch.
|
and perform the KOD's globalsearch.
|
||||||
Globalsearch will be executed specifing the content-type of the selected ListItem
|
Globalsearch will be executed specifing the content-type of the selected ListItem
|
||||||
|
|
||||||
NOTE: this method needs the DBTYPE and TMDB_ID specified as ListItem's properties
|
NOTE: this method needs the DBTYPE and TMDB_ID specified as ListItem's properties
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# These following lines are commented and keep in the code just as reminder.
|
# These following lines are commented and keep in the code just as reminder.
|
||||||
# In future, they could be used to filter the search outcome
|
# In future, they could be used to filter the search outcome
|
||||||
|
|
||||||
# ADDON: maybe can we know if the current windows is related to a specific addon?
|
# ADDON: maybe can we know if the current windows is related to a specific addon?
|
||||||
# we could skip the ContextMenu if we already are in KOD's window
|
# we could skip the ContextMenu if we already are in KOD's window
|
||||||
|
|
||||||
tmdbid = xbmc.getInfoLabel('ListItem.Property(tmdb_id)')
|
tmdbid = xbmc.getInfoLabel('ListItem.Property(tmdb_id)')
|
||||||
mediatype = xbmc.getInfoLabel('ListItem.DBTYPE')
|
mediatype = xbmc.getInfoLabel('ListItem.DBTYPE')
|
||||||
title = xbmc.getInfoLabel('ListItem.Title')
|
title = xbmc.getInfoLabel('ListItem.Title')
|
||||||
year = xbmc.getInfoLabel('ListItem.Year')
|
year = xbmc.getInfoLabel('ListItem.Year')
|
||||||
imdb = xbmc.getInfoLabel('ListItem.IMDBNumber')
|
imdb = xbmc.getInfoLabel('ListItem.IMDBNumber')
|
||||||
# folderPath = xbmc.getInfoLabel('Container.FolderPath')
|
# folderPath = xbmc.getInfoLabel('Container.FolderPath')
|
||||||
# filePath = xbmc.getInfoLabel('ListItem.FileNameAndPath')
|
# filePath = xbmc.getInfoLabel('ListItem.FileNameAndPath')
|
||||||
|
# logger.info("****")
|
||||||
|
# logger.info( xbmc.getCondVisibility("String.Contains(Container.FolderPath, 'plugin.video.kod')") )
|
||||||
|
# logger.info( xbmc.getCondVisibility("String.Contains(ListItem.FileNameAndPath, 'plugin.video.kod')") )
|
||||||
|
# logger.info( xbmc.getCondVisibility("String.IsEqual(ListItem.dbtype,tvshow)") )
|
||||||
|
# logger.info( xbmc.getCondVisibility("String.IsEqual(ListItem.dbtype,movie)") )
|
||||||
|
# logger.info("****")
|
||||||
|
|
||||||
|
# visible = xbmc.getCondVisibility("!String.StartsWith(ListItem.FileNameAndPath, 'plugin://plugin.video.kod/') + [String.IsEqual(ListItem.dbtype,tvshow) | String.IsEqual(ListItem.dbtype,movie)]")
|
||||||
|
|
||||||
|
logstr = "Selected ListItem is: 'IMDB: {}' - TMDB: {}' - 'Title: {}' - 'Year: {}'' - 'Type: {}'".format(imdb, tmdbid, title, year, mediatype)
|
||||||
|
logger.info(logstr)
|
||||||
|
|
||||||
|
if not tmdbid and imdb:
|
||||||
|
logger.info('No TMDBid found. Try to get by IMDB')
|
||||||
|
it = Item(contentType= mediatype, infoLabels={'imdb_id' : imdb})
|
||||||
|
tmdb.set_infoLabels(it)
|
||||||
|
tmdbid = it.infoLabels.get('tmdb_id', '')
|
||||||
|
|
||||||
|
if not tmdbid:
|
||||||
|
logger.info('No TMDBid found. Try to get by Title/Year')
|
||||||
|
it = Item(contentTitle= title, contentType= mediatype, infoLabels={'year' : year})
|
||||||
|
tmdb.set_infoLabels(it)
|
||||||
|
tmdbid = it.infoLabels.get('tmdb_id', '')
|
||||||
|
|
||||||
|
|
||||||
# logger.info("****")
|
item = Item(
|
||||||
# logger.info( xbmc.getCondVisibility("String.Contains(Container.FolderPath, 'plugin.video.kod')") )
|
action="Search",
|
||||||
# logger.info( xbmc.getCondVisibility("String.Contains(ListItem.FileNameAndPath, 'plugin.video.kod')") )
|
channel="globalsearch",
|
||||||
# logger.info( xbmc.getCondVisibility("String.IsEqual(ListItem.dbtype,tvshow)") )
|
contentType= mediatype,
|
||||||
# logger.info( xbmc.getCondVisibility("String.IsEqual(ListItem.dbtype,movie)") )
|
mode="search",
|
||||||
# logger.info("****")
|
text= title,
|
||||||
|
type= mediatype,
|
||||||
|
infoLabels= {
|
||||||
|
'tmdb_id': tmdbid,
|
||||||
|
'year': year
|
||||||
|
},
|
||||||
|
folder= False
|
||||||
|
)
|
||||||
|
|
||||||
# visible = xbmc.getCondVisibility("!String.StartsWith(ListItem.FileNameAndPath, 'plugin://plugin.video.kod/') + [String.IsEqual(ListItem.dbtype,tvshow) | String.IsEqual(ListItem.dbtype,movie)]")
|
logger.info("Invoking Item: {}".format(item.tostring()))
|
||||||
|
|
||||||
logstr = "Selected ListItem is: 'IMDB: {}' - TMDB: {}' - 'Title: {}' - 'Year: {}'' - 'Type: {}'".format(imdb, tmdbid, title, year, mediatype)
|
itemurl = item.tourl()
|
||||||
logger.info(logstr)
|
xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?" + itemurl + ")")
|
||||||
|
|
||||||
if not tmdbid and imdb:
|
|
||||||
logger.info('No TMDBid found. Try to get by IMDB')
|
|
||||||
it = Item(contentType= mediatype, infoLabels={'imdb_id' : imdb})
|
|
||||||
tmdb.set_infoLabels(it)
|
|
||||||
tmdbid = it.infoLabels.get('tmdb_id', '')
|
|
||||||
|
|
||||||
if not tmdbid:
|
|
||||||
logger.info('No TMDBid found. Try to get by Title/Year')
|
|
||||||
it = Item(contentTitle= title, contentType= mediatype, infoLabels={'year' : year})
|
|
||||||
tmdb.set_infoLabels(it)
|
|
||||||
tmdbid = it.infoLabels.get('tmdb_id', '')
|
|
||||||
|
|
||||||
|
|
||||||
item = Item(
|
|
||||||
action="Search",
|
|
||||||
channel="globalsearch",
|
|
||||||
contentType= mediatype,
|
|
||||||
mode="search",
|
|
||||||
text= title,
|
|
||||||
type= mediatype,
|
|
||||||
infoLabels= {
|
|
||||||
'tmdb_id': tmdbid,
|
|
||||||
'year': year
|
|
||||||
},
|
|
||||||
folder= False
|
|
||||||
)
|
|
||||||
|
|
||||||
logger.info("Invoking Item: {}".format(item.tostring()))
|
|
||||||
|
|
||||||
itemurl = item.tourl()
|
|
||||||
xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?" + itemurl + ")")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
execute_search()
|
execute_search()
|
||||||
|
|||||||
Reference in New Issue
Block a user