Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread:
Post Reply 
[MUSIC] MPD JukeBox (MPDJB)
06-15-2009, 12:17 AM (This post was last modified: 10-28-2013 11:27 PM by joblo10.)
Post: #1
Music [MUSIC] MPD JukeBox (MPDJB)
MPD JukeBox (MPDJB)


EDIT October 28th, 2013
Please visit my Githib page for the code and source code.
https://github.com/jbelanger/MPDJB


This work is highly based on ExtendedGayaExtended. The original application intended to replace the whole Gaya interface while this work focuses only on Music browsing. It is mostly a rework of the original application to integrate Music Player Daemon (MPD) browsing instead of the local filesystem. Big thanks to the previous developers of ExtendedGaya, Delphy, Arjan Mels and GShock and other contributors.

MPDJB is a PHP interface used to browse a MPD music database and to control music playback. It allows to browse your library by folders, artists, albums or genres and to list user-defined playlists.

The music listing is retrieved via MPD commands. It means it relies exclusively on the MPD database instead of the local filesystem. If you add new folders of songs in your library, you will need to update the MPD database to reflect the changes. You can do so either by issuing a “mpc update” or by selecting the "Update Library" option in the configuration page. IMPORTANT: Once the update is completed, you must reload the configuration to see the newly added files. See note for this option below.

Please share your comments/suggestions and report any problems you may find.

Requirements:
* MPD, See this thread: http://www.networkedmediatank.com/showth...?tid=17306
* MyIHome server enabled on your NMT
* FTP service started. Required by the MPD server.

Main features:
* Listen to your music without leaving the user interface;
* Provides options to control most of MPD functionalities;
* Auto-playlists, i.e. ability to play all files in current folder, or add folder to playlist;
* Option to save playlists;
* Setup page to customize the interface, number of items per page, background image …;
* Thumbnail view for albums;
* Dutch, German, French and English localizations for the moment, but more languages can be easily added.
* Both SD and HD templates, although more effort is made on the HD theme.

TVID:
* Play - Toggle pause/play. Play is the same as "mpc play", songs must be present in playlist.
* Next - Play next song
* Stop - Stop Playing
* Title/Url - Add the folder currently selected to the current playlist. Best way to navigate and add songs.
* Delete - In "Now Playing", removes the selected song from the playlist.
* INFO - When a song is playing, INFO will direct to the songinfo page.

Note: I did not implement the "PREV" tvid because that button on the remote is mapped to the "back" function of the browser. I did not want to sacrifice navigation for this. However, if you need the PREV button to go to the last song, this could be easily mapped to another button of the remote.

Screenshots:
Here are some screenshots:

Folder navigation:

[Image: folderview.png]


Album view:

[Image: albumview.png]


Configuration page:

[Image: config.jpg]

Note on the "Reload interface" option above, this is used to reset the PHP session. Sessions are used for two things, first to cache large directory listings. Secondly, it caches the configuration (mpdjb.conf) instead of loading the config at each page refresh.

Now Playing page:

[Image: np_song.png]


Now Playing page with FanArt (Added v1.5):

[Image: new_nowplaying.jpg]


Installation:

IMPORTANT: Be sure to remove the previous version if you installed it by deleting the MPDJB folder. At first run, the main config is cached within a php session located in the tmp subdirectory. If this folder is not deleted, the new config would not be read until the old session expires.

To install, run these lines via telnet:

Code:
cd /share
https://github.com/jbelanger/MPDJB/blob/master/mpdjb-v1.51-20090802.tar.gz -qO - | tar xvz

Then browse to the folder "MPDJB" on your NMT and select index.htm. If you want to change the default location, you only need to edit the file index.htm.

The version that will be installed is precompiled with Turck MMCache. If you want to obtain the source (PHP), you can get it from http://jbelanger.co.cc/nmt/

Uninstallation:
Simply delete the MPDJB folder. No file is modified outside of the application folder.

Changelog:

