From bd57f9e59fdd2312fa4e494ca2f78b343dce2fcc Mon Sep 17 00:00:00 2001 From: Morten Hermanrud Date: Thu, 30 Nov 2017 11:25:17 +0100 Subject: [PATCH] Added JSON output of metadata to make parsing indepedent of which tags are pushed. --- src/player.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/player.rs b/src/player.rs index 29380e33..a617c452 100644 --- a/src/player.rs +++ b/src/player.rs @@ -13,7 +13,7 @@ use core::util::{self, SpotifyId, Subfile}; use audio_backend::Sink; use audio::{AudioFile, AudioDecrypt}; use audio::{VorbisDecoder, VorbisPacket}; -use metadata::{FileFormat, Track, Metadata}; +use metadata::{Artist, FileFormat, Track, Metadata}; use mixer::AudioFilter; #[derive(Clone)] @@ -384,6 +384,12 @@ impl PlayerInternal { info!("Track \"{}\" loaded", track.name); + let artist = Artist::get(&self.session, track.artists[0]).wait().unwrap(); + + // Send metatada in json (metadata:) for simple parsinge + // and extensibility + info!("metadata:{{\"ARTIST\":\"{}\",\"TITLE\":\"{}\"}}", artist.name, track.name); + Some(decoder) } }