Remove run_get_select_title

This commit is contained in:
Dark1291 2025-02-11 12:49:12 +01:00
parent 88edb3766c
commit 3bf63e9166
17 changed files with 33 additions and 91 deletions

View File

@ -1,16 +1,15 @@
# 02.07.24
import sys
import subprocess
from urllib.parse import quote_plus
# Internal utilities
from StreamingCommunity.Util.console import console, msg
from StreamingCommunity.Api.Template import get_select_title
# Logic class
from .site import title_search, run_get_select_title, media_search_manager
from .site import title_search, media_search_manager, table_show_manager
from .title import download_title
@ -40,7 +39,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
if len_database > 0:
# Select title from list
select_title = run_get_select_title()
select_title = get_select_title(table_show_manager, media_search_manager)
# Download title
download_title(select_title)

View File

@ -13,7 +13,6 @@ from StreamingCommunity.Util.table import TVShowManager
# Logic class
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.Api.Template.Util import search_domain
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
@ -77,11 +76,4 @@ def title_search(word_to_search: str) -> int:
print(f"Error parsing a film entry: {e}")
# Return the number of titles found
return media_search_manager.get_length()
def run_get_select_title():
"""
Display a selection of titles and prompt the user to choose one.
"""
return get_select_title(table_show_manager, media_search_manager)
return media_search_manager.get_length()

View File

@ -7,11 +7,12 @@ from urllib.parse import quote_plus
# Internal utilities
from StreamingCommunity.Util.console import console, msg
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
# Logic class
from .site import title_search, run_get_select_title, media_search_manager
from .site import title_search, media_search_manager, table_show_manager
from .film import download_film
@ -60,7 +61,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
if len_database > 0:
# Select title from list
select_title = run_get_select_title()
select_title = get_select_title(table_show_manager, media_search_manager)
# Download only film
download_film(select_title)

View File

@ -13,7 +13,6 @@ from StreamingCommunity.Util.table import TVShowManager
# Logic class
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.Api.Template.Util import search_domain
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
@ -107,11 +106,4 @@ def title_search(title_search: str) -> int:
bot.send_message(f"Lista dei risultati:", choices)
# Return the number of titles found
return media_search_manager.get_length()
def run_get_select_title():
"""
Display a selection of titles and prompt the user to choose one.
"""
return get_select_title(table_show_manager, media_search_manager)
return media_search_manager.get_length()

View File

@ -2,16 +2,16 @@
import sys
import subprocess
from urllib.parse import quote_plus
# Internal utilities
from StreamingCommunity.Util.console import console, msg
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
# Logic class
from .site import title_search, run_get_select_title, media_search_manager
from .site import title_search, media_search_manager, table_show_manager
from .film_serie import download_film, download_series
@ -58,7 +58,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
if len_database > 0:
# Select title from list (type: TV \ Movie \ OVA)
select_title = run_get_select_title()
select_title = get_select_title(table_show_manager, media_search_manager)
if select_title.type == 'Movie' or select_title.type == 'OVA':
download_film(select_title)

View File

@ -16,7 +16,6 @@ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
# Logic class
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.Api.Template.Util import search_domain
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
@ -182,11 +181,4 @@ def title_search(title: str) -> int:
bot.send_message(f"Lista dei risultati:", choices)
# Return the length of media search manager
return media_search_manager.get_length()
def run_get_select_title():
"""
Display a selection of titles and prompt the user to choose one.
"""
return get_select_title(table_show_manager, media_search_manager)
return media_search_manager.get_length()

View File

@ -5,10 +5,11 @@ from urllib.parse import quote_plus
# Internal utilities
from StreamingCommunity.Util.console import console, msg
from StreamingCommunity.Api.Template import get_select_title
# Logic class
from .site import title_search, run_get_select_title, media_search_manager
from .site import title_search, media_search_manager, table_show_manager
from .film import download_film
@ -39,7 +40,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
if len_database > 0:
# Select title from list
select_title = run_get_select_title()
select_title = get_select_title(table_show_manager, media_search_manager)
# !!! ADD TYPE DONT WORK FOR SERIE
download_film(select_title)

View File

@ -12,7 +12,6 @@ from StreamingCommunity.Util.table import TVShowManager
# Logic class
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.Api.Template.Util import search_domain
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
@ -73,11 +72,4 @@ def title_search(word_to_search: str) -> int:
print(f"Error parsing a film entry: {e}")
# Return the number of titles found
return media_search_manager.get_length()
def run_get_select_title():
"""
Display a selection of titles and prompt the user to choose one.
"""
return get_select_title(table_show_manager, media_search_manager)
return media_search_manager.get_length()

View File

