- Aggiungi alla videoteca se non si sa se è un film o una serie
This commit is contained in:
+6
-3
@@ -410,15 +410,18 @@ def set_infoLabels_item(item, seekTmdb=True, search_language=def_lang, lock=None
|
|||||||
# do it by title
|
# do it by title
|
||||||
if search_type == 'tv':
|
if search_type == 'tv':
|
||||||
# Serial search by title and filtering your results if necessary
|
# Serial search by title and filtering your results if necessary
|
||||||
otmdb = Tmdb(searched_text=scrapertools.unescape(item.infoLabels['tvshowtitle']), search_type=search_type,
|
searched_title = scrapertools.unescape(item.infoLabels['tvshowtitle'])
|
||||||
|
searched_title = searched_title.split('-')[0].strip()
|
||||||
|
otmdb = Tmdb(searched_text=searched_title, search_type=search_type,
|
||||||
search_language=search_language, filtro=item.infoLabels.get('filtro', {}),
|
search_language=search_language, filtro=item.infoLabels.get('filtro', {}),
|
||||||
year=item.infoLabels['year'])
|
year=item.infoLabels['year'])
|
||||||
else:
|
else:
|
||||||
# Movie search by title ...
|
# Movie search by title ...
|
||||||
# if item.infoLabels['year'] or item.infoLabels['filtro']:
|
# if item.infoLabels['year'] or item.infoLabels['filtro']:
|
||||||
# ...and year or filter
|
# ...and year or filter
|
||||||
searched_title = item.contentTitle if item.contentTitle else item.fulltitle
|
searched_title = scrapertools.unescape(item.contentTitle if item.contentTitle else item.fulltitle)
|
||||||
otmdb = Tmdb(searched_text=scrapertools.unescape(searched_title), search_type=search_type, search_language=search_language,
|
searched_title = searched_title.split('-')[0].strip()
|
||||||
|
otmdb = Tmdb(searched_text=searched_title, search_type=search_type, search_language=search_language,
|
||||||
filtro=item.infoLabels.get('filtro', {}), year=item.infoLabels['year'])
|
filtro=item.infoLabels.get('filtro', {}), year=item.infoLabels['year'])
|
||||||
if otmdb is not None:
|
if otmdb is not None:
|
||||||
if otmdb.get_id() and config.get_setting("tmdb_plus_info", default=False):
|
if otmdb.get_id() and config.get_setting("tmdb_plus_info", default=False):
|
||||||
|
|||||||
@@ -949,6 +949,14 @@ def get_local_content(path):
|
|||||||
return local_episodelist
|
return local_episodelist
|
||||||
|
|
||||||
|
|
||||||
|
def add_to_videolibrary(item, channel):
|
||||||
|
itemlist = getattr(channel, item.from_action)(item)
|
||||||
|
if itemlist and itemlist[0].contentType == 'episode':
|
||||||
|
return add_tvshow(item, channel)
|
||||||
|
else:
|
||||||
|
return add_movie(item)
|
||||||
|
|
||||||
|
|
||||||
def add_movie(item):
|
def add_movie(item):
|
||||||
"""
|
"""
|
||||||
Keep a movie at the movie library. The movie can be a link within a channel or a previously downloaded video.
|
Keep a movie at the movie library. The movie can be a link within a channel or a previously downloaded video.
|
||||||
@@ -966,6 +974,7 @@ def add_movie(item):
|
|||||||
"""
|
"""
|
||||||
logger.debug()
|
logger.debug()
|
||||||
from platformcode.launcher import set_search_temp; set_search_temp(item)
|
from platformcode.launcher import set_search_temp; set_search_temp(item)
|
||||||
|
item.contentType = 'movie'
|
||||||
|
|
||||||
# To disambiguate titles, TMDB is caused to ask for the really desired title
|
# To disambiguate titles, TMDB is caused to ask for the really desired title
|
||||||
# The user can select the title among those offered on the first screen
|
# The user can select the title among those offered on the first screen
|
||||||
@@ -1012,6 +1021,7 @@ def add_tvshow(item, channel=None):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
logger.debug("show=#" + item.show + "#")
|
logger.debug("show=#" + item.show + "#")
|
||||||
|
item.contentType = 'tvshow'
|
||||||
from platformcode.launcher import set_search_temp; set_search_temp(item)
|
from platformcode.launcher import set_search_temp; set_search_temp(item)
|
||||||
|
|
||||||
if item.channel == "downloads":
|
if item.channel == "downloads":
|
||||||
|
|||||||
@@ -237,6 +237,11 @@ def run(item=None):
|
|||||||
from core import videolibrarytools
|
from core import videolibrarytools
|
||||||
videolibrarytools.add_tvshow(item, channel)
|
videolibrarytools.add_tvshow(item, channel)
|
||||||
|
|
||||||
|
# Special action for adding a undefined to the library
|
||||||
|
elif item.action == "add_to_library":
|
||||||
|
from core import videolibrarytools
|
||||||
|
videolibrarytools.add_to_videolibrary(item, channel)
|
||||||
|
|
||||||
# Special action for downloading all episodes from a serie
|
# Special action for downloading all episodes from a serie
|
||||||
elif item.action == "download_all_episodes":
|
elif item.action == "download_all_episodes":
|
||||||
from specials import downloads
|
from specials import downloads
|
||||||
|
|||||||
@@ -621,6 +621,9 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
|
|||||||
# Add Movie to Video Library
|
# Add Movie to Video Library
|
||||||
elif item.action in ["detail", "findvideos"] and item.contentType == 'movie' and item.contentTitle:
|
elif item.action in ["detail", "findvideos"] and item.contentType == 'movie' and item.contentTitle:
|
||||||
context_commands.append((config.get_localized_string(60353), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_pelicula_to_library&from_action=' + item.action)))
|
context_commands.append((config.get_localized_string(60353), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_pelicula_to_library&from_action=' + item.action)))
|
||||||
|
# Add to Video Library
|
||||||
|
elif item.action in ['check'] and item.contentTitle:
|
||||||
|
context_commands.append((config.get_localized_string(30161), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_to_library&from_action=' + item.action)))
|
||||||
|
|
||||||
if not item.local and item.channel not in ["downloads", "filmontv", "search"] and item.server != 'torrent' and parent_item.action != 'mainlist' and config.get_setting('downloadenabled'):
|
if not item.local and item.channel not in ["downloads", "filmontv", "search"] and item.server != 'torrent' and parent_item.action != 'mainlist' and config.get_setting('downloadenabled'):
|
||||||
# Download movie
|
# Download movie
|
||||||
|
|||||||
Reference in New Issue
Block a user