github-actions[bot] commited on
Commit
af34870
·
1 Parent(s): 756f1e9

Auto-deploy from GitHub: 51b3d15536d6ccbb426080257d8e8b97e66ae347

Browse files
Files changed (2) hide show
  1. .gitattributes +1 -1
  2. app.py +8 -5
.gitattributes CHANGED
@@ -1,5 +1,5 @@
1
- *.bin filter=lfs diff=lfs merge=lfs -text
2
  *.wav filter=lfs diff=lfs merge=lfs -text
3
  *.mp3 filter=lfs diff=lfs merge=lfs -text
4
  *.flac filter=lfs diff=lfs merge=lfs -text
5
  *.pth filter=lfs diff=lfs merge=lfs -text
 
 
 
1
  *.wav filter=lfs diff=lfs merge=lfs -text
2
  *.mp3 filter=lfs diff=lfs merge=lfs -text
3
  *.flac filter=lfs diff=lfs merge=lfs -text
4
  *.pth filter=lfs diff=lfs merge=lfs -text
5
+ *.bin filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -38,7 +38,9 @@ def init_db():
38
  processed_at TEXT,
39
  error TEXT,
40
  progress INTEGER DEFAULT 0,
41
- progress_text TEXT)''')
 
 
42
 
43
  conn.commit()
44
  conn.close()
@@ -270,6 +272,7 @@ def generate_audio():
270
  text = data['text']
271
  voice = data.get('voice', '9')
272
  speed = data.get('speed', 1.0)
 
273
 
274
  if not text.strip():
275
  return jsonify({'error': 'Text cannot be empty'}), 400
@@ -279,9 +282,9 @@ def generate_audio():
279
  conn = sqlite3.connect('tts_tasks.db')
280
  c = conn.cursor()
281
  c.execute('''INSERT INTO tasks
282
- (id, text, voice, speed, status, created_at)
283
- VALUES (?, ?, ?, ?, ?, ?)''',
284
- (task_id, text, voice, speed, 'not_started', datetime.now().isoformat()))
285
  conn.commit()
286
  conn.close()
287
 
@@ -299,7 +302,7 @@ def get_files():
299
  conn = sqlite3.connect('tts_tasks.db')
300
  conn.row_factory = sqlite3.Row
301
  c = conn.cursor()
302
- c.execute('SELECT * FROM tasks ORDER BY created_at DESC')
303
  rows = c.fetchall()
304
 
305
  # Get queue order for not_started tasks (oldest first = position 1)
 
38
  processed_at TEXT,
39
  error TEXT,
40
  progress INTEGER DEFAULT 0,
41
+ progress_text TEXT,
42
+ hide_from_ui INTEGER DEFAULT 0)'''
43
+ )
44
 
45
  conn.commit()
46
  conn.close()
 
272
  text = data['text']
273
  voice = data.get('voice', '9')
274
  speed = data.get('speed', 1.0)
275
+ hide_from_ui = 1 if data.get('hide_from_ui') else 0
276
 
277
  if not text.strip():
278
  return jsonify({'error': 'Text cannot be empty'}), 400
 
282
  conn = sqlite3.connect('tts_tasks.db')
283
  c = conn.cursor()
284
  c.execute('''INSERT INTO tasks
285
+ (id, text, voice, speed, status, created_at, hide_from_ui)
286
+ VALUES (?, ?, ?, ?, ?, ?, ?)''',
287
+ (task_id, text, voice, speed, 'not_started', datetime.now().isoformat(), hide_from_ui))
288
  conn.commit()
289
  conn.close()
290
 
 
302
  conn = sqlite3.connect('tts_tasks.db')
303
  conn.row_factory = sqlite3.Row
304
  c = conn.cursor()
305
+ c.execute('SELECT * FROM tasks WHERE hide_from_ui = 0 OR hide_from_ui IS NULL ORDER BY created_at DESC')
306
  rows = c.fetchall()
307
 
308
  # Get queue order for not_started tasks (oldest first = position 1)