summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2024-02-24 10:36:59 +0100
committerpdp8 <pdp8@pdp8.info>2024-02-24 10:36:59 +0100
commitbf07c1fae9aa107e98fd87064f6112d575e79a34 (patch)
tree8200d8a0cba31403f74069c3a9964197b62c8c0d
parenta781fe5046c4b33cd1c860d284bd799b4ca38f2e (diff)
media.nu
-rwxr-xr-xmedia.nu25
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