diff --git a/armbian-torrent-stats-html.nu b/armbian-torrent-stats-html.nu index f4a35fd..4e28547 100755 --- a/armbian-torrent-stats-html.nu +++ b/armbian-torrent-stats-html.nu @@ -1,11 +1,11 @@ #!/usr/bin/env nu ( - transmission-remote -n 'transmission:transmission' -l | - from ssv | - to html | - str replace '' 'Armbian torrent stats' | - save -f -r /home/jas/staging/armbian-torrentstats.html + transmission-remote -n 'transmission:transmission' -l + | from ssv + | to html + | str replace '' 'Armbian torrent stats' + | save -f -r /home/jas/staging/armbian-torrentstats.html ) scp /home/jas/staging/armbian-torrentstats.html jas@192.168.2.102:/home/jas/public/html/armbian-torrentstats.html diff --git a/seed-armbian-torrents.nu b/seed-armbian-torrents.nu index 3a2f528..7adaaca 100755 --- a/seed-armbian-torrents.nu +++ b/seed-armbian-torrents.nu @@ -8,8 +8,8 @@ chmod 700 $temp_dir # Download the torrents archive and save to temporary directory let torrent_zip = ($temp_dir | path join "armbian-torrents.zip") ( - http get -r "https://dl.armbian.com/torrent/all-torrents.zip" | - save -r $torrent_zip + http get -r "https://dl.armbian.com/torrent/all-torrents.zip" + | save -r $torrent_zip ) # Test torrent_zip for corruption @@ -23,12 +23,12 @@ unzip -o $torrent_zip -d ($temp_dir | path join "torrent-tmp") | ignore # Create list of current active Armbian torrent ids let armbian_torrent_ids = ( - transmission-remote -n 'debian-transmission:debian-transmission' -l | - from ssv | - drop nth 0 | - drop | - find "Armbian" | - get ID + transmission-remote -n 'debian-transmission:debian-transmission' -l + | from ssv + | drop nth 0 + | drop + | find "Armbian" + | get ID ) # Remove torrents from armbian_torrent_ids @@ -43,9 +43,9 @@ $armbian_torrent_ids | each { # Add new/updated Armbian torrents ( - ls ($temp_dir | path join "torrent-tmp") | - get name | - each { + ls ($temp_dir | path join "torrent-tmp") + | get name + | each { |torrent| transmission-remote -n 'debian-transmission:debian-transmission' -a $"($torrent)" } | ignore diff --git a/torrentstats-html.nu b/torrentstats-html.nu index 4a0d0fd..2c4d85f 100755 --- a/torrentstats-html.nu +++ b/torrentstats-html.nu @@ -1,11 +1,15 @@ #!/usr/bin/env nu -( - transmission-remote -l | - from ssv | - to html | - str replace '' 'Torrent stats' | - save -f -r /home/jas/public/html/torrentstats.html +let old_head = "" +let new_head = ( + ["Torrent Stats

Last updated:", (date now | format date "%F %T%:z"), "

"] + | str join ' ' ) -chown jas:jas /home/jas/public/html/torrentstats.html +( + transmission-remote -l + | from ssv + | to html + | str replace ($old_head) ($new_head) + | save -f -r /home/jas/public/html/torrentstats.html +)