mirror of
https://github.com/powerline/powerline.git
synced 2025-04-08 19:25:04 +02:00
Avoiding more than 1 colon in strings for file name or song title, this
may break the player indicator
This commit is contained in:
parent
0595c89f21
commit
324432bd12
@ -564,16 +564,16 @@ class MocPlayerSegment(PlayerSegment):
|
||||
'Bitrate', 'AvgBitrate', 'Rate'
|
||||
)
|
||||
now_playing = dict((
|
||||
line.split(': ')
|
||||
line.split(': ', 1)
|
||||
for line in now_playing_str.split('\n')[:-1]
|
||||
if line.split(': ')[0] not in ignore_info
|
||||
if line.split(': ', 1)[0] not in ignore_info
|
||||
))
|
||||
state = _convert_state(now_playing.get('State'))
|
||||
state = _convert_state(now_playing.get('State', 'stop'))
|
||||
return {
|
||||
'state': state,
|
||||
'album': now_playing.get('Album'),
|
||||
'artist': now_playing.get('Artist'),
|
||||
'title': now_playing.get('SongTitle'),
|
||||
'album': now_playing.get('Album', ''),
|
||||
'artist': now_playing.get('Artist', ''),
|
||||
'title': now_playing.get('SongTitle', ''),
|
||||
'elapsed': _convert_seconds(now_playing.get('CurrentSec', 0)),
|
||||
'total': _convert_seconds(now_playing.get('TotalSec', 0)),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user