aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xandroid-push5
-rwxr-xr-xcopy-annotations-from-kobo4
-rwxr-xr-xcopy-item-to-kobo7
3 files changed, 15 insertions, 1 deletions
diff --git a/android-push b/android-push
index dba8e55..1eafa10 100755
--- a/android-push
+++ b/android-push
@@ -27,4 +27,9 @@ if [ "$BASENAME" == "android-pull" ]; then
adb pull $ANDROID_BASE/$ORIG $DEST
else
adb push $ORIG $ANDROID_BASE/$DEST
+
+ # Thanks https://stackoverflow.com/questions/17928576/refresh-android-mediastore-using-adb
+ #adb shell "find $ANDROID_BASE/$DEST -exec am broadcast \
+ #-a android.intent.action.MEDIA_SCANNER_SCAN_FILE \
+ #-d file://{} \\;"
fi
diff --git a/copy-annotations-from-kobo b/copy-annotations-from-kobo
index 29c1482..f86d1fe 100755
--- a/copy-annotations-from-kobo
+++ b/copy-annotations-from-kobo
@@ -53,7 +53,9 @@ EOT
touch "$BASEFOLDER/$sdr/metadata.$extension.lua"
# Make sure it's not locked by git annex
- git -C $BASEFOLDER annex unlock "$sdr/metadata.$extension.lua"
+ if [ -L "$BASEFOLDER/$sdr/metadata.$extension.lua" ]; then
+ git -C $BASEFOLDER annex unlock "$sdr/metadata.$extension.lua"
+ fi
# Update
silentSsh kobo >"$BASEFOLDER/$sdr/metadata.$extension.lua" <<EOF
diff --git a/copy-item-to-kobo b/copy-item-to-kobo
index 0650a52..aa751fb 100755
--- a/copy-item-to-kobo
+++ b/copy-item-to-kobo
@@ -33,6 +33,13 @@ fi
show --search "$PATTERN" | while read item; do
dirname="`dirname "$item"`"
+ # Check if item has unspported chars in it's file name
+ if echo "$item" | grep -q ':'; then
+ echo "$BASENAME: unsupported character ':' in file name '$item'"
+ echo "$BASENAME: please rename the file and try again"
+ exit 1
+ fi
+
echo "Copying $item..."
silentSsh $REMOTE <<EOC