diff --git a/ajouter_video.sh b/ajouter_video.sh index 5bb0ba2..aecfbb6 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -179,7 +179,7 @@ mv "${FILE_PATH}/${FILE_NAME}" ~/astroport/${CAT}/${TMDB}/ ######################################################################## # ADD $FILE to IPFS / ASTROPORT / KODI -~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/" "${FILE_NAME}" +~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/${TMDB}/" "${FILE_NAME}" ######################################################################## zenity --warning --width 300 --text "OK! Vidéo $FILE_NAME transférée dans Kodi/Vstream/Astroport" diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 76da128..dbc829c 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -27,19 +27,17 @@ path="$1" file="$2" ipns="$3" echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh PATH/ \"$path\" FILE \"$file\" IPNS \"$ipns\"" -[[ "$file" == "" || "$path" == "" ]] && echo "ERROR. Parameter missing.file=$file path=$path" - extension="${file##*.}" TITLE="${file%.*}" # .part file false flag correcting -[[ ! -f "${path}${file}" ]] && file="${TITLE%.*}" && extension="${TITLE##*.}" && [[ ! -f "${path}${file}" ]] && exit 1 +[[ ! -f "${path}${file}" ]] && file="${TITLE%.*}" && extension="${TITLE##*.}" && [[ ! -f "${path}${file}" ]] && echo "NO FILE" && exit 1 # GET XZUID [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) || XZUID=$(hostname) - +[[ ! $(echo "$path" | cut -d '/' -f 4 | grep 'astroport') ]] && echo "Fichiers à placer dans ~/astroport/ MERCI" && exit 1 TYPE=$(echo "$path" | cut -d '/' -f 5 ) # ex: /home/$YOU/astroport/... film, youtube, mp3 CAT=$(echo "$TYPE" | awk '{ print tolowper($0) }') -[[ ! $CAT ]] && echo "CAT est le 5e champs de $path" && exit 1 +[[ ! $CAT ]] && echo "CAT est le 6e champs de $path" && exit 1 PREFIX=$(echo "$TYPE" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, Y, M