Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
woutervanwijk authored and woutervanwijk committed Sep 19, 2014
2 parents 461b74b + 8a6ff0b commit e069b98
Show file tree
Hide file tree
Showing 114 changed files with 389 additions and 36,767 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Webclient
- Wouter van Wijk
- Flat Interface: Ulrich Lichtenegger
- Kingosticks

Mopidy:
https://github.com/mopidy/mopidy/blob/develop/AUTHORS
Expand Down
876 changes: 202 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include AUTHORS
include LICENSE
include MANIFEST.in
include README.rst
include mopidy_musicbox_webclient/ext.conf

recursive-include screenshots *
recursive-include mopidy_musicbox_webclient/static *
45 changes: 0 additions & 45 deletions README.md

This file was deleted.

75 changes: 75 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
*************************
Mopidy-MusicBox-Webclient
*************************

.. image:: https://img.shields.io/pypi/v/Mopidy-MusicBox-Webclient.svg?style=flat
:target: https://pypi.python.org/pypi/Mopidy-MusicBox-Webclient/
:alt: Latest PyPI version

.. image:: https://img.shields.io/pypi/dm/Mopidy-MusicBox-Webclient.svg?style=flat
:target: https://pypi.python.org/pypi/Mopidy-MusicBox-Webclient/
:alt: Number of PyPI downloads

With Mopidy MusicBox Webclient, you can play your music on your computer (`Rapsberry Pi <http://www.raspberrypi.org/>`_) and remotely control it using your computer, tablet or phone.

This is a responsive webclient especially written for Mopidy, a music server. Responsive, so it works on desktop and mobile browsers. You can browse, search and play albums, artists, playlists, and it has cover art from Last.fm.

`Mopidy <http://www.mopidy.com/>`_ is a music server which can play music from Spotify, Google Music, SoundCloud, etc or from your hard drive.

If you want to run Mopidy with this webclient on a Raspberry Pi, do yourself a favor and use my custom built SD-image: `Pi MusicBox <http://www.woutervanwijk.nl/pimusicbox/>`_.

.. image:: https://github.com/woutervanwijk/Mopidy-MusicBox-Webclient/raw/master/screenshots/playlists_desktop.png


Installation
============

Install by running::

pip install Mopidy-MusicBox-Webclient


Alternatively, clone the repository and run ``sudo python setup.py install`` from within the project directory. e.g. ::

$ git clone https://github.com/woutervanwijk/Mopidy-MusicBox-Webclient
$ cd Mopidy-MusicBox-Webclient
$ sudo python setup.py install


Usage
=====

Point your (modern) browser at Mopidy-MusicBox-Webclient running on your Mopidy server e.g. http://localhost:6680/musicbox.



Project resources
=================

- `Source code <https://github.com/woutervanwijk/mopidy-musicbox-webclient>`_
- `Issue tracker <https://github.com/woutervanwijk/mopidy-musicbox-webclient/issues>`_
- `Download development snapshot <https://github.com/woutervanwijk/mopidy-musicbox-webclient/archive/master.tar.gz#egg=Mopidy-MusicBox-Webclient-dev>`_


Changelog
=========

v1.0.0
-------------------

- Compatible with Mopidy v0.19
- Made pip installable
- A lot of fixes
- Works with mopidy-websettings extension

v0.1.0 (2013-07-21)
-------------------

- Compatible with Mopidy 0.14+
- More ways to add a song to the Queue (play next, add to bottom, etc)
- Better Queue popup
- Button to clear the Queue
- A bit more speed
- Local files show up in search
- Bugs fixed
- New instructions in the read me
13 changes: 0 additions & 13 deletions changelog

This file was deleted.

29 changes: 29 additions & 0 deletions mopidy_musicbox_webclient/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from __future__ import unicode_literals

import os

from mopidy import config, ext


__version__ = '1.0.0'


class MusicBoxExtension(ext.Extension):

dist_name = 'Mopidy-MusicBox-Webclient'
ext_name = 'musicbox_webclient'
version = __version__

def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)

def get_config_schema(self):
schema = super(MusicBoxExtension, self).get_config_schema()
return schema

def setup(self, registry):
registry.add('http:static', {
'name': self.ext_name,
'path': os.path.join(os.path.dirname(__file__), 'static'),
})
2 changes: 2 additions & 0 deletions mopidy_musicbox_webclient/ext.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[musicbox_webclient]
enabled = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<script type='application/javascript' src='js/fastclick.js'></script>
<script>
//configuration
var wsLocation = location.host.split(':')[0] + ':6680'; //for musicbox configuration and normal operation of mopidy http. remove port from location.host before adding :6680
// var wsLocation = location.host; //for running on port 80

// var wsLocation = location.host + ':6680'; //for musicbox configuration and normal operation of mopidy http
var wsLocation = location.host; //for running on port 80
var isMusicBox = true; //set to true to remove buttons only for musicbox

