From 2a9a0a8282d482cfa4d3c06254f167aaa86c38dd Mon Sep 17 00:00:00 2001 From: Arslan Ablikim Date: Tue, 8 Aug 2017 13:35:03 +0800 Subject: [PATCH] added elapsed time to spotify applescript player segment --- powerline/segments/common/players.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/powerline/segments/common/players.py b/powerline/segments/common/players.py index 0240b9e5..21860c69 100644 --- a/powerline/segments/common/players.py +++ b/powerline/segments/common/players.py @@ -342,7 +342,7 @@ class SpotifyAppleScriptPlayerSegment(PlayerSegment): set artist_name to artist of current track set album_name to album of current track set track_length to duration of current track - set now_playing to "" & player state & "{0}" & album_name & "{0}" & artist_name & "{0}" & track_name & "{0}" & track_length + set now_playing to "" & player state & "{0}" & album_name & "{0}" & artist_name & "{0}" & track_name & "{0}" & track_length & "{0}" & player position return now_playing else return player state @@ -367,7 +367,8 @@ class SpotifyAppleScriptPlayerSegment(PlayerSegment): 'album': spotify_status[1], 'artist': spotify_status[2], 'title': spotify_status[3], - 'total': _convert_seconds(int(spotify_status[4])/1000) + 'total': _convert_seconds(int(spotify_status[4])/1000), + 'elapsed': _convert_seconds(spotify_status[5]) }