updated playlis version

This commit is contained in:
DigiServer Developer
2025-11-26 19:59:30 +02:00
parent 38929da929
commit f88e332186

View File

@@ -583,6 +583,7 @@ def process_file_in_background(app, filepath: str, filename: str, file_ext: str,
playlist.version += 1
db.session.commit()
cache.clear()
if os.path.exists(filepath):
os.remove(filepath)
@@ -638,6 +639,7 @@ def process_file_in_background(app, filepath: str, filename: str, file_ext: str,
playlist.version += 1
db.session.commit()
cache.clear()
if os.path.exists(filepath):
os.remove(filepath)
@@ -681,6 +683,7 @@ def process_file_in_background(app, filepath: str, filename: str, file_ext: str,
playlist.version += 1
db.session.commit()
cache.clear()
_background_tasks[task_id] = {'status': 'complete', 'message': f'{filename} processed successfully!'}
log_action('info', f'Background: {filename} processed successfully')
else:
@@ -1059,7 +1062,7 @@ def upload_media():
# Increment playlist version if pages were added
if playlist_id and page_files:
playlist.version += 1
playlist.increment_version()
# Delete original PDF file
if os.path.exists(filepath):
@@ -1118,7 +1121,7 @@ def upload_media():
# Increment playlist version if slides were added
if playlist_id and slide_files:
playlist.version += 1
playlist.increment_version()
# Delete original PPTX file
if os.path.exists(filepath):
@@ -1167,7 +1170,7 @@ def upload_media():
db.session.execute(stmt)
# Increment playlist version
playlist.version += 1
playlist.increment_version()
uploaded_count += 1