Browse Source

update plex, fix seedbox script

Josh Bicking 1 year ago
parent
commit
988fbb6fa0
2 changed files with 6 additions and 5 deletions
  1. 1 1
      plex.yaml
  2. 5 4
      seedbox_sync.py

+ 1 - 1
plex.yaml

@@ -21,7 +21,7 @@ spec:
     spec:
       containers:
       - name: plex
-        image: linuxserver/plex:amd64-version-1.26.2.5797-5bd057d2b
+        image: linuxserver/plex:amd64-version-1.30.2.6563-3d4dc0cce
         ports:
         - containerPort: 32400
           name: http-web-svc

+ 5 - 4
seedbox_sync.py

@@ -27,13 +27,14 @@ processed = {f for f in r.stdout.decode().split('\n') if f}
 new = available - processed
 
 for new_file in new:
+    # Be super cautious about empty file names, wouldn't want to `rm -rf` a folder by accident
     if not new_file:
         continue
 
     print(f"Processing: {new_file}")
-    subprocess.run(["bash", "-c", f"rsync -rsvv {host}:{host_data_path}/{new_file} {local_working_path}"], check=True)
-    r = subprocess.run(["bash", "-c", f"touch {local_metadata_path}/{new_file}"], check=True)
+    subprocess.run(["bash", "-c", f"rsync -rsvv '{host}:{host_data_path}/{new_file}' '{local_working_path}'"], check=True)
+    r = subprocess.run(["bash", "-c", f"touch '{local_metadata_path}/{new_file}'"], check=True)
 
     print(f"Moving to ready: {new_file}")
-    subprocess.run(["bash", "-c", f"rsync -r {local_working_path}/{new_file} {local_data_path}"], check=True)
-    subprocess.run(["bash", "-c", f"rm -rf {local_working_path}/{new_file}"], check=True)
+    subprocess.run(["bash", "-c", f"rsync -r '{local_working_path}/{new_file}' '{local_data_path}'"], check=True)
+    subprocess.run(["bash", "-c", f"rm -rf '{local_working_path}/{new_file}'"], check=True)