From b48ceef7a2217056c24e736874802c7cbd0e6375 Mon Sep 17 00:00:00 2001 From: Viktor Semykin Date: Wed, 2 Jun 2010 09:25:56 +0300 Subject: WIP --- plugins/lastfm/lastfm.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'plugins/lastfm') diff --git a/plugins/lastfm/lastfm.c b/plugins/lastfm/lastfm.c index d8ddf5f6..1773abd6 100644 --- a/plugins/lastfm/lastfm.c +++ b/plugins/lastfm/lastfm.c @@ -869,13 +869,22 @@ static DB_plugin_action_t lookup_action = { .next = &love_action }; -static int -lfm_get_actions (DB_plugin_action_t **actions) +static DB_plugin_action_t * +lfm_get_actions (DB_playItem_t *it) { - // Just prepend our action - love_action.next = *actions; - *actions = &lookup_action; - return 1; + if (!it || + !deadbeef->pl_find_meta (it, "artist") || + !deadbeef->pl_find_meta (it, "title")) + { + love_action.flags |= DB_ACTION_DISABLED; + lookup_action.flags |= DB_ACTION_DISABLED; + } + else + { + love_action.flags &= ~DB_ACTION_DISABLED; + lookup_action.flags &= ~DB_ACTION_DISABLED; + } + return &lookup_action; } static const char settings_dlg[] = -- cgit v1.2.3