v1.51
- Corrected problems when adding an album with Title/Url and there a "&" in the album name.
- Added the possiblity to select a remote jsp file by specifying its URL.
- Added German and Dutch translations (provided by FLaSH and ToRrES).
- Default Background image now darker and cropped to 1280*720.
- Re-added script to correct permissions, accidently removed since v1.4.
- Fixed some localizations issues.
- Fixed Album image not always shown in Now Playing page

v1.5
- Template_SD width changed to 620 instead of 625
- Added a SlideShow feature (Look for the new icon in the mini player)
---- The default slideshow folder can be selected in the setup page.
---- The default image directory is /share/Photo.
---- This should be changed to fit your setup. This can be done by adding a new line in mpdjb.conf and by selecting it in the setup page.
---- Images will play randomly, and random won't be in the same order in subsequent launches.
---- Currently, there is no limit on the number of files found. The first time you start this version, a playlist will be generated so it could take longer to load the interface based on the number of files in the selected folder.
- Added sorting by tracks when viewing album listing
- Added song duration labels
- Songs are now labeled "artist-title" in genre listing instead of only the song title.
- Added a list view option for albums.
- Added a new "Switch View" option in the album listing. You can now toggle between different views directly from the main interface.
- When viewing song listings, the maximum number of columns has been reduced to 2 to show titles and songs duration correctly.
- Added browse by letter for the album view.
- Reworked default album view:
---- Decreased the number of items shown from 16 to 14. That way titles can now be displayed correctly.
---- Title will now be truncated correctly. ("..." appended if more than 3 lines)
- If mpd does not have tag info for a song, the file name will be used instead.
- Added a new Now Playing Mode with FanArt.
---- FanArt will be displayed if any images within artist directory are found and if the width of the image is more than 600px. (to avoid including album art)
---- If more than one image is found, a random image is selected.
- Added an option in the setup page to choose between 3 different views for the Now playing page.

v1.4
- Mapping of buttons - Edit mpdjb.conf to change default key mapping. You can also map a button to update the MPD database.
- Removed blank results in artist and album view.
- Added translations for German and Dutch (thanks to FLaSH and ToRrES)
- Added a "Browse by letters" feature

v1.3
- Fixed broken page numbering
- Added German localization (thanks to Flash)
- Added Dutch localization (thanks to ToRrES)
- Added an option to enter a different name for the albumart, defaulted to "folder.jpg"
- Completely new Albumview
- Added an option to choose how many items are shown in the albumview
- Added a log label to view last command sent to MPD
- Added save playlist option in now playing page
- Changed the Now Playing song display at the bottom and added a static progressbar
- Added the INFO TVID, when song playing, pressing INFO will forward to the songinfo page (Now Playing)
- Added more patterns in language files
- Fixed pause showing 0:00 instead of actual time
- Removed automatic sorting when viewing contents of album/artist/playlist
- Added localization to songinfo page

v1.2
- Improvements to the SD version
- Corrected view when numbers of rows/columns are changed, it will now display correctly when row number is changed
- Made interface fonts bigger for both SD and HD theme
- Added an option to update MPD library
- Corrected miniplayer offset in NowPlaying page in the SD theme
- Enlarged Album Art image size in Now Playing page
- Removed item numbers (there was too much elements on the interface and this was causing weird display behavior when too much elements, ie more than 30 items in listing, can now have up to 48 items in listing)
- Added icons to items in listing (to replace line numbers)

v1.1
- Added auto-refresh feature on song change
- Added SD template (edit mpdjb.conf and change hd for sd to enable).
- Added now playing page to show song infos.
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 27 users say Thank You to joblo10 for this post
06-15-2009, 08:37 AM (This post was last modified: 06-15-2009 08:40 AM by AlramEast.)
Post: #2
RE: MPD JukeBox (MPDJB)
Fantastic!

Any chance to get this working through a HTML or CGI file?
Find all posts by this user
Add Thank You Quote this message in a reply
06-15-2009, 10:52 AM
Post: #3
RE: MPD JukeBox (MPDJB)
ahh very nice!! me i like ill give it a try later on

Find all posts by this user
Add Thank You Quote this message in a reply
06-15-2009, 04:20 PM
Post: #4
RE: MPD JukeBox (MPDJB)
Excellent! And already so mature.
Thanks a lot!!
Find all posts by this user
Add Thank You Quote this message in a reply
06-15-2009, 04:46 PM
Post: #5
RE: MPD JukeBox (MPDJB)
Thanks for your effort. I will try it later today. I hope you do not mind me asking the following questions:
  • Does album art need to be embedded with the song itself? Or will it read folder.jpg in the album folder?
  • Since MPD handles FLAC, MPDJB will not have any issues with FLAC either. Is this correct?


Thanks.
Find all posts by this user
Add Thank You Quote this message in a reply
06-15-2009, 04:53 PM
Post: #6
RE: MPD JukeBox (MPDJB)
Interesting, this sounds quite promising.


So not being 100% familiar with MPD, does using this jukebox effect movie playback or anything else at all? Or just music browsing?

Pannasonic Plasma 50" -->HK254-->Emotiva xpa-5 & upa-2
A100 w/ 500gb HDD, A200 w/ mn100, c200 w/ 2.5" 250gb
Calm 2.1, YAMJ - Redefined 1.8a skin, Music Jukebox 8
WHS ex490 w/ 2.5tb's
Find all posts by this user
Add Thank You Quote this message in a reply
06-15-2009, 09:35 PM (This post was last modified: 06-16-2009 03:15 AM by joblo10.)
Post: #7
RE: MPD JukeBox (MPDJB)
(06-15-2009 04:46 PM)6p14pev Wrote:  Thanks for your effort. I will try it later today. I hope you do not mind me asking the following questions:
  • Does album art need to be embedded with the song itself? Or will it read folder.jpg in the album folder?
  • Since MPD handles FLAC, MPDJB will not have any issues with FLAC either. Is this correct?


Thanks.

Hi everyone, thanks for your replies

6p14pev, you asked a good question I should have noted somewhere concerning the album art.. The album view will show album art only if it finds a folder.jpg file in the album folder. I did not find a good way to extract embedded art and preserve reasonable performance.

For FLAC files, you are correct, if MPD plays it, MPDJB will display it and allow you to select it, like other supported media files. Smile

Excal, I only focussed on music browsing (for now) because my primary goal was to provide an interface to MPD and there is already much mature projects for Videos/Movies out there. However, I think it could be easily adapted to provide file browsing to other type of media as well... I stay open to feature requests Wink
Find all posts by this user
Add Thank You Quote this message in a reply
06-16-2009, 01:33 AM
Post: #8
RE: MPD JukeBox (MPDJB)
It looks great! And it's working fine!

Just a few of notes:
- is it possible to make it more usable with a SD (not HD) screen?
- you should add MyiHome to the requirements.

Thanks a lot!

A110 (1.5 TB 3.5" HDD) / A200 (fanless case by moovika, 500 GB 2.5" HDD) / C200 (no HDD, no BD)
Yamaha RX-V3900 - Panasonic TX-P42V10 - B&W CT7.5 + Velodyne CHT-10Q - Logitech Harmony 525
Linksys WRT320N - Netgear GS608 - Fit-PC2 + USB HDD (NFS, SMB, DLNA server) - Synology DS411j
Find all posts by this user
Add Thank You Quote this message in a reply
06-16-2009, 03:03 AM (This post was last modified: 06-16-2009 03:12 AM by joblo10.)
Post: #9
RE: MPD JukeBox (MPDJB)
(06-16-2009 01:33 AM)dooly Wrote:  It looks great! And it's working fine!

Just a few of notes:
- is it possible to make it more usable with a SD (not HD) screen?
- you should add MyiHome to the requirements.

Thanks a lot!

Sure, I would only need to set a new template for the SD theme, it's on my TODO list. Thanks for the reminding, I have added MyIHome to the requirements.
Find all posts by this user
Add Thank You Quote this message in a reply
06-16-2009, 04:53 PM (This post was last modified: 06-16-2009 06:39 PM by s1mp3.)
Post: #10
RE: MPD JukeBox (MPDJB)
Works great Smile