@ -6,10 +6,11 @@ from urllib.parse import quote_plus
# Internal utilities
from StreamingCommunity.Util.console import console, msg
from StreamingCommunity.Api.Template import get_select_title
# Logic class
from .site import title_search, run_get_select_title, media_search_manager
from .site import title_search, media_search_manager, table_show_manager
from .series import download_thread
@ -40,7 +41,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
if len_database > 0:
# Select title from list
select_title = run_get_select_title()
select_title = get_select_title(table_show_manager, media_search_manager)
# Download only film
if "Serie TV" in str(select_title.type):

View File

@ -16,7 +16,6 @@ from StreamingCommunity.Util.table import TVShowManager
# Logic class
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.Api.Template.Util import search_domain
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
@ -89,11 +88,4 @@ def title_search(word_to_search: str) -> int:
logging.error("No table content found.")
return -999
return -9999
def run_get_select_title():
"""
Display a selection of titles and prompt the user to choose one.
"""
return get_select_title(table_show_manager, media_search_manager)
return -9999

View File

@ -5,10 +5,11 @@ from urllib.parse import quote_plus
# Internal utilities
from StreamingCommunity.Util.console import console, msg
from StreamingCommunity.Api.Template import get_select_title
# Logic class
from .site import title_search, run_get_select_title, media_search_manager
from .site import title_search, media_search_manager, table_show_manager
from .series import download_series
@ -39,7 +40,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
if len_database > 0:
# Select title from list
select_title = run_get_select_title()
select_title = get_select_title(table_show_manager, media_search_manager)
# Download only film
download_series(select_title)

View File

@ -13,7 +13,6 @@ from StreamingCommunity.Util.table import TVShowManager
# Logic class
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.Api.Template.Util import search_domain
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
@ -80,11 +79,4 @@ def title_search(word_to_search: str) -> int:
print(f"Error parsing a film entry: {e}")
# Return the number of titles found
return media_search_manager.get_length()
def run_get_select_title():
"""
Display a selection of titles and prompt the user to choose one.
"""
return get_select_title(table_show_manager, media_search_manager)
return media_search_manager.get_length()

View File

@ -6,10 +6,11 @@ from urllib.parse import quote_plus
# Internal utilities
from StreamingCommunity.Util.console import console, msg
from StreamingCommunity.Api.Template import get_select_title
# Logic class
from .site import title_search, run_get_select_title, media_search_manager
from .site import title_search, media_search_manager, table_show_manager
from .title import download_title
@ -40,7 +41,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
if len_database > 0:
# Select title from list
select_title = run_get_select_title()
select_title = get_select_title(table_show_manager, media_search_manager)
# Download title
download_title(select_title)

View File

@ -7,7 +7,6 @@ from StreamingCommunity.Util.table import TVShowManager
# Logic class
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.Api.Template.Util import search_domain
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
from .util.ilCorsarScraper import IlCorsaroNeroScraper
@ -62,11 +61,4 @@ async def title_search(word_to_search: str) -> int:
print(f"Error parsing a film entry: {e}")
# Return the number of titles found
return media_search_manager.get_length()
def run_get_select_title():
"""
Display a selection of titles and prompt the user to choose one.
"""
return get_select_title(table_show_manager, media_search_manager)
return media_search_manager.get_length()

View File

@ -7,11 +7,12 @@ from urllib.parse import quote_plus
# Internal utilities
from StreamingCommunity.Util.console import console, msg
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
# Logic class
from .site import get_version_and_domain, title_search, run_get_select_title, media_search_manager
from .site import get_version_and_domain, title_search, table_show_manager, media_search_manager
from .film import download_film
from .series import download_series
@ -62,7 +63,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
if len_database > 0:
# Select title from list
select_title = run_get_select_title()
select_title = get_select_title(table_show_manager, media_search_manager)
if select_title.type == 'tv':
download_series(select_title, site_version)

View File

@ -19,7 +19,6 @@ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
# Logic class
from StreamingCommunity.Api.Template import get_select_title
from StreamingCommunity.Api.Template.Util import search_domain
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
@ -147,11 +146,4 @@ def title_search(title_search: str, domain: str) -> int:
bot.send_message(f"Lista dei risultati:", choices)
# Return the number of titles found
return media_search_manager.get_length()
def run_get_select_title():
"""
Display a selection of titles and prompt the user to choose one.
"""
return get_select_title(table_show_manager, media_search_manager)
return media_search_manager.get_length()

View File

@ -145,6 +145,7 @@ def initialize():
except:
console.log("[red]Error with loading github.")
def restart_script():
"""Riavvia lo script con gli stessi argomenti della riga di comando."""
print("\n🔄 Riavvio dello script...\n")