diff options
-rwxr-xr-x | media.nu | 25 |
1 files changed, 25 insertions, 0 deletions
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 |