denested "if" in Song

This commit is contained in:
Martin Wagner 2021-08-04 23:34:00 +02:00
parent 68720a41bd
commit 67e8c3ece5

View File

@ -491,9 +491,9 @@ class MultiTag(list):
class Song(collections.UserDict):
def __setitem__(self, key, value):
# time is deprecated https://mpd.readthedocs.io/en/latest/protocol.html#other-metadata
if key != "time":
if key == "duration":
if key == "time": # time is deprecated https://mpd.readthedocs.io/en/latest/protocol.html#other-metadata
pass
elif key == "duration":
super().__setitem__(key, Duration(value))
elif key == "format":
super().__setitem__(key, Format(value))