psung/zeya — pull request #1 by Benjamin42 (2011-11-17 13:41:27+00:00)
Title: New features for Zeya

Hello,

First of all, I'd like to thank you for developping Zeya. I use it since 5 months ago, and I really like it : easy to use, light. Zeya is very useful for me for listenning music at work (every streaming website are blocked). But after some months of use, I saw some points which can be improved...that I done. I'll try to explain those with my poor english (i'm french).

The presentation : I have more than 50 artists in my mp3 directory. And some days, I have no idea which one I want listenning. I just want to scroll all the artists easily to find one. The better way, is to construct the list with a hierarchical view : Artist > Album > Title and add the possibility to open / hide

containing a sub-view (like Album witch contains a sub-sub-view Title).

The first work was to unified the id3 tags of the mp3 files. I wrote a python script "rename-id3.py" that renames all the Artist and Album id3 tags (with tagpy) of all the files in a repository. The script gets the artist and the album names through the directories tree : the first directory in the tree is the Artist name, the second, the Album name.
eg :
+ /media/musique/
+ Pink Floyd <- Artist Name
+ Animals <- Album Name
+ Pigs on the wing 1.mp3
+ Dogs.mp3
+ Atom Heart Mother <- Album Name
+ Speak To Me, Breathe.mp3
+ On The Run.mp3

So now, when we have a new song, we have to classified it in good named directories. If we don't do that and if some id3 tag of differents songs are named differently (eg : "Pink Floyd" for one, and "Pinkfloyd" for a second), we'll have 2 differents artists in Zeya. The script can take options (show the --help option for details). Note : This is the first python script I ever wrote, maybe the code may be better.

After the script running, all the musics of an artist are named with an unique name. Then I can change the html 5 presentation in Zeya to classified all the musics and add function to open / close albums and musics of an artist. Because of that, all the functions of creating musics lines (javascript function "render_collection"), playing, or playing next music was rewritted.

Button Repeat / Shuffle :
Repeat is now working. we can repeat a unique song or all the album. 3 states with this button :
- no click -> no repeat (initial state)
- first click -> album repeat
- second click -> song repeat
- third click -> no click -> no repeat (return to initial state)
The (not very beautiful) picture for the song repeating was made by me with modifing the original repeat picture. After developping the repeat button, I had to modify the behaviour of the shuffle button. If the repeat button is in the status "repeat album", the shuffle has to work only in this album. So now, the shuffle don't clean the list but works like the repeat button : it has an influence for the next song.

Themes :
Just for fun, I developped the possibility to change the style of Zeya. The new menu "Option" (close to "Help" menu) was added. You can change the style for the session only or save the choice in the html 5 localStorage. Now, there is only 2 styles : Default and Blue. I apologize about the Blue style pictures. They are coming from JPlayer (http://www.jplayer.org) and are maybe not free. But I can create new free icons for the future for new styles. The styles is only CSS pages in the resources/themes directory. You can add a new theme in this dir, it'll be add automatically to Zeya (the list of themes in the Option menu calls an Ajax function).

Reloading :
In this "Option" menu, I added a button to rebuild the database song from Zeya (without rebooting the Zeya server). I use it when I add a new Artist in the path of Zeya or rename id3 tags with the python script (or not). This button calls an Ajax function.

Searching Forms :
If you use the searching form when Zeya hasn't finished its initialization, you'll have a error page (in version 0.6). But now, until Zeya wasn't ready and hasn't print the list of all the songs, the searching form will be hidden (like the playlist element).

This is the end of the list of all new features I added to Zeya. This is the first time I modify a free software (and the first time I use git and github). If you want or don't want these features, just tell me. Or tell me for bugs or new ideas...etc. It'll be a real pleasure for me answering you.

Benjamin.