Skip to content

Commit 33f42c1

Browse files
committed
helper: reorganize 'love' stuff
Signed-off-by: Felipe Contreras <[email protected]>
1 parent ac220da commit 33f42c1

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

helper.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void hp_submit(void)
297297
track->album = NULL;
298298
}
299299

300-
void hp_love(bool on)
300+
void hp_love_current(bool on)
301301
{
302302
for (unsigned i = 0; i < G_N_ELEMENTS(services); i++) {
303303
struct service *s = &services[i];
@@ -307,6 +307,16 @@ void hp_love(bool on)
307307
}
308308
}
309309

310+
void hp_love(const char *artist, const char *title, bool on)
311+
{
312+
for (unsigned i = 0; i < G_N_ELEMENTS(services); i++) {
313+
struct service *s = &services[i];
314+
if (!s->on)
315+
continue;
316+
sr_session_love(s->session, artist, title, on);
317+
}
318+
}
319+
310320
void hp_stop(void)
311321
{
312322
for (unsigned i = 0; i < G_N_ELEMENTS(services); i++) {

helper.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ extern "C" {
1717
void hp_init(void);
1818
void hp_deinit(void);
1919
void hp_submit(void);
20-
void hp_love(bool on);
20+
void hp_love_current(bool on);
21+
void hp_love(const char *artist, const char *title, bool on);
2122
void hp_stop(void);
2223
void hp_next(void);
2324

0 commit comments

Comments
 (0)