Skip to content

Commit

Permalink
Fix #17: Add URLs to Tracklist.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkem committed Feb 10, 2015
1 parent f5c6bfb commit 04cacd7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions www/js/tracklist.js
Expand Up @@ -71,6 +71,11 @@ angular.module('mopidy-mobile.tracklist', [
disabled: '!tlTracks.length',
hellip: true
},
{
text: 'Add URL',
click: 'popover.hide() && addURL()',
hellip: true
},
{
text: 'Save as',
click: 'popover.hide() && save()',
Expand All @@ -85,6 +90,17 @@ angular.module('mopidy-mobile.tracklist', [
currentTlTrack: currentTlTrack,
options: options,
tlTracks: tlTracks,
addURL: function() {
popup.prompt('Stream URL').then(function(url) {
if (url) {
connection(function(mopidy) {
return mopidy.tracklist.add({uri: url}).then(function(tlTracks) {
return mopidy.playback.play({tl_track: tlTracks[0]});
});
});
}
});
},
clear: function() {
popup.confirm('Clear Tracklist').then(function(result) {
if (result) {
Expand Down

0 comments on commit 04cacd7

Please sign in to comment.