Skip to content

Commit 662f640

Browse files
Tweaked transmission-music script
1 parent c955a9d commit 662f640

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

kubernetes/apps/media/lidarr/app/resources/lidarr-wrtag.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
printenv | grep -i lidarr | sort
5-
64
if [[ "$${lidarr_eventtype:-}" == "Test" ]]; then
75
echo "[lidarr-wrtag] Test event received"
86
exit 0
@@ -12,8 +10,9 @@ if [[ "$${lidarr_eventtype:-}" != "AlbumDownload" ]]; then
1210
exit 0
1311
fi
1412

15-
WRTAG_URL="http://:$${WRTAG_API_KEY}@wrtag.media.svc.cluster.local/op/copy"
16-
ALBUM_DIR="$(dirname "$${lidarr_trackfile_path}")"
13+
WRTAG_URL="http://:$${WRTAG_API_KEY}@wrtag.media.svc.cluster.local/op/move"
14+
FIRST_TRACK="$(echo "$${lidarr_addedtrackpaths}" | cut -d'|' -f1)"
15+
ALBUM_DIR="$(dirname "$${FIRST_TRACK}")"
1716

1817
echo "[lidarr-wrtag] Notifying wrtag for: $${ALBUM_DIR}"
1918
curl \
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
DEST_BASE="/music/transmission/wrtag"
5-
# WRTAG_API_KEY="key" # replace with your actual wrtag API key
6-
# WRTAG_URL="http://:${WRTAG_API_KEY}@127.0.0.1:7373/op/move"
7-
8-
SOURCE="$${TR_TORRENT_DIR}/$${TR_TORRENT_NAME}"
9-
DEST="$${DEST_BASE}/$${TR_TORRENT_NAME}"
10-
114
if echo "$${TR_TORRENT_TRACKERS}" | grep -q "flacsfor.me"; then
125
TRACKER="red"
136
elif echo "$${TR_TORRENT_TRACKERS}" | grep -q "home.opsfet.ch"; then
@@ -20,14 +13,4 @@ fi
2013
echo "[transmission-complete] Generating gazelle-origin file for $${TR_TORRENT_NAME} (tracker: $${TRACKER})"
2114
/app/.local/bin/gazelle-origin --tracker "$${TRACKER}" "$${TR_TORRENT_HASH}" --out "$${TR_TORRENT_DIR}/$${TR_TORRENT_NAME}/origin.yaml"
2215

23-
echo "[transmission-complete] Copying '$${SOURCE}' → '$${DEST}'"
24-
cp -rp "$${SOURCE}" "$${DEST}"
25-
26-
# echo "[transmission-complete] Notifying wrtag: ${DEST}"
27-
# curl \
28-
# --fail \
29-
# --request POST \
30-
# --data-urlencode "path=${DEST}" \
31-
# "${WRTAG_URL}"
32-
3316
echo "[transmission-complete] Done."

0 commit comments

Comments
 (0)