From 90bf7626ae9aa308fe874095f02af8c1f84de09f Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 22 Nov 2022 23:16:12 +0100 Subject: [PATCH]
{{!!duree}}
--- ajouter_media.sh | 22 ++++++---------------- ping_bootstrap.sh | 4 ++-- tools/new_file_in_astroport.sh | 10 +++------- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/ajouter_media.sh b/ajouter_media.sh index 6e7c4342..fe2b600f 100755 --- a/ajouter_media.sh +++ b/ajouter_media.sh @@ -614,8 +614,8 @@ esac # Screen capture ######################################################################## if [[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]]; then - espeak "taking a screen shot" - sleep 1 + espeak "beware taking screen shot in 3 seconds" + sleep 3 import -window root ~/.zen/tmp/screen.png fi @@ -625,14 +625,6 @@ fi mkdir -p ~/astroport/${CAT}/${MEDIAID}/ mv ~/.zen/tmp/screen.png ~/astroport/${CAT}/${MEDIAID}/screen.png - -## Extract thumbnail -MIME=$(file --mime-type -b "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}") - -mv ~/astroport/${CAT}/${MEDIAID}/thumbnail.png ~/astroport/${CAT}/${MEDIAID}/${MOATS}.thumbnail.png >/dev/null 2>&1 -[[ $(echo $MIME | grep video) ]] && ffmpeg -i "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}" -r 1/300 -vf scale=-1:120 -vcodec png $HOME/astroport/${CAT}/${MEDIAID}/thumbnail.png -[[ ! -f ~/astroport/${CAT}/${MEDIAID}/thumbnail.png ]] && echo "(╥☁╥ ) THUMBNAIL FAILED" - ######################################################################## # ADD $FILE to IPFS / ASTROPORT / KODI echo "(♥‿‿♥) new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\"" "$3" @@ -670,9 +662,7 @@ echo "${MY_PATH}/tools/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIA #[[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/astroport/Add_${MEDIAKEY}_script.sh -echo "rm -f /tmp/\${MEDIAKEY}.pass -rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS -mv ~/astroport/Add_${MEDIAKEY}_script.sh \"$HOME/astroport/Done_${FILE_NAME}.sh\" +echo "mv ~/astroport/Add_${MEDIAKEY}_script.sh \"$HOME/astroport/Done_${FILE_NAME}.sh\" " >> ~/astroport/Add_${MEDIAKEY}_script.sh chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh @@ -680,7 +670,7 @@ chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh ######################################################################## ## USE PLAYER G1PUB AS MEDIA WALLET MEDIAPUBKEY=$(cat ~/.zen/game/players/.current/.g1pub) -G1BALANCE=$(${MY_PATH}/tools/jaklis/jaklis.py balance -p $G1PUB) +G1BALANCE=$(${MY_PATH}/tools/jaklis/jaklis.py balance -p $G1PUB 2>/dev/null ) ######################################################################## echo "# ZENBALANCE for ${MEDIAKEY} , WALLET $MEDIAPUBKEY" @@ -698,13 +688,13 @@ FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; ZENBALANCE=0 #fi ######################################################################## -espeak "Ready to eat" zenity --warning --width 360 --text "(♥‿‿♥) $MEDIAKEY IPFS MIAM (ᵔ◡◡ᵔ)" +espeak "Adding $CAT to I P F S. Please Wait" bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" -espeak "T W index recording" zenity --warning --width 320 --text "Ajout à votre TW ${PLAYER}" +espeak "Updating T W Index" ######################################################################## diff --git a/ping_bootstrap.sh b/ping_bootstrap.sh index b854e602..d4085126 100755 --- a/ping_bootstrap.sh +++ b/ping_bootstrap.sh @@ -10,8 +10,8 @@ for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#"); done - -for friendnode in $(cat ~/.zen/game/players/.current/FRIENDS/*/.astronautens); +## And friends +for friendnode in $(cat ~/.zen/game/players/*/FRIENDS/*/.astronautens | uniq); do ipfs ping -n 3 $friendnode [ $? = 0 ] && ipfs swarm connect $friendnode \ diff --git a/tools/new_file_in_astroport.sh b/tools/new_file_in_astroport.sh index 3485b417..ef9a6a27 100755 --- a/tools/new_file_in_astroport.sh +++ b/tools/new_file_in_astroport.sh @@ -300,18 +300,14 @@ then echo $GENRE $SAISON ## Add screenshot (TODO : Make it better. Check what to put; if used & usefull - [[ -f $HOME/astroport/${TyPE}/${REFERENCE}/screen.png ]] && IPSCREEN=$(ipfs add -q "$HOME/astroport/${TyPE}/${REFERENCE}/screen.png" | tail -n 1) - [[ $IPSCREEN ]] && POSTER=$IPSCREEN - - [[ -f $HOME/astroport/${TyPE}/${REFERENCE}/thumbnail.png ]] && IPTHUMB=$(ipfs add -q "$HOME/astroport/${TyPE}/${REFERENCE}/thumbnail.png" | tail -n 1) - [[ $IPTHUMB ]] && POSTER=$IPTHUMB + [[ -f $HOME/astroport/${TyPE}/${REFERENCE}/screen.png ]] && SCREENSHOT=$(ipfs add -q "$HOME/astroport/${TyPE}/${REFERENCE}/screen.png" | tail -n 1) if [[ $(echo "$MIME" | grep 'video') ]]; then TEXT="

"${TITLE}"

"$DESCRIPTION"

-
+
{{!!duree}}
<\$button class='tc-tiddlylink'> <\$list filter='[tag[G1${CAT}]]'> <\$action-navigate \$to=<> \$scroll=no/> @@ -352,7 +348,7 @@ then "cat": "'${CAT}'", "size": "'${FILE_BSIZE}'", "description": "'${DESCRIPTION}'", - "poster": "'/ipfs/${POSTER}'", + "screenshot": "'/ipfs/${POSTER}'", "ipfsroot": "'/ipfs/${IPFSREPFILEID}'", "file": "'${file}'", "ipfs": "'/ipfs/${IPFSREPFILEID}/${URLENCODE_FILE_NAME}'",