DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2013-04-28 01:48:13

mika123
Member
Registered: 2011-04-20
Posts: 11

[announce] musicco for NAS music streaming

Hi there,
I built a small web music player that works nicely with a DNS-323 with lighttpd, and I thought I'd share it.
If you've used musicbrowser but wanted something a bit faster and that does not require Flash, maybe you can give it a try.

It's called musicco, and you can download it from https://sourceforge.net/projects/musicco/

More information is available at https://musicco.org


Some screenshots follow, and all feedback welcome!

https://musicco.org/img/features/player.png



Changelog
v1.2.2: Quick fix to enable the initial library build to work out of the box

v1.2.1: Compatibility fixes for different versions of Apache / php / sqlite

v1.2: Removed Android client, work on making the player responsive instead, work on database performance and loading of .lrc files as long as they have the same name of the song currently playing. Allow users to upload their own album covers for the currently playing song from the web player. Reorder albums in the current playlist. Allow sharing a link to an album to guest users. New default theme. Improved artist info from Wikipedia. Use auth tokens for logging in instead of credentials. More pattern configuration options for more custom library tree structures. Shift-click previous/next buttons (or shift-use arrow keys) to skip to the next album in the playlist.

v1.1: Android client and under-the-hood improvements to suppport it, added configuration option for cover name and log file, improved playlist panel, fixed download option for administrators in the playlist and the browser panels.

v1.0.3: More elegant management of the Fetch Cover button to provide more information about the cover fetching progress, nicer playlist screen that groups tracks by album. Also upgraded to jplayer 2.4.0/JQuery 2.0.3 and adapted the CSS for better display on mobile screens with a 320x480 resolutions. HTML notifications are working again in this version, and keyboard actions are improved as a result. New feature Uncover! adds 10 random albums to your playlist.

v1.0.2: Fixed minor display bugs introduced by 1.0.1 with z-index management.

v1.0.1: Improved cover management when downloading from cover art provider, added a button to manually fetch a cover, improved artist information panel and added an icon to indicate that some information is still being loaded from the server.

v1.0: initial release

Last edited by mika123 (2016-05-05 00:43:52)

Offline

 

#2 2014-01-14 05:13:37

mc_365
Member
Registered: 2012-10-27
Posts: 17

Re: [announce] musicco for NAS music streaming

I installed your app and almost everything is working for me.  The one thing that I can't get to work is the album art functionality.  None of my folder.jpg or folder.bmp are displaying.  Any suggestions?  My setup is fairly basic since I don't have any other web servers setup on the dns-323.  Even without art it's pretty useful.  The only things I would like to see added would be download ability, and if it is possible .flac support.

Last edited by mc_365 (2014-01-14 05:14:25)

Offline

 

#3 2014-01-14 12:36:59

mika123
Member
Registered: 2011-04-20
Posts: 11

Re: [announce] musicco for NAS music streaming

Hi, glad you like it.


mc_365 wrote:

The only things I would like to see added would be download ability, and if it is possible .flac support.