Is there a way to make colored keys on remote useful?

Like to be able to switch between Artist, Albums, Genres and playlist page?

And elapsed track time woud be nice...

Now playing info does not seem to update on track change Sad

Thank you for your great work!

Popcorn Hour A-110 (latest firmware)
NAS IB-4220B (latest firmware)
Find all posts by this user
Add Thank You Quote this message in a reply
06-16-2009, 05:01 PM
Post: #11
RE: MPD JukeBox (MPDJB)
Wow this looks great. Can anyone confirm what happens if there is no folder.jpg in the album folder? Does it just show with a default album art or not at all?

I'm considering attempting to install this, although last time I installed mpd my popcorn hour stopped working directly afterwards with the 00.00.00.00.00 mac address problem and I've only just got it back so don't want to break it again. Seemed a bit coincidental at the time but I've been told that this is just a problem that pops up from time to time with the pch.

Before I was planning on installing the mpd skin for music jukebox but this seems a lot neater.

One more thing, is there an option in the application to update mpd if you add any new files?

Thanks in advance!
Find all posts by this user
Add Thank You Quote this message in a reply
06-17-2009, 05:25 PM
Post: #12
RE: MPD JukeBox (MPDJB)
(06-16-2009 03:03 AM)joblo10 Wrote:  Sure, I would only need to set a new template for the SD theme, it's on my TODO list.
Great! Can't wait! Wink

A110 (1.5 TB 3.5" HDD) / A200 (fanless case by moovika, 500 GB 2.5" HDD) / C200 (no HDD, no BD)
Yamaha RX-V3900 - Panasonic TX-P42V10 - B&W CT7.5 + Velodyne CHT-10Q - Logitech Harmony 525
Linksys WRT320N - Netgear GS608 - Fit-PC2 + USB HDD (NFS, SMB, DLNA server) - Synology DS411j
Find all posts by this user
Add Thank You Quote this message in a reply
06-17-2009, 07:03 PM
Post: #13
RE: MPD JukeBox (MPDJB)
Hi,

Great music app. Thanks

I only have problems to view the album art.
Even when I have a folder.jpg in the right directory it gives me the following error:
Warning is_file(): Stat failed for /opt/sybhttpf/localhost.drives/USB_DRIVE_NTFS3G_A1/Muziek/Mp3/ABBA/Gold Greatest Hits/folder.jpg (emo=13 - Permission denied) in /opt/sybhttpd/localhost.drives/HARD_DISK/lib/dataview.php on line 0

You can see I use a NTFS USB drive. But with Oversight and MJB with MEOW skin I don't have problems. The PCH can read and write to it.

What can be the problem ?
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to sattertje for this post
06-17-2009, 07:33 PM
Post: #14
RE: MPD JukeBox (MPDJB)
(06-16-2009 04:53 PM)s1mp3 Wrote:  Works great Smile

Is there a way to make colored keys on remote useful?

Like to be able to switch between Artist, Albums, Genres and playlist page?

And elapsed track time woud be nice...

Now playing info does not seem to update on track change Sad

Thank you for your great work!

Good idea for the customized buttons, I'll included something in the config page if I can, or it will be in a config file, in our case mpdjb.conf.

Good note on Now Playing, in fact I had already implemented the code to auto-refresh on song changes but I disabled it during my testing. I'll include a function to either chooses to auto-refresh on new song or not.

As for dynamic Javascript operations, like elapsed time, I tried to implement this at first. The problem is that JavaScript performance is horrible. A countdown or elapsed time timer takes the focus at each second and while it is doing it's thing, the rest of the UI is unusable. The consequence of it is that when you move from one link to another, the "cursor" waits takes more time to move. It's acceptable on a page with only a few links to move from/to.

Procky1845, you should see a default icon with a label "Unknown Artist" or "Unknown album". About the option to update directly from the interface, I'll consider adding it as an option in the config page for the next release.

