Skip to content

Commit

Permalink
Upd: small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed May 26, 2024
1 parent 316da17 commit 09693a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
10 changes: 4 additions & 6 deletions ListenBrainz/ListenBrainz-Scrobbler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ if rc ~= 0 then
return
end

if result.webradio then
return
end

if string.sub(result.uri, 1, 8) == "https://" or
string.sub(result.uri, 1, 7) == "http://" then
if result.webradio or
string.sub(result.uri, 1, 8) == "https://" or
string.sub(result.uri, 1, 7) == "http://"
then
return
end

Expand Down
14 changes: 6 additions & 8 deletions last.fm/lastfm_player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ local play_state = mympd_state.play_state
local elapsed_time = mympd_state.elapsed_time

if play_state ~= 2 or elapsed_time > 5 then
return "not now playing"
return "Now Playing: Not Playing"
end

local rc, result = mympd.api("MYMPD_API_PLAYER_CURRENT_SONG")
if rc ~= 0 then
return "Now Playing: Not Playing"
end

if result.webradio then
return "web radio"
end

if string.sub(result.uri, 1, 8) == "https://" or
string.sub(result.uri, 1, 7) == "http://" then
return "web radio"
if result.webradio or
string.sub(result.uri, 1, 8) == "https://" or
string.sub(result.uri, 1, 7) == "http://"
then
return
end

local artist = result.Artist[1]
Expand Down
2 changes: 0 additions & 2 deletions last.fm/lastfm_scrobble.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
-- {"order":1,"arguments":[]}
mympd.init()

local lastfm_lib = require "scripts/lastfm_lib"

-- main
Expand Down

0 comments on commit 09693a9

Please sign in to comment.