diff --git a/SL/sl_findlang b/SL/sl_findlang index 7ccfd8f..b54b8d0 100755 --- a/SL/sl_findlang +++ b/SL/sl_findlang @@ -9,6 +9,8 @@ verse="${3}" [ -z "${3}" ] && errx "Usage: $(basename ${0}) " 1 +mpv_count=2 + dir='/home/maj/._nosnapshot/Videos/SL/Publications/nwt/nwt_info' cd "${dir}" @@ -19,7 +21,7 @@ for file in videos_nwt_*.json; do lang=${file#videos_nwt_} lang=${lang%.json} - vid_lang=$(jq -rn 'input | .languages.'${lang}'.name' "${file}" 2>/dev/null) + vid_sl=$(jq -rn 'input | .languages.'${lang}'.name' "${file}" 2>/dev/null) vid_marker=$(jq '.files.'${lang}'.MP4[] | select(.label == "720p") | .markers | select(.bibleBookNumber == '${book}' and .bibleBookChapter == '${chapter}') | .markers[] | select(.verseNumber == '${verse}')' "${file}" 2>/dev/null) vid_url=$(jq -r '.files.'${lang}'.MP4[] | select(.label=="720p" and .markers.bibleBookNumber == '${book}' and .markers.bibleBookChapter == '${chapter}') | .file.url' "${file}" 2>/dev/null) start_time=$(echo "${vid_marker}" | jq -r '.startTime') @@ -28,13 +30,19 @@ for file in videos_nwt_*.json; do [ -n "${vid_marker}" ] && { echo "${file}" - echo-r "${vid_lang}" + echo-r "${vid_sl}" echo "${vid_marker}" | jq echo-g "${vid_url}" echo-y " mpv --keep-open=always --resume-playback=no --save-position-on-quit=no --start=${start_time} --length=${duration} ${vid_url}" echo + mpv --pause=yes --keep-open=always --resume-playback=no --focus-on-open=no --window-minimized=yes --osd-playing-msg="${vid_sl}" --osd-duration=3600000 --save-position-on-quit=no --start=${start_time} --length=${duration} ${vid_url} & + + while [ $(jobs -r -p | wc -l) -ge ${mpv_count} ]; do sleep 1; done + + echo + } done