mirror of
https://github.com/libretro/RetroArch
synced 2025-04-02 16:20:39 +00:00
Create playlist in playlist_read_file if it doesn't already
exist
This commit is contained in:
parent
c6469c8341
commit
5e43f375c6
10
playlist.c
10
playlist.c
@ -235,6 +235,13 @@ end:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void playlist_create_new(const char *path)
|
||||||
|
{
|
||||||
|
FILE *file = fopen(path, "w");
|
||||||
|
if (file)
|
||||||
|
fclose(file);
|
||||||
|
}
|
||||||
|
|
||||||
content_playlist_t *content_playlist_init(const char *path, size_t size)
|
content_playlist_t *content_playlist_init(const char *path, size_t size)
|
||||||
{
|
{
|
||||||
RARCH_LOG("Opening playlist: %s.\n", path);
|
RARCH_LOG("Opening playlist: %s.\n", path);
|
||||||
@ -253,6 +260,9 @@ content_playlist_t *content_playlist_init(const char *path, size_t size)
|
|||||||
|
|
||||||
playlist->cap = size;
|
playlist->cap = size;
|
||||||
|
|
||||||
|
if (!path_file_exists(path))
|
||||||
|
playlist_create_new(path);
|
||||||
|
|
||||||
if (!content_playlist_read_file(playlist, path))
|
if (!content_playlist_read_file(playlist, path))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user