From 5ecea9fc21ebb08f0d408888ac70a0557bf78ff5 Mon Sep 17 00:00:00 2001 From: Tobias Leuschner Date: Sat, 9 May 2026 13:56:24 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20SMB-Zielpfadverarbeitung=20verbessert?= =?UTF-8?q?=20und=20Versionsnummer=20auf=201.0.47=20erh=C3=B6ht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 26 +++++++++++++++----------- version.txt | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app.py b/app.py index 8a1597e..c6b8e17 100644 --- a/app.py +++ b/app.py @@ -899,33 +899,37 @@ def _remote_name(tid): return f'picopy_{tid}' +def _join_remote_path(*parts) -> str: + return '/'.join(str(p).strip('/') for p in parts if str(p).strip('/')) + + def _smb_conn(t: dict, path: str = '') -> str: """Baut ein rclone-Ziel fuer gespeicherte SMB-Targets. - Gespeicherte Ziele werden als benannte rclone-Remotes angelegt. Diese - Remote-Konfiguration ist die kanonische Quelle fuer Host, Share und Login; - der Inline-String bleibt nur als Fallback fuer unvollstaendige Legacy-Eintraege. + Bei rclone SMB ist die Freigabe der erste Pfadteil nach dem Remote: + remote:share/ordner. Die Remote-Konfiguration enthaelt Host und Login. """ + share = t.get('smb_share', '') + remote_path = _join_remote_path(share, path) if t.get('id'): - return f'{_remote_name(t["id"])}:{path}' + return f'{_remote_name(t["id"])}:{remote_path}' host = t.get('smb_host', '') - share = t.get('smb_share', '') - if not host or not share: - return f':{path}' - conn = f':smb,host={host},share={share}' + if not host: + return f':{remote_path}' + conn = f':smb,host={host}' if t.get('smb_user'): conn += f',user={t["smb_user"]}' if t.get('smb_pass'): conn += f',pass={t["smb_pass"]}' - conn += f':{path}' + conn += f':{remote_path}' return conn def configure_smb_remote(tid, host, share, user, pw): rn = _remote_name(tid) _rclone('config', 'delete', rn) - args = ['config', 'create', rn, 'smb', f'host={host}', f'share={share}'] + args = ['config', 'create', rn, 'smb', f'host={host}'] if user: args += [f'user={user}'] if pw: @@ -2380,7 +2384,7 @@ function renderUTs(){ 🖧
${t.name}
-
SMB/NAS | ${t.dest_path}
+
SMB/NAS | ${(t.smb_share||'?')}${t.dest_path?'/'+t.dest_path:''}
diff --git a/version.txt b/version.txt index 9e6b608..de0434d 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.46 \ No newline at end of file +1.0.47 \ No newline at end of file