Skip to content

Commit

Permalink
Upd: use mympd.hash_md5
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Jun 11, 2024
1 parent b933777 commit bb831ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
6 changes: 0 additions & 6 deletions last.fm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

Scrobble tracks, send now playing and feedback from myMPD to last.fm.

Tested on Debian 13, you need to install MD5 library:

```sh
sudo apt-get install lua-md5
```

## Create variables

| VARIABLE | VALUE |
Expand Down
7 changes: 1 addition & 6 deletions last.fm/lastfmLib.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
-- {"name": "lastfmLib", "file": "last.fm/lastfmLib.lua", "version": 1, "desc": "Library requried by the other last.fm modules.", "order":0,"arguments":[]}
package.path = package.path .. ";/usr/share/lua/5.2/?.lua"
package.cpath = package.cpath .. ";/usr/lib/x86_64-linux-gnu/lua/5.2/?.so"

local md5 = require "md5"

lastfmLib = {}

Expand All @@ -17,7 +13,7 @@ local function hashRequest(data, secret)
s = s .. v .. data[v]
end
s = s .. secret
local hash = md5.sumhexa(s)
local hash = mympd.hash_md5(s)
return hash
end

Expand All @@ -28,7 +24,6 @@ local function urlencode_data(data)
table.insert(a, mympd.urlencode(k) .. "=" .. mympd.urlencode(v))
end
s = table.concat(a, "&")

return s
end

Expand Down

0 comments on commit bb831ee

Please sign in to comment.