diff --git a/apps/musicseerr/tasks.py b/apps/musicseerr/tasks.py index 8c9a4b4..5d40018 100644 --- a/apps/musicseerr/tasks.py +++ b/apps/musicseerr/tasks.py @@ -229,21 +229,22 @@ def run_download_task(task_id: str, query: str, proxy_url: str, jobs_dict: dict, tag_mp3(dest_path, filename) logger.info(f"[{task_id}] Tubidy ID3 tagging complete.") - # Verify files and move to /remote-music + # Verify files and move to /remote-music/music downloaded_files = os.listdir(temp_dir) if not downloaded_files: raise Exception("Ingestion finished but no files were found in local temp folder.") - os.makedirs("/remote-music", exist_ok=True) + os.makedirs("/remote-music/music", exist_ok=True) moved_files = [] for file_name in downloaded_files: src_file = os.path.join(temp_dir, file_name) - dest_file = os.path.join("/remote-music", file_name) + dest_file = os.path.join("/remote-music/music", file_name) logger.info(f"[{task_id}] Moving '{file_name}' to remote Seedbox directory") shutil.move(src_file, dest_file) moved_files.append(file_name) + jobs_dict[task_id]["files"] = moved_files jobs_dict[task_id]["status"] = "completed" diff --git a/k8s/family-apps/musicseerr.yaml b/k8s/family-apps/musicseerr.yaml index 5e23faf..1a88ddb 100644 --- a/k8s/family-apps/musicseerr.yaml +++ b/k8s/family-apps/musicseerr.yaml @@ -21,7 +21,6 @@ spec: add: - NET_ADMIN env: - # User configures VPN provider here - name: VPN_SERVICE_PROVIDER value: "custom" - name: VPN_TYPE @@ -30,11 +29,6 @@ spec: value: "on" - name: HTTPPROXY_LOG value: "off" - # Template environment variables for custom VPN credentials - # - name: WIREGUARD_PRIVATE_KEY - # value: "YOUR_KEY" - # - name: WIREGUARD_ADDRESSES - # value: "10.0.0.2/32" ports: - name: proxy containerPort: 8888 @@ -86,14 +80,48 @@ spec: volumeMounts: - name: downloads mountPath: /tmp/downloads - - name: remote-music + - name: media mountPath: /remote-music + mountPropagation: HostToContainer + # Rclone sidecar container configured exactly like Jellyfin and Navidrome + - name: rclone + image: rclone/rclone:latest + args: + - mount + - "seedhost:/home2/tadiwanashe/downloads/media" + - /data + - --allow-other + - --allow-non-empty + - --vfs-cache-mode + - full + - --vfs-cache-max-size + - 5G + - --cache-dir + - /cache + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + lifecycle: + preStop: + exec: + command: ["/bin/sh", "-c", "fusermount -u /data"] + envFrom: + - secretRef: + name: rclone-secret + volumeMounts: + - name: media + mountPath: /data + mountPropagation: Bidirectional + - name: cache + mountPath: /cache volumes: - name: downloads emptyDir: {} - - name: remote-music - persistentVolumeClaim: - claimName: rclone-pvc + - name: media + emptyDir: {} + - name: cache + emptyDir: {} --- apiVersion: v1 kind: Service