mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
[listener/etc.] Rename LISTENER_STICKER to LISTENER_RATING
Unit there is a real sticker implementation, make it clear, that the event is only triggered for rating changes.
This commit is contained in:
parent
c00febd8ac
commit
e7d6fbb9fc
@ -1596,7 +1596,7 @@ cache_init(void)
|
||||
|
||||
cmdbase = commands_base_new(evbase_cache, NULL);
|
||||
|
||||
ret = listener_add(cache_daap_listener_cb, LISTENER_DATABASE | LISTENER_STICKER);
|
||||
ret = listener_add(cache_daap_listener_cb, LISTENER_DATABASE | LISTENER_RATING);
|
||||
if (ret < 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_CACHE, "Could not create listener event\n");
|
||||
|
4
src/db.c
4
src/db.c
@ -2508,7 +2508,7 @@ db_file_rating_update_byid(uint32_t id, uint32_t rating)
|
||||
|
||||
query = sqlite3_mprintf(Q_TMPL, rating, id);
|
||||
|
||||
ret = db_query_run(query, 1, LISTENER_STICKER);
|
||||
ret = db_query_run(query, 1, LISTENER_RATING);
|
||||
|
||||
return ((ret < 0) ? -1 : sqlite3_changes(hdl));
|
||||
#undef Q_TMPL
|
||||
@ -2523,7 +2523,7 @@ db_file_rating_update_byvirtualpath(const char *virtual_path, uint32_t rating)
|
||||
|
||||
query = sqlite3_mprintf(Q_TMPL, rating, virtual_path);
|
||||
|
||||
ret = db_query_run(query, 1, LISTENER_STICKER);
|
||||
ret = db_query_run(query, 1, LISTENER_RATING);
|
||||
|
||||
return ((ret < 0) ? -1 : sqlite3_changes(hdl));
|
||||
#undef Q_TMPL
|
||||
|
@ -26,8 +26,8 @@ enum listener_event_type
|
||||
LISTENER_SPOTIFY = (1 << 9),
|
||||
/* Last.fm status changes (enable/disable scrobbling) */
|
||||
LISTENER_LASTFM = (1 << 10),
|
||||
/* The sticker database has been modified (MPD) */
|
||||
LISTENER_STICKER = (1 << 11),
|
||||
/* Song rating changes */
|
||||
LISTENER_RATING = (1 << 11),
|
||||
};
|
||||
|
||||
typedef void (*notify)(short event_mask);
|
||||
|
@ -59,7 +59,7 @@
|
||||
#include "remote_pairing.h"
|
||||
|
||||
|
||||
#define MPD_ALL_IDLE_LISTENER_EVENTS (LISTENER_PLAYER | LISTENER_QUEUE | LISTENER_VOLUME | LISTENER_SPEAKER | LISTENER_OPTIONS | LISTENER_DATABASE | LISTENER_UPDATE | LISTENER_STORED_PLAYLIST | LISTENER_STICKER)
|
||||
#define MPD_ALL_IDLE_LISTENER_EVENTS (LISTENER_PLAYER | LISTENER_QUEUE | LISTENER_VOLUME | LISTENER_SPEAKER | LISTENER_OPTIONS | LISTENER_DATABASE | LISTENER_UPDATE | LISTENER_STORED_PLAYLIST | LISTENER_RATING)
|
||||
#define MPD_RATING_FACTOR 10.0
|
||||
|
||||
static pthread_t tid_mpd;
|
||||
@ -669,7 +669,7 @@ mpd_command_idle(struct evbuffer *evbuf, int argc, char **argv, char **errmsg, s
|
||||
else if (0 == strcmp(argv[i], "stored_playlist"))
|
||||
ctx->idle_events |= LISTENER_STORED_PLAYLIST;
|
||||
else if (0 == strcmp(argv[i], "sticker"))
|
||||
ctx->idle_events |= LISTENER_STICKER;
|
||||
ctx->idle_events |= LISTENER_RATING;
|
||||
else
|
||||
DPRINTF(E_DBG, L_MPD, "Idle command for '%s' not supported\n", argv[i]);
|
||||
}
|
||||
@ -5096,7 +5096,7 @@ mpd_notify_idle_client(struct mpd_client_ctx *client_ctx, short events)
|
||||
evbuffer_add(client_ctx->evbuffer, "changed: options\n", 17);
|
||||
if (events & LISTENER_STORED_PLAYLIST)
|
||||
evbuffer_add(client_ctx->evbuffer, "changed: stored_playlist\n", 25);
|
||||
if (events & LISTENER_STICKER)
|
||||
if (events & LISTENER_RATING)
|
||||
evbuffer_add(client_ctx->evbuffer, "changed: sticker\n", 17);
|
||||
|
||||
evbuffer_add(client_ctx->evbuffer, "OK\n", 3);
|
||||
|
Loading…
Reference in New Issue
Block a user