diff --git a/crowdbunker.sh b/crowdbunker.sh index 54adee4..d697e5e 100755 --- a/crowdbunker.sh +++ b/crowdbunker.sh @@ -151,10 +151,11 @@ echo "########################################################################## # qo-op get latest history.json if [[ "$(cat ~/.zen/bunkerbox/choice 2>/dev/null)" == "qo-op" ]]; then + [[ $(cat ~/.zen/bunkerbox/history_qo-op.json | jq .Videos[].link | grep $VUID) ]] && echo "VIDEO DEJA LOCALE... CONTINUE" && continue IPNSL="/ipns/$(ipfs key list -l | grep 'qo-op' | cut -f 1 -d ' ')" ipfs get -o ~/.zen/bunkerbox/history_qo-op.json $IPNSL/history.json # Get actual IPNS qo-op history.json [[ ! -f ~/.zen/bunkerbox/history_qo-op.json || $(cat ~/.zen/bunkerbox/history_qo-op.json 2>/dev/null) == "" ]] && cp ${MY_PATH}/templates/data/history.json ~/.zen/bunkerbox/history_qo-op.json - [[ $(cat ~/.zen/bunkerbox/history_qo-op.json | jq .Videos[].link | grep $VUID) ]] && echo "VIDEO DEJA DANS IPFS... CONTINUE" && echo && cp ~/.zen/bunkerbox/history_qo-op.json ~/.zen/bunkerbox/history.json && continue + [[ $(cat ~/.zen/bunkerbox/history_qo-op.json | jq .Videos[].link | grep $VUID) ]] && echo "VIDEO DEJA DANS LE RESEAU... CONTINUE" && echo && cp ~/.zen/bunkerbox/history_qo-op.json ~/.zen/bunkerbox/history.json && continue # JSON FUSION jq -s '.[0] * .[1]' ~/.zen/bunkerbox/history_qo-op.json ~/.zen/bunkerbox/history.json | jq -M '.Videos |= unique_by(.link)' > ~/.zen/bunkerbox/history.fusion.json mv ~/.zen/bunkerbox/history.fusion.json ~/.zen/bunkerbox/history.json ## REPLACE LOCAL HISTORY CACHE