Compare commits
No commits in common. "318467d0c693600eda61b8c2dcac26c586a196d4" and "a9e75d7933cc577974a4186dc800d060cd5e06af" have entirely different histories.
318467d0c6
...
a9e75d7933
3 changed files with 34 additions and 83 deletions
|
@ -24,14 +24,10 @@ main() {
|
|||
options=( --app-name=cmus --transient -u low)
|
||||
|
||||
filename=${file##*/}
|
||||
path=${file%/*}
|
||||
|
||||
if [[ -f "${path}/cover.png" ]]; then
|
||||
options+=( -i "${path}/cover.png" )
|
||||
fi
|
||||
|
||||
if [[ -f "${path}/cover.jpg" ]]; then
|
||||
options+=( -i "${path}/cover.jpg" )
|
||||
image=${file%/*}/cover.jpg
|
||||
|
||||
if [[ -f "$image" ]]; then
|
||||
options+=( -i "${image}" )
|
||||
fi
|
||||
|
||||
## Get title or filename
|
||||
|
|
|
@ -53,4 +53,4 @@ set color_win_dir=default
|
|||
|
||||
set status_display_program=~/.config/cmus/notify.sh
|
||||
set format_current= %{?stream??} %t %{?a?by %a} %{?l?on %l}%= %y
|
||||
add -l ~/medias/musics
|
||||
add -l ~/medias/music
|
||||
|
|
|
@ -16,10 +16,6 @@ process_args() {
|
|||
key_label="$2"
|
||||
shift
|
||||
;;
|
||||
-r|--recorder)
|
||||
recorder_label="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
break
|
||||
esac
|
||||
|
@ -27,38 +23,6 @@ process_args() {
|
|||
done
|
||||
}
|
||||
|
||||
mount_device() {
|
||||
local label="$1"
|
||||
local unmount="${2:-0}"
|
||||
local device
|
||||
if [[ $unmount -eq 1 ]]; then
|
||||
printf "Unm"
|
||||
else
|
||||
printf "M"
|
||||
fi
|
||||
printf "ount device with Label %s\n" "$label"
|
||||
device="/dev/$(lsblk -o KNAME,LABEL | grep "${label}" | awk '{print $1}')"
|
||||
|
||||
# check is we found a device with this name
|
||||
if [[ $device = "/dev/" ]]; then
|
||||
error "Can't get device named $label is device plugged?"
|
||||
return 1
|
||||
fi
|
||||
local command
|
||||
if [[ $unmount -eq 1 ]]; then
|
||||
command="unmount"
|
||||
else
|
||||
command="mount"
|
||||
fi
|
||||
|
||||
if ! udisksctl "${command}" -b "${device}"; then
|
||||
error " -> Error mounting device $device for $label"
|
||||
return 1
|
||||
fi
|
||||
sleep 1
|
||||
return 0
|
||||
}
|
||||
|
||||
get_file_hash() {
|
||||
local file
|
||||
local file_size
|
||||
|
@ -90,23 +54,6 @@ get_file_hash() {
|
|||
printf "%s" -1
|
||||
}
|
||||
|
||||
move_file(){
|
||||
local source="$1"
|
||||
local destination="$2"
|
||||
|
||||
printf "Move %s to %s:\n" "$source" "$destination"
|
||||
if [[ ! -d "${destination%/*}" ]]; then
|
||||
error "$destination directory does not exists"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! mv "$source" "$destination"; then
|
||||
error "Error moving $source file, file must not exists"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
get_file_size() {
|
||||
local file
|
||||
file=$1
|
||||
|
@ -143,7 +90,7 @@ base_dir="${HOME}/medias/videos/sambab"
|
|||
|
||||
conf="$*"
|
||||
key_label=${key_label:-SAMBAB}
|
||||
recorder_label=${recorder_label:-"LS-100"}
|
||||
|
||||
|
||||
printf "Creation de la conférence de %s\n" "$conf"
|
||||
cd ~/medias/videos/sambab || exit 1
|
||||
|
@ -154,7 +101,7 @@ friday=$(date --date='last Friday' +"%Y.%m.%d")
|
|||
#Add basedir, then I have my directory
|
||||
folder="${base_dir}/${friday}-${conf// /_}"
|
||||
|
||||
# create it
|
||||
#create it
|
||||
mkdir "${folder}/"{rushes,audio,titles} -p || die "folder creation failed"
|
||||
|
||||
|
||||
|
@ -175,28 +122,36 @@ inkscape --export-type="png" "${folder}/titles/logo_amis.svg" || die "Export fai
|
|||
printf "Importing PNG File in %s/montage.kdenlive \n" "$folder"
|
||||
insert_media "$folder/titles/logo_amis.png" "logo"
|
||||
|
||||
## Get file from USB key
|
||||
if mount_device "$key_label"; then
|
||||
if move_file "/run/media/${USER}/${key_label}/RECORD/EXREC/"*.MP3 "${folder}/audio/audio.mp3"; then
|
||||
insert_media "${folder}/audio/audio.mp3"
|
||||
fi
|
||||
echo "Mount USBkey with Label $key_label"
|
||||
usb_key="/dev/$(lsblk -o KNAME,LABEL | grep "${key_label}" | awk '{print $1}')"
|
||||
[[ ! $usb_key = "/dev/" ]] || die "Can't getting device name, is USB key plugged? $usb_key"
|
||||
|
||||
if move_file "/run/media/${USER}/${key_label}/$(date --date='last Friday' +'%Y-%m-%d')"\ *.mkv "${folder}/rushes/obs.mkv";
|
||||
then
|
||||
insert_media "${folder}/rushes/obs.mkv" video
|
||||
fi
|
||||
mount_device "$key_label" 1
|
||||
fi
|
||||
|
||||
## Get audio file from RECORDER
|
||||
if mount_device "$recorder_label"; then
|
||||
if move_file "/run/media/${USER}/${recorder_label}/RECORDER/FOLDER_A/"VOC_*.wav "${folder}/audio/recorder.wav"; then
|
||||
insert_media "${folder}/audio/recorder.wav"
|
||||
fi
|
||||
mount_device "${recorder_label}" 1
|
||||
fi
|
||||
disk="$(udisksctl mount -b "${usb_key}" | awk '{print $4}')"
|
||||
sleep 1
|
||||
[[ -n $disk ]] || die " -> Error mounting device $usb_key"
|
||||
|
||||
|
||||
printf "Change root folder in montage.kdenlive to %s\n" "$folder"
|
||||
# sed -i -e "s#\[\[root_folder\]\]#${folder}#g" "${folder}/montage.kdenlive"
|
||||
sed -i -e "s#\[\[root_folder\]\]#${folder}#g" "${folder}/montage.kdenlive"
|
||||
|
||||
printf "Copying Audio File: %s\n" "$folder"
|
||||
if mv "${disk}/RECORD/EXREC/"*.MP3 "${folder}/audio/audio.mp3";
|
||||
then
|
||||
# import audio file
|
||||
printf "Importing Audio File in %s/montage.kdenlive \n" "$folder"
|
||||
insert_media "${folder}/audio/audio.mp3" audio
|
||||
else
|
||||
error "Moving audio file failed!"
|
||||
fi
|
||||
|
||||
printf "Copying Video File\n"
|
||||
if mv "${disk}/$(date --date='last Friday' +'%Y-%m-%d')"\ *.mkv "${folder}/rushes/obs.mkv";
|
||||
then
|
||||
insert_media "${folder}/rushes/obs.mkv" video
|
||||
else
|
||||
error "Moving video file failed!"
|
||||
fi
|
||||
|
||||
udisksctl unmount -b "${usb_key}"
|
||||
exit 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue