diff --git a/README.rst b/README.rst
index 0b92c38..acd9c2d 100644
--- a/README.rst
+++ b/README.rst
@@ -2,18 +2,33 @@
Mopidy Browser Client
*********************
-Mopidy is a music server which can play music from `Spotify
-`_ or from your local hard drive.
-
This is a responsive html/js/css client for Mopidy. Responsive, so it works on desktop and mobile browsers.
-Note: this is under heavy development!
+`Mopidy `_ is a music server which can play music from `Spotify `_ or from your local hard drive.
+
+Development
+===========
+
+Note: this client under heavy development! At the moment, initial loading is extremely slow, especially on mobile devices. As Mopidy changes, this client changes as well. It tries to follow the development-branch of Mopidy for now, so update Mopidy as you update the client.
Installation
+============
-To install Mopidy, check out
-`the installation docs `_ or `the settings docs `_.
+To install Mopidy, check out `the installation docs `_, `the settings docs `_ and `even more detailed information `.
Quick install
+=============
-Drop the files from this client in a folder on your Mopidy-system. Then change the settings.py (in the root directory of the Mopidy code) to make it work. Add a line *mopidy.frontends.http.HttpFrontend* to the FRONTENDS section, and set the *HTTP_SERVER_STATIC_DIR* to point to the folder with the files from the web client.
\ No newline at end of file
+Drop the files from this client in a folder on your Mopidy-system. Then change the settings.py (in the root directory of the Mopidy code) to make it work. Add a line *mopidy.frontends.http.HttpFrontend* to the FRONTENDS section, and set the *HTTP_SERVER_STATIC_DIR* to point to the folder with the files from the web client.
+
+Security
+========
+
+As a simple security measure, the web server is by default only available
+ from localhost. To make it available from other computers, change
+ :attr:`mopidy.settings.HTTP_SERVER_HOSTNAME`. Before you do so, note that
+ the HTTP frontend does not feature any form of user authentication or
+ authorization. Anyone able to access the web server can use the full core
+ API of Mopidy. Thus, you probably only want to make the web server
+ available from your local network or place it behind a web proxy which
+ takes care or user authentication. You have been warned.
\ No newline at end of file
diff --git a/index.html b/index.html
index b086141..c7e490a 100755
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
-
+
@@ -16,6 +16,12 @@
+
+
diff --git a/js/functionsvars.js b/js/functionsvars.js
index 8b0b33d..0477885 100755
--- a/js/functionsvars.js
+++ b/js/functionsvars.js
@@ -34,6 +34,7 @@ var customPlaylists = new Array();
var customTracklists = new Array();
//constants
+PROGRAM_NAME = 'Mopidy';
ARTIST_TABLE = '#artiststable';
ALBUM_TABLE = '#albumstable';
PLAYLIST_TABLE = '#playlisttable';
diff --git a/js/gui.js b/js/gui.js
index 95aad58..da9dbc4 100755
--- a/js/gui.js
+++ b/js/gui.js
@@ -283,8 +283,6 @@ function triggerPos() {
}
function getPlaylists() {
- // d = new Date();
- // console.log('Getplaylists: ' + d.getMilliseconds() );
mopidy.playlists.getPlaylists().then(processGetplaylists, console.error);
}
@@ -329,8 +327,8 @@ function initSocketevents() {
mopidy.on("event:trackPlaybackStarted", function(data) {
mopidy.playback.getTimePosition().then(processCurrentposition, console.error);
- setSongInfo(data.tl_track.track);
setPlayState(true);
+ setSongInfo(data.tl_track.track);
initTimer();
});
@@ -456,7 +454,7 @@ $(document).ready(function() {
}
// Set the page title based on the hash.
- document.title = divid;
+ document.title = PROGRAM_NAME + ' - ' + divid;
$('.content').hide();
$('.nav li').removeClass('active');
diff --git a/js/ws.js b/js/ws.js
index b59c7ff..425d155 100755
--- a/js/ws.js
+++ b/js/ws.js
@@ -13,6 +13,7 @@ function playtrack(uri, playlisturi) {
var track;
switchContent('current', uri);
tracks = getTracksFromUri(playlisturi);
+ console.log(tracks);
if (tracks) {
$(CURRENT_PLAYLIST_TABLE).empty();
mopidy.tracklist.clear();
@@ -23,6 +24,7 @@ function playtrack(uri, playlisturi) {
for (var i = 0; i < tracks.length; i++) {
if (tracks[i].uri == uri) {
track = i + 1;
+ break;
}
}
console.log(track);
@@ -118,7 +120,7 @@ function processSinglePlaylist(resultArr) {
function processCurrentPlaylist(resultArr) {
currentplaylist = resultArr;
playlisttotable(resultArr, CURRENT_PLAYLIST_TABLE);
- mopidy.playback.getCurrentTrack().then(currentTrackResults, console.error);
+ mopidy.playback.getCurrentTrack().then(processCurrenttrack, console.error);
}
/********************************************************
@@ -129,13 +131,14 @@ function processSearchResults(resultArr) {
$(SEARCH_ARTIST_TABLE).empty();
$(SEARCH_ALBUM_TABLE).empty();
$("#searchresults").show();
+ //get the right result
+ results = resultArr[0];
+
- playlisttotable(resultArr[1].tracks, SEARCH_TRACK_TABLE, 'trackresultscache');
- customTracklists['trackresultscache'] = resultArr[1].tracks;
-
- var artists = resultArr[1].artists;
+ playlisttotable(results.tracks, SEARCH_TRACK_TABLE, 'trackresultscache');
+ customTracklists['trackresultscache'] = results.tracks;
+ var artists = results.artists;
var child = '';
-
for (var i = 0; i < artists.length; i++) {
child += '