mirror of
https://github.com/Paillat-dev/FABLE.git
synced 2026-01-02 01:06:20 +00:00
fix(main.py): handle case when skip_channel_default setting is provided and is not None, by loading the specified channel instead of prompting the user for input
feat(main.py): add support for skip_channel_default setting to skip the channel selection prompt and load a specific channel automatically
This commit is contained in:
30
main.py
30
main.py
@@ -87,18 +87,28 @@ async def main():
|
|||||||
channel = Channel()
|
channel = Channel()
|
||||||
await channel.create()
|
await channel.create()
|
||||||
else:
|
else:
|
||||||
printm("Here are your channels:")
|
if settings.skip_channel_default != None:
|
||||||
for i, channel in enumerate(channels):
|
if type(settings.skip_channel_default) == str:
|
||||||
printm(f"{i+1}. {channel}")
|
channel_name = settings.skip_channel_default
|
||||||
printm(f"{len(channels)+1}. Create a new channel")
|
elif type(settings.skip_channel_default) == int:
|
||||||
index = input("Which channel do you want to use : ")
|
channel_name = channels[settings.skip_channel_default]
|
||||||
if index == str(len(channels)+1):
|
else:
|
||||||
channel = Channel()
|
raise TypeError("The skip_channel_default setting must be either a string or an integer.")
|
||||||
await channel.create()
|
|
||||||
else:
|
|
||||||
channel_name = channels[int(index)-1]
|
|
||||||
channel = Channel()
|
channel = Channel()
|
||||||
await channel.load(channel_name)
|
await channel.load(channel_name)
|
||||||
|
else:
|
||||||
|
printm("Here are your channels:")
|
||||||
|
for i, channel in enumerate(channels):
|
||||||
|
printm(f"{i+1}. {channel}")
|
||||||
|
printm(f"{len(channels)+1}. Create a new channel")
|
||||||
|
index = input("Which channel do you want to use : ")
|
||||||
|
if index == str(len(channels)+1):
|
||||||
|
channel = Channel()
|
||||||
|
await channel.create()
|
||||||
|
else:
|
||||||
|
channel_name = channels[int(index)-1]
|
||||||
|
channel = Channel()
|
||||||
|
await channel.load(channel_name)
|
||||||
printm("Now, let's create a video!")
|
printm("Now, let's create a video!")
|
||||||
printm("Here are all the ideas you have:")
|
printm("Here are all the ideas you have:")
|
||||||
printm("0. Generate new ideas")
|
printm("0. Generate new ideas")
|
||||||
|
|||||||
Reference in New Issue
Block a user