$(document).bind("mobileinit", function () {
$.extend($.mobile, {
Expand Down Expand Up @@ -101,7 +101,7 @@
<span class="navtxt"> Exit Fullscreen </span><i class="fa fa-desktop"></i></a>
</li>
<li id="navSettings" data-icon="false">
<a href="/Settings">
<a href="/settings">
<span class="navtxt"> Settings </span><i class="fa fa-cog"></i></a>
</li>
<li id="navshutdown" data-icon="false">
Expand Down Expand Up @@ -240,7 +240,7 @@ <h4 id="browsepath"></h4>
<div id="nowPlayingpane" data-role="content" class="pane">


<img id="controlspopupimage" src=""/>
<img id="controlspopupimage" src="images/default_cover.png" />


<div class="nowPlaying-artistInfo">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ function resultsToTables(results, target, uri) {
results[i].name = decodeURI(name[name.length - 1]) || 'Track ' + String(i);
}

//leave out unplayable items
if (results[i].name.substring(0,12) == '[unplayable]') continue;

newalbum.push(results[i]);
nextname = '';
if ((i < length - 1) && results[i+1].album && results[i+1].album.name ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ function setSongInfo(data) {
getCover(artiststext, data.album.name, '#infocover, #controlspopupimage', 'extralarge');
} else {
$("#modalalbum").html('');
$("#infocover").attr('src', './images/default_cover.png');
$("#controlspopupimage").attr('src', '../images/default_cover.png');
$("#infocover").attr('src', '../images/default_cover.png');
$("#controlspopupimage").attr('src', '../images/default_cover.png');
}

$("#modalartist").html(arttmp);
Expand Down Expand Up @@ -435,8 +435,6 @@ $(document).ready(function(event) {
$('.ui-panel-dismiss').on( "tap", function() { $("#panel").panel("close"); } );
//end of workaround



$(window).hashchange();

// Connect to server
Expand Down Expand Up @@ -475,7 +473,6 @@ $(document).ready(function(event) {
resizeMb();
});


//navigation temporary, rewrite this!
$('#songinfo').click(
function()
Expand All @@ -490,7 +487,11 @@ $(document).ready(function(event) {
exitFullscreen();
});


// remove buttons only for MusicBox
if (!isMusicBox) {
$('#navSettings').hide();
$('#navshutdown').hide();
}

//navigation stuff

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@ $(window).load(function() {


function getCover(nwartist, nwalbum, image, size) {
// $(image).attr('src', '../images/default_cover.png');
var defUrl = 'images/default_cover.png';
lastfm.album.getInfo({artist: nwartist, album: nwalbum}, {success: function(data){
for (var i = 0; i < data.album.image.length; i++) {
if ( data.album.image[i]['size'] == size) {
$(image).attr('src', data.album.image[i]['#text']);

$(image).attr('src', data.album.image[i]['#text'] || defUrl);
}
}
}, error: function(code, message){
$(image).attr('src', '../images/default_cover.png');
$(image).attr('src', defUrl);
// console.log('Error #'+code+': '+message);
}});
}
function getArtistImage(nwartist, image, size) {
$(image).attr('src', '../images/user_24x32.png');
var defUrl = 'images/user_24x32.png';
lastfm.artist.getInfo({artist: nwartist}, {success: function(data){
for (var i = 0; i < data.artist.image.length; i++) {
if ( data.artist.image[i]['size'] == size) {
$(image).attr('src', data.artist.image[i]['#text']);
$(image).attr('src', data.artist.image[i]['#text'] || defUrl);
}
}
}, error: function(code, message){
$(image).attr('src', '../images/icons/user_24x32.png');
$(image).attr('src', defUrl);
// console.log('Error #'+code+': '+message);
}});
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ function processBrowseDir(resultArr) {
for (var i = 0; i < browseStack.length; i++) {
child += browseStack[i] + ' / ';
}
*/
child = getMediaHuman(browseStack[0]);
iconClass = getMediaClass(browseStack[0]);
*/
child = getMediaHuman(resultArr[0].uri);
iconClass = getMediaClass(resultArr[0].uri);
$('#browsepath').html('<i class="' + iconClass + '"></i> ' + child);
} else {
$('#browsepath').html('');
Expand Down Expand Up @@ -178,6 +181,7 @@ function processGetPlaylists(resultArr) {
function processGetTracklist(resultArr) {
//cache result
var newplaylisturi = resultArr.uri;
//console.log(resultArr);
playlists[newplaylisturi] = resultArr;
setSongInfo();
resultsToTables(playlists[newplaylisturi].tracks, PLAYLIST_TABLE, newplaylisturi);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[wheel]
universal = 1
43 changes: 43 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from __future__ import unicode_literals

import re

from setuptools import find_packages, setup


def get_version(filename):
content = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
return metadata['version']


setup(
name='Mopidy-MusicBox-Webclient',
version=get_version('mopidy_musicbox_webclient/__init__.py'),
url='https://github.com/woutervanwijk/mopidy-musicbox-webclient',
license='GNU General Public License v3 (GPLv3)',
author='Wouter van Wijk',
author_email='[email protected]',
description='Mopidy MusicBox web extension',
long_description=open('README.rst').read(),
packages=find_packages(),
zip_safe=False,
include_package_data=True,
install_requires=[
'setuptools',
'Mopidy >= 0.19',
],
entry_points={
'mopidy.ext': [
'musicbox = mopidy_musicbox_webclient:MusicBoxExtension',
],
},
classifiers=[
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Topic :: Multimedia :: Sound/Audio :: Players',
],
)
14 changes: 0 additions & 14 deletions webclient/README.md

This file was deleted.

Loading

0 comments on commit e069b98

Please sign in to comment.