When using local backend, there is no metadata in listed tracks.
The only way of retrieving them is by using lookup
function, but this is inconvenient as it requires to do additional call and is not consistent with in example Gmusic backend which returns this data on every call.
It is also impossible to search by metadata - the only returned results are tracks, that are matched by file name.
Would it be possible to store metadata during local scan and return it in endpoints such as getCurrentTlTrack
, browse
, etc?
I also tried sqlite extension, but it behavior is exactly the same - it’s missing metadata information.
What exactly do you mean by “metadata information”?
I mean info like artist, album, length. Currently I get object that has only name and uri. It’s also impossible to search by artist and album.
Maybe you find more info in reported issue https://github.com/mopidy/mopidy/issues/1093
“I get object” from what?
library.browse()
returns Ref
objects, library.lookup()
returns Track
objects.
This is the same for every backend. I would be surprised if Mopidy-GMusic behaves differently.
See https://docs.mopidy.com/en/latest/api/core/#library-controller.
In the browse
endpoint indeed Gmusic returns object with uri and name only.
But on getTlTracks
and getCurrentTlTrack
it returns full object:
__model__: "Track"
album: Object
artists: Array[1]
bitrate: 320
date: "2014"
disc_no: 1
length: 499000
name: "Smiler At 50"
track_no: 2
uri: "gmusic:track:Tvgzl4ngtmhisrrjcdocsnzfcie"
Mopidy-GMusic has no getTlTracks
or getCurrentTlTrack
methods. You’re probably referring to the TracklistController
API.
I’m not familiar with implementation details.
I’m using mopidy.js and calling getCurrentTlTrack
https://github.com/cowbell/mopster/blob/master/app/models/mop.js#L52
If you have a Gmusic account on your Mopidy, you can test it on http://mopster.cowbell-labs.com/
These are not “implementation details”, this is the API you are trying to use.
I strongly suggest studying https://docs.mopidy.com/en/latest/api/ before going any further!
I solved this issue by adding tracks to queue by calling tracklist.add
with uris
param which makes a lookup before, so metadata is properly read.
Still missing a search by metadata in local files though.