Skip to content

Commit

Permalink
lastfm: fix lookup for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba160 committed Mar 6, 2019
1 parent a2feb8c commit a10d603
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/lastfm/lastfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ static DB_functions_t *deadbeef;
#define SCROBBLER_URL_LFM "http://post.audioscrobbler.com"
#define SCROBBLER_URL_LIBRE "http://turtle.libre.fm"

#ifdef __MINGW32__
#define LOOKUP_URL_FORMAT "cmd /c start http://www.last.fm/music/%s/_/%s"
#else
#define LOOKUP_URL_FORMAT "xdg-open 'http://www.last.fm/music/%s/_/%s' &"
#endif

static char lfm_user[100];
static char lfm_pass[100];

Expand Down Expand Up @@ -846,7 +852,7 @@ lfm_action_lookup (DB_plugin_action_t *action, int ctx)
goto out;
}

if (-1 == asprintf (&command, "xdg-open 'http://www.last.fm/music/%s/_/%s' &", eartist, etitle)) {
if (-1 == asprintf (&command, LOOKUP_URL_FORMAT, eartist, etitle)) {
goto out;
}

Expand Down

0 comments on commit a10d603

Please sign in to comment.