(06-17-2009 07:03 PM)sattertje Wrote:  I only have problems to view the album art.
Even when I have a folder.jpg in the right directory it gives me the following error:
Warning is_file(): Stat failed for /opt/sybhttpf/localhost.drives/USB_DRIVE_NTFS3G_A1/Muziek/Mp3/ABBA/Gold Greatest Hits/folder.jpg (emo=13 - Permission denied) in /opt/sybhttpd/localhost.drives/HARD_DISK/lib/dataview.php on line 0

You can see I use a NTFS USB drive. But with Oversight and MJB with MEOW skin I don't have problems. The PCH can read and write to it.

What can be the problem ?

I never tried from a USB drive, I'm not sure why it has problems. I'll have a look into it, I may PM you if you don't mind.
Find all posts by this user
Add Thank You Quote this message in a reply
06-17-2009, 07:37 PM
Post: #15
RE: MPD JukeBox (MPDJB)
(06-17-2009 07:33 PM)joblo10 Wrote:  Good idea for the customized buttons, I'll included something in the config page if I can, or it will be in a config file, in our case mpdjb.conf.

Good note on Now Playing, in fact I had already implemented the code to auto-refresh on song changes but I disabled it during my testing. I'll include a function to either chooses to auto-refresh on new song or not.

As for dynamic Javascript operations, like elapsed time, I tried to implement this at first. The problem is that JavaScript performance is horrible. A countdown or elapsed time timer takes the focus at each second and while it is doing it's thing, the rest of the UI is unusable. The consequence of it is that when you move from one link to another, the "cursor" waits takes more time to move. It's acceptable on a page with only a few links to move from/to.

Procky1845, you should see a default icon with a label "Unknown Artist" or "Unknown album". About the option to update directly from the interface, I'll consider adding it as an option in the config page for the next release.

(06-17-2009 07:03 PM)sattertje Wrote:  I only have problems to view the album art.
Even when I have a folder.jpg in the right directory it gives me the following error:
Warning is_file(): Stat failed for /opt/sybhttpf/localhost.drives/USB_DRIVE_NTFS3G_A1/Muziek/Mp3/ABBA/Gold Greatest Hits/folder.jpg (emo=13 - Permission denied) in /opt/sybhttpd/localhost.drives/HARD_DISK/lib/dataview.php on line 0

You can see I use a NTFS USB drive. But with Oversight and MJB with MEOW skin I don't have problems. The PCH can read and write to it.

What can be the problem ?

I never tried from a USB drive, I'm not sure why it has problems. I'll have a look into it, I may PM you if you don't mind.

Don't mind, thanks
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Music Video Flow Help agccarmona 8 587 04-02-2014 08:43 PM
Last Post: michael1t
Information [MUSIC] Music Jukebox Release 8 Download and Installation wandidj 1,492 640,370 03-18-2014 10:19 PM
Last Post: yetiboy
  Plex client just stops and returns to jukebox page mendes9 3 624 02-17-2014 02:59 AM
Last Post: halfelite
  Music Jukebox for A300 rd48sec 1 633 02-06-2014 07:28 AM
Last Post: jluc2808
  Music Flow Jukebox 07-12-2011 michael1t 3 3,425 11-12-2013 03:05 PM
Last Post: michael1t
  Basic Jukebox for MP4 metadata sebpinski 0 1,306 08-22-2013 03:27 PM
Last Post: sebpinski
  Movie Flow for All Jukebox 03-21-2013 Updated michael1t 212 83,909 08-14-2013 03:16 PM
Last Post: michael1t
  music jukebox with ipad remote wesley2004 0 1,985 12-26-2012 12:31 AM
Last Post: wesley2004
  What is wrong? music jukebox config help jplinux3 15 5,187 07-23-2012 07:55 AM
Last Post: jluc2808
  Kroozbox- Personal Video Database - PVD (or any DB) and Music Jukebox to Popcorn Hour Nono 383 188,633 07-03-2012 01:52 PM
Last Post: Paul_T

Forum Jump: