From bf07c1fae9aa107e98fd87064f6112d575e79a34 Mon Sep 17 00:00:00 2001 From: pdp8 Date: Sat, 24 Feb 2024 10:36:59 +0100 Subject: media.nu --- media.nu | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 media.nu diff --git a/media.nu b/media.nu new file mode 100755 index 0000000..203d8df --- /dev/null +++ b/media.nu @@ -0,0 +1,25 @@ +#!/usr/bin/env nu + +IMG_DIR = /home/ch/mnt/home/ch/img +PUB_DIR = /srv/media/pictures/src + +$env.BORG_PASSCOMMAND = "pass devices/u242757-sub2@u242757.your-storagebox.de.borg.key" +borg_path = "ssh://u242757-sub2@u242757.your-storagebox.de:23/./borg/" +archive = (borg list --last 1 --format '{archive}' $borg_path) +#borg mount $borg_path::$archive ~/mnt /srv/media +borg mount $borg_path::$archive ~/mnt /home/ch/img +cd $PUB_DIR +published = (ls | select name) +cd $IMG_DIR +all = (open meta.json | where rating == 3) +new = ($all | filter {|id| not ($id in $published) }) +cd original +new | each {|img| + public = $'($PUB_DIR)/($img)' + #cp $img $public + #chmod u+w $public + #exiv2 rm $public + #exiv2 -M'set Xmp.dc.creator #{mail}' -M'set Xmp.dc.rights © #{mail}' -M'set Xmp.dc.license http://creativecommons.org/licenses/by-sa/4.0/' -M'set Xmp.xmpRights.UsageTerms Creative Commons Attribution-ShareAlike 4.0 International License' -M'set Xmp.xmpRights.Marked True' -M'set Xmp.dc.description Original artwork available from #{mail}' $public +} +cd ~ +umount ~/mnt -- cgit v1.2.3