Okidoke. So, with a bit of hacking (oh my, my technical debt is growing in leaps and bounds), I have a usable player implementation in. Sorry for abusing your code, @cypherpunks but I’ve mostly tried to learn from it.
The download function (tested mostly on albums) will also:
- create a playlist file (in the same directory as the download)
- pre-populate the player playlist
Hence, after a download, you can switch to player and immediately play.
I’m pushing it to chum, so it should show up there as well. WIP, so be kind.
The whole mpris stack seems to have some bugs, and/or, meta data reading requires running additions to a player/playlist requires a more gentle approach.
@cypherpunks to get around storing meta, I’ve just done:
- when I download, generate id3 tags
- after much futzing about, extract id3 tags
- read those in the PlayerTrackItem as a last resort.
I tried to keep this as unintrusive as possible because I’d like to back port this bit to musicex for loading ‘non-musicex’ directories. it’s pretty basic (using mutagen).
try:
track_info=MP3(path, ID3=EasyID3)
# reduce the data structure
for e in track_info:
array[e] = track_info[e][0]
and in the PlayerTrackItem
track_info = {
'track': main_handler.basename(source),
'album': '',
'artist': '',
'artwork': main_handler.player_artwork,
'duration': null,
}
` // try using our hack.
const path = source.toString()
const info = py.get_track_id3(path.slice(7))
if (info['title']) track_info['track'] = info['title']
if (info['album']) track_info['album'] = info['album']
if (info['artist']) track_info['artist'] = info['artist']
I did futz around with all of it, but realized it’s just to specialized for my rather generic case.