GUI ajouter_video.sh + CLI new_file_in_astroport.sh

This commit is contained in:
qo-op 2021-02-18 01:23:04 +01:00
parent 5f5b3a9709
commit 0064b10b07
2 changed files with 4 additions and 6 deletions

View File

@ -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"

View File

@ -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