From e77d681d7dda286d1ca1f46a4be3e8772c3cdada Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 28 Feb 2019 16:22:35 +0000 Subject: Don't show lastfm play count if it is 0 --- modules/lastfm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 "") -- cgit v1.3.1-10-gc9f91