Fix: Select video by index instead name

This commit is contained in:
localhost_frssoft 2022-04-07 02:47:33 +03:00
parent 2ec4a92f86
commit 4024347362
1 changed files with 3 additions and 2 deletions

View File

@ -71,7 +71,7 @@ peertube_menu_videos()
sub_menu=1
page=0
while [ $sub_menu -eq 1 ]; do
names=$(jj -i preload -l 'data.#.name')
names=$(jj -i preload -l 'data.#.name' | nl -s: -v0 -w1)
menu_videos_choice=$(echo "Main menu\n$names\nNext page" | fzy)
case $menu_videos_choice in
"Main menu") sub_menu=0 ;;
@ -84,7 +84,8 @@ peertube_menu_videos()
peertube_api_get_local_videos $page
fi ;;
*)
video_uuid=$(jj -i preload data.#[name="$menu_videos_choice"].uuid)
index=$(echo $menu_videos_choice | cut -f 1 -d:)
video_uuid=$(jj -i preload data.$index.uuid)
if [ "$1" = 'lives' ]; then
peertube_menu_stream $video_uuid
else