queue_save: move code to queue_save_song()
This commit is contained in:
parent
63c9a20f96
commit
0c5305c51f
@ -26,16 +26,20 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
static void
|
||||||
|
queue_save_song(FILE *fp, int idx, const struct song *song)
|
||||||
|
{
|
||||||
|
char *uri = song_get_uri(song);
|
||||||
|
|
||||||
|
fprintf(fp, "%i:%s\n", idx, uri);
|
||||||
|
g_free(uri);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
queue_save(FILE *fp, const struct queue *queue)
|
queue_save(FILE *fp, const struct queue *queue)
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i < queue_length(queue); i++) {
|
for (unsigned i = 0; i < queue_length(queue); i++)
|
||||||
const struct song *song = queue_get(queue, i);
|
queue_save_song(fp, i, queue_get(queue, i));
|
||||||
char *uri = song_get_uri(song);
|
|
||||||
|
|
||||||
fprintf(fp, "%i:%s\n", i, uri);
|
|
||||||
g_free(uri);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct song *
|
static struct song *
|
||||||
|
Loading…
Reference in New Issue
Block a user