- Aggiungi alla videoteca se non si sa se è un film o una serie

This commit is contained in:
Alhaziel01
2021-07-05 20:08:41 +02:00
parent 1762d5bf83
commit 44a8f0cad0
4 changed files with 24 additions and 3 deletions

View File

@@ -410,15 +410,18 @@ def set_infoLabels_item(item, seekTmdb=True, search_language=def_lang, lock=None
# do it by title
if search_type == 'tv':
# 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', {}),
year=item.infoLabels['year'])
else:
# Movie search by title ...
# if item.infoLabels['year'] or item.infoLabels['filtro']:
# ...and year or filter
searched_title = 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 = scrapertools.unescape(item.contentTitle if item.contentTitle else item.fulltitle)
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'])
if otmdb is not None:
if otmdb.get_id() and config.get_setting("tmdb_plus_info", default=False):

View File

@@ -949,6 +949,14 @@ def get_local_content(path):
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):
"""
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()
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
# 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 + "#")
item.contentType = 'tvshow'
from platformcode.launcher import set_search_temp; set_search_temp(item)
if item.channel == "downloads":

View File

@@ -237,6 +237,11 @@ def run(item=None):
from core import videolibrarytools
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
elif item.action == "download_all_episodes":
from specials import downloads

View File

@@ -621,6 +621,9 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
# Add Movie to Video Library
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)))
# 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'):
# Download movie