Don't show lastfm play count if it is 0

This commit is contained in:
jesopo 2019-02-28 16:22:35 +00:00
parent 948c86adbc
commit e77d681d7d

View file

@ -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 "")