playlist: Allow replaying finished playlist

Instead of responding with a "Nothing to resume"
message when user tries to resume a playlist that's
finished playing, offer to start from the beginning
again.

Change-Id: Icc4894d4e2d2e29beb1c7646462f9af69e5733aa
This commit is contained in:
Christian Soffke 2025-01-09 03:23:54 +01:00
parent ca459a9d09
commit 133eb84177
2 changed files with 22 additions and 4 deletions

View file

@ -16601,3 +16601,17 @@
*: "view log"
</voice>
</phrase>
<phrase>
id: LANG_REPLAY_FINISHED_PLAYLIST
desc: Resume playback of finished playlist
user: core
<source>
*: "Playlist finished. Play again?"
</source>
<dest>
*: "Playlist finished. Play again?"
</dest>
<voice>
*: "Playlist finished. Play again?"
</voice>
</phrase>

View file

@ -328,7 +328,7 @@ static int wpsscrn(void* param)
talk_shutup();
ret_val = gui_wps_show();
}
else if ( global_status.resume_index != -1 )
else if (global_status.resume_index != -1)
{
DEBUGF("Resume index %d crc32 %lX offset %lX\n",
global_status.resume_index,
@ -343,9 +343,13 @@ static int wpsscrn(void* param)
ret_val = gui_wps_show();
}
}
else
{
else if (!file_exists(PLAYLIST_CONTROL_FILE))
splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
else if (yesno_pop(ID2P(LANG_REPLAY_FINISHED_PLAYLIST)) &&
playlist_resume() != -1)
{
playlist_start(0, 0, 0);
ret_val = gui_wps_show();
}
if (ret_val == GO_TO_PLAYLIST_VIEWER
@ -1038,7 +1042,7 @@ void root_menu(void)
next_screen = GO_TO_FILEBROWSER;
shortcut_origin = GO_TO_ROOT;
/* note in some cases there is a screen to return to
but the history is rewritten as if you browsed here
but the history is rewritten as if you browsed here
from the root so return there when finished */
}
else if (shortcut_origin != GO_TO_ROOT)