From e6e25ac6f2d461e6c06cfc01c7d7ced7be621c8e Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 6 Apr 2022 17:29:25 +0200 Subject: [PATCH] Bunker BOX history --- crowdbridge.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crowdbridge.sh b/crowdbridge.sh index a8b779a1..c1b1dfea 100755 --- a/crowdbridge.sh +++ b/crowdbridge.sh @@ -132,11 +132,13 @@ echo "########################################################################## ## UPDATE GLOCAL HISTORY ? IsThere=$(cat ~/.zen/bunkerbox/history.json | jq .Videos[].link | grep $VUID) - [[ ! $IsThere ]] && echo "Add $INDEX/$VUID.jpg to history.json" && cat ~/.zen/bunkerbox/history.json | jq '.Videos += [{"link": "'"'_TITLE_'"'"}]' > ~/.zen/bunkerbox/$VUID/media/$VUID.history.json - sed -i "s~_INDEX_~$INDEX~g" ~/.zen/bunkerbox/$VUID/media/$VUID.history.json - sed -i "s~_VUID_~$VUID~g" ~/.zen/bunkerbox/$VUID/media/$VUID.history.json - sed -i "s~_TITLE_~$TITLE~g" ~/.zen/bunkerbox/$VUID/media/$VUID.history.json - cp -f ~/.zen/bunkerbox/$VUID/media/history.json ~/.zen/bunkerbox/$VUID.history.json + if [[ ! $IsThere ]]; then + echo "Add $INDEX/$VUID.jpg to history.json" && cat ~/.zen/bunkerbox/history.json | jq '.Videos += [{"link": "'"'_TITLE_'"'"}]' > ~/.zen/bunkerbox/$VUID/media/$VUID.history.json + sed -i "s~_INDEX_~$INDEX~g" ~/.zen/bunkerbox/$VUID/media/$VUID.history.json + sed -i "s~_VUID_~$VUID~g" ~/.zen/bunkerbox/$VUID/media/$VUID.history.json + sed -i "s~_TITLE_~$TITLE~g" ~/.zen/bunkerbox/$VUID/media/$VUID.history.json + cp -f ~/.zen/bunkerbox/$VUID/media/$VUID.history.json ~/.zen/bunkerbox/history.json + fi ## (found ''' later) COULD BE DONE LIKE THAT # cat ~/.zen/bunkerbox/$VUID/media/$VUID.history.json | jq --arg INDEX "$INDEX" --arg TITLE "$TITLE" '.Videos += [{"link": "'''$TITLE'''"}]' > ~/.zen/bunkerbox/history.json