diff options
| author | 2019-02-28 16:22:35 +0000 | |
|---|---|---|
| committer | 2019-02-28 16:22:35 +0000 | |
| commit | e77d681d7dda286d1ca1f46a4be3e8772c3cdada (patch) | |
| tree | 3d5bc5297aee4d701e0e5f47b319bfd3e120ff72 | |
| parent | Need to str() Hostmask objects in ParsedLine.format() (diff) | |
| signature | ||
Don't show lastfm play count if it is 0
| -rw-r--r-- | modules/lastfm.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/lastfm.py b/modules/lastfm.py index 7cf52832..d8f24415 100644 --- a/modules/lastfm.py +++ b/modules/lastfm.py @@ -68,7 +68,8 @@ class Module(ModuleManager.BaseModule): tags = "" play_count = "" - if "userplaycount" in info_page.data.get("track", []): + if ("userplaycount" in info_page.data.get("track", {}) and + info_page.data["track"]["userplaycount"] > 0): play_count = int(info_page.data["track"]["userplaycount"]) play_count = " (%d play%s)" % (play_count, "s" if play_count > 1 else "") |
