# Adding a track to a local m3u8 playlist

**URL:** <https://discourse.mopidy.com/t/adding-a-track-to-a-local-m3u8-playlist/1323>\
**Category:** Misc\
**Created:** [August 23, 2016, 8:07pm UTC](https://discourse.mopidy.com/t/adding-a-track-to-a-local-m3u8-playlist/1323 "2016-08-23T20:07:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaedb](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jaedb/32/2340_2.png) [@jaedb](https://discourse.mopidy.com/u/jaedb)\
**Post date:** [August 23, 2016, 8:07pm UTC](https://discourse.mopidy.com/t/adding-a-track-to-a-local-m3u8-playlist/1323/1 "2016-08-23T20:07:05Z")

</div>

I’m adding support to _Spotmop_ HTTP Client for the new m3u playlist API. However I’m having trouble identifying how to add tracks to these playlists. I’ve had a look through the [`playlists.py`](https://github.com/mopidy/mopidy/blob/develop/mopidy/m3u/playlists.py) code and there doesn’t appear to be any methods providing this functionality.

Please tell me that I’m not using my eyes properly!

---

<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:** [August 24, 2016, 3:31pm UTC](https://discourse.mopidy.com/t/adding-a-track-to-a-local-m3u8-playlist/1323/2 "2016-08-24T15:31:44Z")

</div>

[https://docs.mopidy.com/en/latest/api/core/#mopidy.core.mopidy.core.PlaylistsController](https://docs.mopidy.com/en/latest/api/core/#mopidy.core.mopidy.core.PlaylistsController)

---

<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:** [August 24, 2016, 3:42pm UTC](https://discourse.mopidy.com/t/adding-a-track-to-a-local-m3u8-playlist/1323/3 "2016-08-24T15:42:33Z")

</div>

Sample code for saving the current tracklist (`$scope.tlTracks`) as a playlist:

> <https://github.com/tkem/mopidy-mobile/blob/master/www/app/tracklist/tracklist.js#L161>

---

<div class="post-metadata">

**Author:** ![jaedb](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jaedb/32/2340_2.png) [@jaedb](https://discourse.mopidy.com/u/jaedb)\
**Post date:** [August 24, 2016, 8:06pm UTC](https://discourse.mopidy.com/t/adding-a-track-to-a-local-m3u8-playlist/1323/4 "2016-08-24T20:06:03Z")

</div>

Great, thanks for those answers.

Just to clarify though, there is no way to add tracks and manipulate an existing playlist without passing the entire updated playlist object?

---

<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:** [August 25, 2016, 6:01am UTC](https://discourse.mopidy.com/t/adding-a-track-to-a-local-m3u8-playlist/1323/5 "2016-08-25T06:01:53Z")

</div>

Nope, currently there’s only `save`, which takes a full `Playlist` model. The “editing” part of the playlists API hasn’t had much attention so far, mostly because few clients actually use it. Any ideas for improvements are welcome, of course.
