Skip to content

Commit

Permalink
Upd: Small enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Jun 16, 2024
1 parent d6b8a82 commit bdc8c3f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ListenBrainz/ListenBrainzFeedback.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if mympd_env.var_listenbrainz_token == nil then
end

local uri = "https://api.listenbrainz.org/1/feedback/recording-feedback"
local headers = "Content-type: application/json\r\n"..
local extra_headers = "Content-type: application/json\r\n"..
"Authorization: Token " .. mympd_env.var_listenbrainz_token .. "\r\n"

local vote
Expand Down Expand Up @@ -32,7 +32,7 @@ if rc == 0 then
score = vote
});
local code, header, body
rc, code, header, body = mympd.http_client("POST", uri, headers, payload)
rc, code, header, body = mympd.http_client("POST", uri, extra_headers, payload)
if rc > 0 then
return body
end
Expand Down
4 changes: 2 additions & 2 deletions ListenBrainz/ListenBrainzSetPin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ end

local pin_uri = "https://api.listenbrainz.org/1/pin"
local unpin_uri = "https://api.listenbrainz.org/1/pin/unpin"
local headers = "Content-type: application/json\r\n"..
local extra_headers = "Content-type: application/json\r\n"..
"Authorization: Token " .. mympd_env.var_listenbrainz_token .. "\r\n"
local payload = ""
local uri = ""
Expand All @@ -28,7 +28,7 @@ else
end

if uri ~= "" then
local rc, code, header, body = mympd.http_client("POST", uri, headers, payload)
local rc, code, header, body = mympd.http_client("POST", uri, extra_headers, payload)
if rc > 0 then
return body
end
Expand Down
12 changes: 9 additions & 3 deletions ListenBrainz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ You can send hate/love feedback to ListenBrainz with the thumbs up and down butt
- Import the `ListenBrainzFeedback.lua` script
- Create a new trigger
- Event: `mympd_feedback`
- Action: above script
- Leave the arguments empty

## Playlist Import

Expand All @@ -38,7 +36,15 @@ You can send your listening habits to ListenBrainz.
- Import the `ListenBrainzScrobbler.lua` script
- Create a new trigger
- Event: `mympd_scrobble`
- Action: above script

## Now Playing

You can send now playing info to ListenBrainz.

- Create a new script
- Import the `ListenBrainzPlayer.lua` script
- Create a new trigger
- Event: `mpd_player`

## Set Pin

Expand Down
6 changes: 3 additions & 3 deletions last.fm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ The last.fm APi is available for everyone. You can get your API key and shared s

| EVENT | SCRIPT |
| ----- | ------ |
| Player | lastfmPlayer |
| Scrobble | lastfmScrobbler |
| Feedback | lastfmFeedback |
| mpd_player | lastfmPlayer |
| mympd_scrobble | lastfmScrobbler |
| mympd_feedback | lastfmFeedback |

***

Expand Down

0 comments on commit bdc8c3f

Please sign in to comment.