Bookmarks: Fix autoload return from bookmark selection

- Fix placement of parentheses from commit 780990
- Return cancel when play_bookmark fails or user declines
to erase dynamic playlist after warning
- Go back to Playlist Catalogue when user cancels out of
screen

Change-Id: Ibe8c315bdf8c6c9e696f68541b5d4d97dc0e778a
This commit is contained in:
Christian Soffke 2022-12-04 05:38:50 +01:00
parent 879b5dae39
commit 0550c64226
2 changed files with 4 additions and 9 deletions

View file

@ -1213,18 +1213,11 @@ int bookmark_autoload(const char* file)
if (bookmark != NULL) if (bookmark != NULL)
{ {
if (!play_bookmark(bookmark)) if (!play_bookmark(bookmark))
{ return BOOKMARK_CANCEL;
/* Selected bookmark not found. */
splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
}
/* Act as if autoload was done even if it failed, since the
* user did make an active selection.
*/
return BOOKMARK_DO_RESUME; return BOOKMARK_DO_RESUME;
} }
return ret != (BOOKMARK_SUCCESS ? BOOKMARK_CANCEL : BOOKMARK_DONT_RESUME); return (ret != BOOKMARK_SUCCESS) ? BOOKMARK_CANCEL : BOOKMARK_DONT_RESUME;
} }
} }

View file

@ -217,6 +217,8 @@ restart:
int res = bookmark_autoload(selected_playlist); int res = bookmark_autoload(selected_playlist);
if (res == BOOKMARK_DO_RESUME) if (res == BOOKMARK_DO_RESUME)
result = 0; result = 0;
else if (res == BOOKMARK_CANCEL)
goto restart;
else else
{ {
switch (playlist_viewer_ex(selected_playlist, &most_recent_selection)) { switch (playlist_viewer_ex(selected_playlist, &most_recent_selection)) {