mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-05 02:55:25 +00:00
* fix create config.json * fix messagge telegram_bot option 0 (Streamingcommunity)
This commit is contained in:
parent
e75d8185f9
commit
fc83ffc370
@ -97,7 +97,21 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
|
||||
return
|
||||
|
||||
if string_to_search is None:
|
||||
string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
|
||||
if site_constant.TELEGRAM_BOT:
|
||||
bot = get_bot_instance()
|
||||
string_to_search = bot.ask(
|
||||
"key_search",
|
||||
f"Enter the search term\nor type 'back' to return to the menu: ",
|
||||
None
|
||||
)
|
||||
|
||||
if string_to_search == 'back':
|
||||
|
||||
# Restart the script
|
||||
subprocess.Popen([sys.executable] + sys.argv)
|
||||
sys.exit()
|
||||
else:
|
||||
string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
|
||||
|
||||
# Search on database
|
||||
len_database = title_search(string_to_search)
|
||||
|
@ -36,8 +36,13 @@ class ConfigManager:
|
||||
base_path = os.path.dirname(sys.executable)
|
||||
|
||||
else:
|
||||
# Use the current directory where the script is executed
|
||||
base_path = os.getcwd()
|
||||
|
||||
# Get the actual path of the module file
|
||||
current_file_path = os.path.abspath(__file__)
|
||||
# Navigate upwards to find the project root
|
||||
# Assuming this file is in a package structure like StreamingCommunity/Util/config_json.py
|
||||
# We need to go up 2 levels to reach the project root
|
||||
base_path = os.path.dirname(os.path.dirname(os.path.dirname(current_file_path)))
|
||||
|
||||
# Initialize file paths
|
||||
self.file_path = os.path.join(base_path, file_name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user