I'm working on adding more formats, but flac isn't possible because the media player library that is used (http://jplayer.org/) only supports mp3, mp4 (AAC/H.264), ogg (Vorbis/Theora), webm (Vorbis/VP8), wav, rtmp and flv.
Right now I think only .mp3 files are taken into account.


mc_365 wrote:

I installed your app and almost everything is working for me.  The one thing that I can't get to work is the album art functionality.  None of my folder.jpg or folder.bmp are displaying.  Any suggestions?  My setup is fairly basic since I don't have any other web servers setup on the dns-323.  Even without art it's pretty useful.

Yup, that makes sense, the naming convention for your cover art isn't an option yet. Right now, your cover has to be called "cover.*" to be indexed.
You can fix it for your installation by editing two functions in the php file though:

isCover

Code:

   function is_cover($file) {
       return (stripos($file, "cover.") > 0);
   }

Change it to

Code:

   function is_cover($file) {
       return (stripos($file, "folder.") > 0);
   }

and saveCover

Code:

function saveCover(coverURL, path) {
     $.post('?', {saveCover: '', u: coverURL, p: path}, function (response) {
     });    
     for (var i=0; i<musiccoPlaylist.playlist.length; i++) {
          if (musiccoPlaylist.playlist[i].path == path) {
            musiccoPlaylist.playlist[i].poster = path + 'cover.png';
          }
    }
    savePlaylist();
}

Change it to:

Code:

function saveCover(coverURL, path) {
     $.post('?', {saveCover: '', u: coverURL, p: path}, function (response) {
     });    
     for (var i=0; i<musiccoPlaylist.playlist.length; i++) {
          if (musiccoPlaylist.playlist[i].path == path) {
            musiccoPlaylist.playlist[i].poster = path + 'folder.png';
          }
    }
    savePlaylist();
}

and reindex the DB, that should work.

But don't worry, that will definitely be a configuration option in 1.1.

Last edited by mika123 (2014-01-14 12:52:41)

Offline

 

#4 2014-01-15 05:13:06

mc_365
Member
Registered: 2012-10-27
Posts: 17

Re: [announce] musicco for NAS music streaming

awesome, I really just looked at the other musicbrowser thread from a while back and just thought it used the same naming convention for art. After making the suggested changes to the php file all are displaying.

Last edited by mc_365 (2014-01-15 05:13:48)

Offline

 

#5 2014-02-22 16:49:14

mc_365
Member
Registered: 2012-10-27
Posts: 17

Re: [announce] musicco for NAS music streaming

I have been using this for a while now and decided to move everything to my usb drive on my DNS-323 with most of my other software.  I'm having trouble with the symlink of the music folder to the hardrive.  musicco won't build the database from the symlink to the HD.  However I can browse to them fine if I go to the index page.

Ex.
ln -s /mnt/HD_a2/Media/Music music

The "music" directory being located at /mnt/usbstorage/www/pages/musicco/music

I have over 50 Gigs of music in directories by artist/album
Is it something about it being on a different drive or something else I am doing wrong.
Thanks alot

Last edited by mc_365 (2014-02-22 16:49:56)

Offline

 

#6 2014-02-22 17:14:03

mika123
Member
Registered: 2011-04-20
Posts: 11

Re: [announce] musicco for NAS music streaming

mc_365 wrote:

The "music" directory being located at /mnt/usbstorage/www/pages/musicco/music

Is it something about it being on a different drive or something else I am doing wrong.
Thanks alot

Hi,
I'm guessing it has got something to do with permissions, but it's tricky to tell what exactly.
Actually, I'm not sure I understood the problem correctly: reading files from the web UI works but indexing the DB does not? Are you indexing from the command line or from the web UI?

Some things I'd check anyway:

1. who owns /mnt/HD_a2/Media/Music? Who has read access to it? (the user running the web server needs read access, so does the user running the php process from the command line)
2. Who is the owner of library.db? Maybe a run from the command line made the file unreadable for other users? You can always try to delete it and reindex from the web UI to make sure it is created in a reusable way.
3. Is there something in the web server configuration that restricts access to files via a symlink (there is a server.follow-symlink option, and maybe check this thread to see if it helps: http://redmine.lighttpd.net/boards/2/topics/4356)

Can't really think of anything else. Can you check your lighttpd logs, there should be some details about what exactly is failing...

Offline

 

#7 2014-02-22 17:39:52

mc_365
Member
Registered: 2012-10-27
Posts: 17

Re: [announce] musicco for NAS music streaming

What I meant was, from "http://192.168.1.99:8080/music/" I can see all of my music.
When I update the library the library.db is empty when using symlink form the HD_a2 to usbstorage.
When the entire directory for musicco was on HD_a2 the symlinks to my music directory worked without issue.
The only thing I have done is move the musicco directory to the usbstorage and pointed my lighttpd.ini to the new server root.
I've never run any musicco commands from the cmd line I will check on this.

Last edited by mc_365 (2014-02-22 18:51:02)

Offline

 

#8 2014-02-22 17:47:29

mika123
Member
Registered: 2011-04-20
Posts: 11

Re: [announce] musicco for NAS music streaming

mc_365 wrote:

The only thing I have done is move the musicco directory to the usbstorage and pointed my lighttpd.ini to the new server root.
I've never run any musicco commands from the cmd line I will check on this.

Hmmm... ok, I understand the problem at least.
I don't think running php from the command line is going to change anything, but check the lighttpd logs to see if there is anything useful in there.
I'll let you know if I have other ideas...


Edit: out of ideas, I ran a quick test with a music folder on disk 1 that symlinks to disk 2 and that worked fine here.
So it looks like it is something specific in the fact that you are running from usb (never tried that).

Last edited by mika123 (2014-02-22 18:16:07)

Offline

 

#9 2014-02-22 18:56:08

mc_365
Member
Registered: 2012-10-27
Posts: 17

Re: [announce] musicco for NAS music streaming

Thanks for getting back to me.
In any event I will just keep digging, I'm not that versed in linux or programming but I like to poke around.  I find stuff like this it to be good mental exercise.

Keep up the good work.

Offline

 

#10 2014-02-22 22:12:55

mc_365
Member
Registered: 2012-10-27
Posts: 17

Re: [announce] musicco for NAS music streaming

Ok seems like the problem is when I link all files.  If I just link one artist directory everything works fine.  When I link the entire music collection it fails.  Disk space on the USB drive shows 27GB available and I'm only using symlinks so it should not use much disk space?


Edit: After more digging, it seems that if I link a few folders at a time then update the library everything works fine.
Lacking the deep understanding of the coding involved, Linux, etc. I'm believing that something is timing out before the library is finished updating as the Web Ui never finishes "refreshing library" when I update from 0 music symlinks to my entire collection, but when I do 5 - 10 folders at a time then update all seems well.  I will continue and see if it breaks.

Last edited by mc_365 (2014-02-22 22:43:42)

Offline

 

#11 2014-02-23 01:40:05

mc_365
Member
Registered: 2012-10-27
Posts: 17

Re: [announce] musicco for NAS music streaming

OK, I found "MY Problem" and I feel so silly.

I inadvertently created a symlink of my root Music directory within the root Music directory, so I guess it caused musicco to go into a loop or something when it tried to update the database.

Wow, command line is so powerful and dangerous.

Thanks again for even responding, and sorry for the false alarm.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB