# No metadata in tracks from local backend

**URL:** <https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654>\
**Category:** Misc\
**Created:** [April 1, 2015, 7:44pm UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654 "2015-04-01T19:44:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![morgoth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/morgoth/32/132_2.png) [@morgoth](https://discourse.mopidy.com/u/morgoth)\
**Post date:** [April 1, 2015, 7:44pm UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654/1 "2015-04-01T19:44:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tkem](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/tkem/32/22_2.png) [@tkem](https://discourse.mopidy.com/u/tkem)\
**Post date:** [April 2, 2015, 4:30am UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654/2 "2015-04-02T04:30:25Z")

</div>

What exactly do you mean by “metadata information”?

---

<div class="post-metadata">

**Author:** ![morgoth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/morgoth/32/132_2.png) [@morgoth](https://discourse.mopidy.com/u/morgoth)\
**Post date:** [April 2, 2015, 7:57am UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654/3 "2015-04-02T07:57:09Z")

</div>

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](https://github.com/mopidy/mopidy/issues/1093)

---

<div class="post-metadata">

**Author:** ![tkem](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/tkem/32/22_2.png) [@tkem](https://discourse.mopidy.com/u/tkem)\
**Post date:** [April 2, 2015, 8:05am UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654/4 "2015-04-02T08:05:33Z")

</div>

“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](https://docs.mopidy.com/en/latest/api/core/#library-controller).

---

<div class="post-metadata">

**Author:** ![morgoth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/morgoth/32/132_2.png) [@morgoth](https://discourse.mopidy.com/u/morgoth)\
**Post date:** [April 2, 2015, 8:27am UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654/5 "2015-04-02T08:27:58Z")

</div>

In the `browse` endpoint indeed Gmusic returns object with uri and name only.  
But on `getTlTracks` and `getCurrentTlTrack` it returns full object:

```auto
__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"

```

---

<div class="post-metadata">

**Author:** ![tkem](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/tkem/32/22_2.png) [@tkem](https://discourse.mopidy.com/u/tkem)\
**Post date:** [April 2, 2015, 8:33am UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654/6 "2015-04-02T08:33:41Z")

</div>

Mopidy-GMusic has no `getTlTracks` or `getCurrentTlTrack` methods. You’re probably referring to the `TracklistController` API.

---

<div class="post-metadata">

**Author:** ![morgoth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/morgoth/32/132_2.png) [@morgoth](https://discourse.mopidy.com/u/morgoth)\
**Post date:** [April 2, 2015, 8:47am UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654/7 "2015-04-02T08:47:35Z")

</div>

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](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/](http://mopster.cowbell-labs.com/)

---

<div class="post-metadata">

**Author:** ![tkem](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/tkem/32/22_2.png) [@tkem](https://discourse.mopidy.com/u/tkem)\
**Post date:** [April 2, 2015, 9:24am UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654/8 "2015-04-02T09:24:29Z")

</div>

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/](https://docs.mopidy.com/en/latest/api/) before going any further!

---

<div class="post-metadata">

**Author:** ![morgoth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/morgoth/32/132_2.png) [@morgoth](https://discourse.mopidy.com/u/morgoth)\
**Post date:** [April 6, 2015, 8:03am UTC](https://discourse.mopidy.com/t/no-metadata-in-tracks-from-local-backend/654/9 "2015-04-06T08:03:56Z")

</div>

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.
