From 167a4c674b5c54892b907e1192877394c55f61e3 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 26 Oct 2026 16:50:37 +0100 Subject: [PATCH] Media tab: follow symbolic links wherever they point Folders kept on another disk and linked from a configured media folder (~/Videos/Cinema -> /datadisk/...) were hidden by the rule that the real path must stay inside the root. - Links are followed when listing, opening, searching and making thumbnails. What still bounds access: no absolute path, "..", or hidden component from the client, a closed list of extensions, and the type taken from the real file (lien.mp3 -> script.sh stays refused). - Search follows links without scanning a folder twice (loops, second link to the same folder) and reports results under their link path. - Players receive the path under the root, links kept (MediaLibrary.open_path), so the path they announce over MPRIS still maps to a library file (title and picture); locate() also resolves paths reached through a link. - The picture next to a media file is looked up beside the real file. - Tests for each case, including the path given to the player; docs updated. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 7 +-- README-EN.md | 8 +-- README.md | 10 ++-- mediadeck/media.py | 107 ++++++++++++++++++++++++--------------- mediadeck/system.py | 2 +- tests/test_media.py | 121 ++++++++++++++++++++++++++++++++++++-------- 6 files changed, 183 insertions(+), 72 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 341bdbd..979eb97 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -147,10 +147,10 @@ La pochette locale (`file://`) n'est jamais transmise : elle est remplacée par - **Page des QR codes = fichier local, jamais une route du serveur** (`make qr`, `--qr`, module `qrpage.py`) : les QR codes contiennent le jeton, une route `/qr` le donnerait à tout le LAN (même limitée à la boucle locale, elle serait fragile derrière un proxy). Page autonome écrite en 600 dans `$XDG_RUNTIME_DIR/mediadeck/access.html` (tmpfs) et ouverte en `file://` : pas de CSP à contourner (`