From 3eba17427d04731e4e216d66bcc875f5fc8dda24 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 7 Jan 2023 17:14:57 +0100 Subject: [PATCH] G1Feed --- ASTROBOT/VOEUX.refresh.sh | 5 +++++ ajouter_media.sh | 16 ++++++++-------- tools/new_file_in_astroport.sh | 3 +-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ASTROBOT/VOEUX.refresh.sh b/ASTROBOT/VOEUX.refresh.sh index 8afafea2..f0a41383 100755 --- a/ASTROBOT/VOEUX.refresh.sh +++ b/ASTROBOT/VOEUX.refresh.sh @@ -110,6 +110,11 @@ do --output ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME} \ --render '.' ${PLAYER}'.tiddlers.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1'${WISHNAME}']!tag[G1Voeu]]' + ### PREPARE WISHNAME index.html + cat $MY_PATH/../templates/index_gif4.html \ + | sed -e "s~_LIBRA_~$(myIpfsGw)~g" -e "s~_G1VOEU_~${WISHNAME}~g" "s~_PLAYER_~${PLAYER}~g" \ + > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/index.html + ### ADD TO IPFS echo "++WISH PUBLISHING++ ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/*" JSONIPFS=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/* | tail -n 1) # ADDING JSONS TO IPFS diff --git a/ajouter_media.sh b/ajouter_media.sh index 8c242813..c11757a8 100755 --- a/ajouter_media.sh +++ b/ajouter_media.sh @@ -45,14 +45,16 @@ CHOICE="$3" players=($(ls ~/.zen/game/players | grep -Ev "localhost" 2>/dev/null)) [[ ${#players[@]} -ne 1 ]] \ -&& espeak "CHOOSE PLAYER" && OUTPUT=$(zenity --entry --width 640 --title="=> Astroport" --text="ASTRONAUTE ?" --entry-text=${players[@]}) \ +&& espeak "SELECT YOUR PLAYER" && OUTPUT=$(zenity --entry --width 640 --title="=> Astroport" --text="ASTRONAUTE ?" --entry-text=${players[@]}) \ || OUTPUT="${players}" PLAYER=$OUTPUT -[[ $OUTPUT ]] && ( rm -f ~/.zen/game/players/.current && ln -s ~/.zen/game/players/$PLAYER ~/.zen/game/players/.current && espeak "CONNECTED" && . "${MY_PATH}/tools/my.sh" ) || espeak "NO PLAYER" +[[ $OUTPUT ]] \ +&& rm -f ~/.zen/game/players/.current && ln -s ~/.zen/game/players/$PLAYER ~/.zen/game/players/.current && espeak "CONNECTED" && . "${MY_PATH}/tools/my.sh" \ +|| espeak "NO PLAYER" -[[ $PLAYER == "" ]] \ +[[ $OUTPUT == "" ]] \ && ${MY_PATH}/start.sh \ && espeak "Astronaut. Please register." \ && xdg-open "http://astroport.localhost:1234" \ @@ -81,10 +83,6 @@ if [ $URL ]; then [[ $IMPORT == "Video" ]] && IMPORT="Youtube" CHOICE="$IMPORT" -else - - xdg-open "$myIPFS/ipns/$ASTRONAUTENS" - fi ### @@ -158,6 +156,8 @@ done YOU=$(myIpfsApi) [[ ! $YOU ]] && espeak "I P F S not running - EXIT" && exit 1 +[[ ! $URL ]] && xdg-open "$myIPFS/ipns/$ASTRONAUTENS" + ######################################################################## espeak "Ready !" ######################################################################## @@ -626,7 +626,7 @@ MEDIAKEY="TMDB_$MEDIAID" ### TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${PRE}") [[ $TITLE == "" ]] && exit 1 -TITLE=$(echo "${TITLE}" | sed "s/[(][^)]*[)]//g" | sed -e 's/;/_/g' ) # Clean TITLE (NO ;) +TITLE=$(echo "${TITLE}" | detox --inline ) # Clean TITLE (NO ;) # VIDEO YEAR ### CHECK IF PREVIOUS ajouter_video (Serie case) diff --git a/tools/new_file_in_astroport.sh b/tools/new_file_in_astroport.sh index b5683212..66252e9c 100755 --- a/tools/new_file_in_astroport.sh +++ b/tools/new_file_in_astroport.sh @@ -273,7 +273,7 @@ then echo $GENRE $SAISON ## Add screenshot - [[ -f $HOME/Astroport/${TyPE}/${REFERENCE}/screen.png ]] && SCREENSHOT=$(ipfs add -q "$HOME/Astroport/${TyPE}/${REFERENCE}/screen.png" | tail -n 1) + [[ -f $HOME/Astroport/${TyPE}/${REFERENCE}/screen.png ]] && ANIMH=$(ipfs add -q "$HOME/Astroport/${TyPE}/${REFERENCE}/screen.png" | tail -n 1) && PROBETIME=0 if [[ $(echo "$MIME" | grep 'video') ]]; then @@ -318,7 +318,6 @@ then "filesize": "'${FILE_SIZE}'", "size": "'${FILE_BSIZE}'", "description": "'${DESCRIPTION}'", - "screenshot": "'/ipfs/${POSTER}'", "g1pub": "'${G1PUB}'", "ipfsroot": "'/ipfs/${IPFSREPFILEID}'", "file": "'${file}'",