Merge pull request #499 from P-Storm/feature/mpd-tags

supported more tags
This commit is contained in:
tobi-wan-kenobi 2019-12-26 14:00:53 +01:00 committed by GitHub
commit 1238914fd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,7 +79,27 @@ class Module(bumblebee.engine.Module):
def _load_song(self): def _load_song(self):
info = "" info = ""
try: try:
info = bumblebee.util.execute('mpc -f "tag artist %artist%\ntag title %title%"' + self._hostcmd) tags = {'name',
'artist',
'album',
'albumartist',
'comment',
'composer',
'date',
'originaldate',
'disc',
'genre',
'performer',
'title',
'track',
'time',
'file',
'id',
'prio',
'mtime',
'mdate'}
joinedtags = "\n".join(["tag {0} %{0}%".format(tag) for tag in tags])
info = bumblebee.util.execute('mpc -f ' + '"' + joinedtags + '"' + self._hostcmd)
except RuntimeError: except RuntimeError:
pass pass
self._tags = defaultdict(lambda: '') self._tags = defaultdict(lambda: '')