diff options
author | Viktor Semykin <thesame.ml@gmail.com> | 2010-06-02 09:25:56 +0300 |
---|---|---|
committer | Viktor Semykin <thesame.ml@gmail.com> | 2010-06-02 09:25:56 +0300 |
commit | b48ceef7a2217056c24e736874802c7cbd0e6375 (patch) | |
tree | fe9ff476c5e7676cf425bf9242f6d4cc040282c6 /plugins/lastfm | |
parent | 5e6f90e90126cae7f5dd89e017e4b7eabc28ecab (diff) |
WIP
Diffstat (limited to 'plugins/lastfm')
-rw-r--r-- | plugins/lastfm/lastfm.c | 21 |
1 files changed, 15 insertions, 6 deletions
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[] = |