Active Topics

 



Notices


Reply
Thread Tools
Posts: 36 | Thanked: 28 times | Joined on Jul 2010
#1
I've created this script that makes a playlist for each folder in your music. This lets you play a folder at a time with the default media player.

Code:
cd ~/MyDocs/.sounds
for i in *; do
  echo Processing $i
  if [ -d "$i" ]; then
    find "$i/" -type f -iname "*.mp3" > "$i.m3u"
  fi
done
This script (and others) can be found on my N900 scripts GitHub project page.

Incidently, git source control is a great way to manage projects on the N900 as you can easily sync to your PC or github.com. You can install git on the N900 with a simple
Code:
apt-get install git
Update: to search for OGG and WMA files as well as MP3s, change the line starting find to (all 1 line):
Code:
find "$i/" -type f  -regex ".*\([mM][pP]3\|[wW][mM][aA]|[oO][oO][gG]\)" > "$i.m3u"

Last edited by dave1010; 2010-07-31 at 14:35. Reason: Added finding OGG and WMA files
 

The Following 8 Users Say Thank You to dave1010 For This Useful Post:
Posts: 69 | Thanked: 7 times | Joined on Nov 2009
#2
thanks dave1010, is there any way to expand the recently added playlist from 30 songs, or possibly to sort the songs in order of date added?
 
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#3
now just pretty UI around it and people will love you instantly
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search
 
Posts: 155 | Thanked: 61 times | Joined on Nov 2009
#4
yep all my n900 stuff is in a github project too

Git rocks.
 
kl2010's Avatar
Posts: 35 | Thanked: 2 times | Joined on Jul 2010 @ lagos, Nigeria
#5
great stuff. tried it and it work fine. my questions is does it automatically make a playlist of any folder i add to the music folder from now on or do i have to run the code everytime i add new music/song/folder to the folder??

thanks. alot.
 
Posts: 292 | Thanked: 131 times | Joined on Dec 2009
#6
Originally Posted by kl2010 View Post
my questions is does it automatically make a playlist of any folder i add to the music folder from now on or do i have to run the code everytime i add new music/song/folder to the folder??
You must run it again when you make changes. However, you could also create a desktop shortcut to make it easier to start.
 
Posts: 36 | Thanked: 28 times | Joined on Jul 2010
#7
Originally Posted by MSHAH View Post
is there any way to expand the recently added playlist from 30 songs, or possibly to sort the songs in order of date added?
Not very easily. I'm using find, which doesn't have any sorting options. You can get all the files modified with a certain number of days:

Code:
cd ~/MyDocs/.sounds
find -mtime -2 -iname "*.mp3" > today.m3u
find -mtime -8 -iname "*.mp3" > this-week.m3u
find -mtime -31 -iname "*.mp3" > this-month.m3u
The busybox find that comes with the N900 seems quite limited. You could install GNU find, which has a few extra options (but still no sorting).

Originally Posted by ossipena View Post
now just pretty UI around it and people will love you instantly
That's a good plan. I don't really know any C/Qt or much Python yet. I'll have to do some learning. Anyone want to help out?

Originally Posted by kl2010 View Post
does it automatically make a playlist of any folder i add to the music folder from now on or do i have to run the code everytime
Unfortunately you have to run it each time you add any new music.

When I have some time I'll look into getting it to run automatically when the Media Player loads and/or a nice GUI. Alternatively, you could save it as a script and make it into a Queen BeeCon Widget quite easily.
 

The Following User Says Thank You to dave1010 For This Useful Post:
Posts: 102 | Thanked: 23 times | Joined on Apr 2010
#8
What to do when I have those scripts in memory card? this script runs only for the internal memory rite
 
Posts: 102 | Thanked: 23 times | Joined on Apr 2010
#9
What to do when I have those scripts in memory card? this script runs only for the internal memory rite
 
Posts: 36 | Thanked: 28 times | Joined on Jul 2010
#10
Originally Posted by leojab View Post
What to do when I have those scripts in memory card? this script runs only for the internal memory rite
That's right. Music is kept in /home/user/MyDocs/.sounds on the 32GB internal flash. (~/ is a shortcut for /home/user/). To do the same on the memory card, change the first line line of the script to:
Code:
cd /media/mmc1
This will scan the whole external memory card for MP3s. If you have a music folder on an external memory card, you could do:
Code:
cd /media/mmc1/music
I haven't tried putting music or playlists on the external memory card, but I guess it works fine.
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:55.