diff --git a/ajouter_video.sh b/ajouter_video.sh index bb9a6b3..503de11 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -33,12 +33,12 @@ URL="$1" if [ $URL ]; then echo "URL: $URL" REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_" - [ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Choisissez comment copier cette source" --entry-text="Video" MP3 Web) || IMPORT="Youtube" + [ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Que copier depuis cette source ?" --entry-text="Video" MP3 Web) || IMPORT="Youtube" [[ $IMPORT == "Video" ]] && IMPORT="Youtube" CHOICE="$IMPORT" fi -[[ $CHOICE == "Web" ]] && CHOICE=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Cette source WEB est à enregistrer comme " --entry-text="Page" WebSite) +[[ $CHOICE == "Web" ]] && CHOICE=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Cette source Web est à enregistrer comme " --entry-text="Page" WebSite) # REMOVE GtkDialog errors for zenity shopt -s expand_aliases @@ -623,6 +623,6 @@ cat /tmp/${MEDIAKEY}.log if [ ! $2 ]; then [ $? == 0 ] && \ zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ - [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "no" || exit 0 \ + [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "no"; zenity --question --width 300 --text "Collez le résultat dans votre Journal. FIN."; || exit 0 \ || zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 fi diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 7aa273f..e28b7a3 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -344,9 +344,6 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) ## MODIFY INTO "./zen/ipns_TAG_refresh.sh" (add crypto/contracts there) ######################################################################## -## COPY LOCALHOST IPFS URL TO CLIPBOARD -[[ $(which xclip) ]] && echo "http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" | xclip -selection c - ######################################################################## ######################################################################## ## PUBLISH new IPNS @@ -412,21 +409,21 @@ then echo "----------------- REFRESH LOCAL KODI INDEX ----------------------" cat ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | sort | uniq > ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN -GENRE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt | cut -d ';' -f 6 | sed 's/|/ /g' ) -MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ':' -f 2 | cut -d ' ' -f 2) -if [[ $(echo "$MIME" | grep 'video') ]]; then - TEXT="

"${TITLE}"

" - MIME="txt/html" - TAGS="${CAT} astroport $GENRE" - CANON='' -else - TEXT='' - TAGS='$:/isAttachment $:/isIpfs astroport '${CAT} $GENRE - CANON="/ipfs/"${IPFSID} -fi + GENRE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt | cut -d ';' -f 6 | sed 's/|/ /g' ) + MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ':' -f 2 | cut -d ' ' -f 2) + if [[ $(echo "$MIME" | grep 'video') ]]; then + TEXT="

"${TITLE}"

" + MIME="txt/html" + TAGS="${CAT} astroport $GENRE" + CANON='' + else + TEXT='' + TAGS='$:/isAttachment $:/isIpfs astroport '${CAT} $GENRE + CANON="/ipfs/"${IPFSID} + fi -echo "## Creation json tiddler" -echo '[ + echo "## Creation json tiddler" + echo '[ { "text": "'${TEXT}'", "title": "'${TITLE}'", @@ -443,12 +440,18 @@ echo '[ ] ' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json -# COPY TO DESKTOP Journal -[[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Bureau/Journal/ -[[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/ + # COPY TIDDLER JSON TO DESKTOP Journal/${TYPE} + [[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Bureau/Journal/${TYPE}/${TITLE}.dragdrop.json + [[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/${TYPE}/${TITLE}.dragdrop.json fi +## COPY LOCALHOST IPFS URL TO CLIPBOARD +[[ $(which xclip) ]] &&\ + [[ $TEXT == "" ]] &&\ + echo "http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" | xclip -selection c ||\ + echo "$TEXT" | xclip -selection c + ######################################################################## # PUBLISH GENERAL video ########################################################################