Add files via upload

This commit is contained in:
RVC-Boss 2024-01-23 18:56:08 +08:00 committed by GitHub
parent da19013b06
commit 2e834b305f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -110,6 +110,7 @@ def b_submit_change(*text_list):
def b_delete_audio(*checkbox_list): def b_delete_audio(*checkbox_list):
global g_data_json, g_index, g_max_json_index global g_data_json, g_index, g_max_json_index
b_save_file()
change = False change = False
for i, checkbox in reversed(list(enumerate(checkbox_list))): for i, checkbox in reversed(list(enumerate(checkbox_list))):
if g_index + i < len(g_data_json): if g_index + i < len(g_data_json):
@ -121,8 +122,8 @@ def b_delete_audio(*checkbox_list):
if g_index > g_max_json_index: if g_index > g_max_json_index:
g_index = g_max_json_index g_index = g_max_json_index
g_index = g_index if g_index >= 0 else 0 g_index = g_index if g_index >= 0 else 0
# if change: if change:
# b_save_file() b_save_file()
# return gr.Slider(value=g_index, maximum=(g_max_json_index if g_max_json_index>=0 else 0)), *b_change_index(g_index, g_batch) # return gr.Slider(value=g_index, maximum=(g_max_json_index if g_max_json_index>=0 else 0)), *b_change_index(g_index, g_batch)
return {"value":g_index,"__type__":"update","maximum":(g_max_json_index if g_max_json_index>=0 else 0)},*b_change_index(g_index, g_batch) return {"value":g_index,"__type__":"update","maximum":(g_max_json_index if g_max_json_index>=0 else 0)},*b_change_index(g_index, g_batch)
@ -172,6 +173,7 @@ def b_audio_split(audio_breakpoint, *checkbox_list):
def b_merge_audio(interval_r, *checkbox_list): def b_merge_audio(interval_r, *checkbox_list):
global g_data_json , g_max_json_index global g_data_json , g_max_json_index
b_save_file()
checked_index = [] checked_index = []
audios_path = [] audios_path = []
audios_text = [] audios_text = []