Compare commits
2 Commits
ccfd90d4b5
...
9d317ee592
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d317ee592 | ||
|
|
cbadf096fd |
15
app.py
15
app.py
@@ -51,7 +51,7 @@ CONFIG_FILE = os.path.join(BASE_DIR, "config.json") # Persistente Konfiguration
|
||||
USERS_FILE = os.path.join(BASE_DIR, "users.json") # User-Datenbank
|
||||
HISTORY_FILE = os.path.join(BASE_DIR, "history.json") # Aktivitätsverlauf
|
||||
|
||||
APP_VERSION = "6.2.6"
|
||||
APP_VERSION = "6.2.7"
|
||||
UPLOAD_EXTENSIONS = {".jpg", ".jpeg", ".png", ".mp4"}
|
||||
|
||||
app = Flask(__name__)
|
||||
@@ -1878,18 +1878,15 @@ def delete_file(site, screen, filename):
|
||||
if screen == "priority":
|
||||
path = os.path.join(priority_dir(site), filename)
|
||||
playlist = get_priority_config(cfg, site).get("playlist", [])
|
||||
playlist[:] = [item for item in playlist if not (
|
||||
(isinstance(item, str) and item == filename) or
|
||||
(isinstance(item, dict) and item.get("url") == filename)
|
||||
)]
|
||||
else:
|
||||
path = os.path.join(MEDIA_DIR, site, screen, filename)
|
||||
screens_cfg = cfg.get("sites", {}).get(site, {}).get("screens", {})
|
||||
playlist = screens_cfg.get(screen, {}).get("playlist", [])
|
||||
playlist[:] = [item for item in playlist if not (
|
||||
(isinstance(item, str) and item == filename) or
|
||||
(isinstance(item, dict) and item.get("url") == filename)
|
||||
)]
|
||||
|
||||
# Ueber playlist_item_name vergleichen: Datei-Eintraege stehen als
|
||||
# {"name": ...}, URLs als {"url": ...}, Altbestand als reiner String.
|
||||
playlist[:] = [item for item in playlist
|
||||
if playlist_item_name(item) != filename]
|
||||
|
||||
if os.path.exists(path):
|
||||
os.remove(path)
|
||||
|
||||
Reference in New Issue
Block a user