fix pages

This commit is contained in:
localhost_frssoft 2022-04-05 23:37:09 +03:00
parent cf9c2ba397
commit 52d598b7e6

View file

@ -50,11 +50,20 @@ peertube_menu_videos()
{
echo "Avalaible $(jj -i preload total) videos"
sub_menu=1
page=0
while [ $sub_menu -eq 1 ]; do
names=$(jj -i preload -l 'data.#.name')
menu_videos_choice=$(echo "Main menu\n$names" | fzy)
menu_videos_choice=$(echo "Main menu\n$names\nNext page" | fzy)
case $menu_videos_choice in
"Main menu") sub_menu=0 ;;
"Next page")
if [ "$1" = 'all' ]; then
page=$(expr $page + 100)
peertube_api_get_all_videos $page
else
page=$(expr $page + 100)
peertube_api_get_local_videos $page
fi ;;
*)
video_uuid=$(jj -i preload data.#[name="$menu_videos_choice"].uuid)
peertube_menu_video $video_uuid ;
@ -145,16 +154,12 @@ while true; do
case "$choice" in
"$videosmenu")
echo 'Enter page number (per 100 videos)'
read page
peertube_api_get_all_videos $page
peertube_menu_videos ;;
peertube_api_get_all_videos 0
peertube_menu_videos 'all' ;;
"$videosmenulocal")
echo 'Enter page number (per 100 videos)'
read page
peertube_api_get_local_videos $page
peertube_menu_videos ;;
peertube_api_get_local_videos 0
peertube_menu_videos 'local' ;;
"$changepod")
empty=0