From dc314fa435141a9d1ecbda48c30a81592dff92ec Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 17 Feb 2025 13:30:05 -0300 Subject: Feat: adds copy-annotations-to-kobo --- copy-annotations-from-kobo | 2 +- copy-annotations-to-kobo | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100755 copy-annotations-to-kobo diff --git a/copy-annotations-from-kobo b/copy-annotations-from-kobo index 3d386c9..f6770cc 100755 --- a/copy-annotations-from-kobo +++ b/copy-annotations-from-kobo @@ -59,7 +59,7 @@ EOT fi # Update - silentSsh kobo >"$BASEFOLDER/$sdr/metadata.$extension.lua" < "$BASEFOLDER/$sdr/metadata.$extension.lua" <" + exit 1 +fi + +# Dispatch +$DIRNAME/docshower --search "$PATTERN" | while read item; do + #sdr="`echo $item | sed -e 's/\.pdf$//' -e 's/\.epub$//' -e 's/\.djvuf$//'`.sdr" + basename="`echo $item | sed -e 's/\.[^.]*$//'`" + extension="$(echo $item | sed -e "s|$basename.||")" + sdr="$basename.sdr" + + # Check if local file exists + test -e "$BASEFOLDER/$sdr/metadata.$extension.lua" + + # Skip if local file does not exist + if [ "$?" != "0" ]; then + echo "Skipping $item as it's not available at $BASEFOLDER..." + continue + fi + + echo "Processing $item..." + + # Make sure that the annotation folder exists + silentSsh $REMOTE <