Commit 57c49293 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Fix track album title not getting into directory contents

parent 0f838711
......@@ -312,6 +312,7 @@ static int resultToEntries(const string& encoded, int stidx, int cnt,
JSONTOUPS(uri, uri);
JSONTOUPS(artist, dc:creator);
JSONTOUPS(genre, upnp:genre);
JSONTOUPS(album, upnp:album);
JSONTOUPS(tracknum, upnp:originalTrackNumber);
JSONTOUPS(mime, res:mime);
string srate = decoded[i].get("res:samplefreq", "").asString();
......
......@@ -172,16 +172,19 @@ def _parse_playlist(json_obj, artist=None, artists=None):
return Playlist(**kwargs)
def _parse_track(json_obj, albumarg = None):
album = None
if 'album' in json_obj:
album = _parse_album(json_obj['album'], artist)
else:
album = albumarg
if 'performer' in json_obj:
artist = _parse_artist(json_obj['performer'])
elif 'artist' in json_obj:
artist = _parse_artist(json_obj['artist'])
elif 'album' in json_obj:
album = _parse_album(json_obj['album'])
elif album:
if album.artist:
artist = album.artist
elif albumarg:
artist = albumarg.artist
else:
artist = Artist()
......@@ -198,10 +201,9 @@ def _parse_track(json_obj, albumarg = None):
'available': available
#'artists': artists,
}
if 'album' in json_obj:
kwargs['album'] = _parse_album(json_obj['album'], artist)
elif albumarg:
kwargs['album'] = albumarg
if album:
kwargs['album'] = album
return Track(**kwargs)
......
......@@ -158,6 +158,7 @@ string UpSong::didl()
} else {
UPNPXMLD(upnpClass, upnp:class, "object.item.audioItem.musicTrack");
UPNPXML(genre, upnp:genre);
UPNPXML(album, upnp:album);
UPNPXML(tracknum, upnp:originalTrackNumber);
string sfs = SoapHelp::i2s((samplefreq == 0 ? 44100 : samplefreq));
......@@ -274,7 +275,7 @@ string didlmake(const UpSong& song)
// Bitrate keeps changing for VBRs and forces events. Keeping
// it out for now.
// << "bitrate=\"" << mpds.kbrate << "\" "
<< "sampleFrequency=\"44100\" audioChannels=\"2\" "
<< "sampleFrequency=\"44100\" nrAudioChannels=\"2\" "
<< "protocolInfo=\"http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000\""
<< ">"
<< SoapHelp::xmlQuote(song.uri)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment