Need a fast search method for locating MP3 files.

Booting, installing, newbie
Message
Author
Yogi
Posts: 207
Joined: Fri 19 Aug 2005, 18:50

Need a fast search method for locating MP3 files.

#1 Post by Yogi »

My problem is just that. I have quite a collection of MP3 files in many different folders. Using "Turma find text" to find, for example, all the Beatles songs on both my hard drives could take ten minutes or more. And then when I do find them I can't enqueue them in XMMS. By comparison, Windows "search function" is very intuitive and much, much faster. Plus, I can then play whichever songs it finds. Very simple. Has anyone found a better method?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

install these 2 files (11 kb):
http://dotpups.de/dotpups/System_Utilities/nohup.pup
http://dotpups.de/dotpups/Multimedia/play-mp3.pup

Then run play-mp3 from the Dotpups-menu.
It allows you to enter a search-word like "whatever".
Then it will scan all subfolders in /root for .mp3-files that contains "whatever" in the filename.
When it scanned all folders, it will play the found files with xmms.


To scan other folders than /root, open
/usr/local/play-mp3/play-mp3
in a texteditor, and alter the line
FOLDER=/root
to your needs.

It is not that fast on huge harddisks, but my pup001 is scanned in some seconds without mounted drives.


Please tell me, how it works for you.

Mark

Yogi
Posts: 207
Joined: Fri 19 Aug 2005, 18:50

#3 Post by Yogi »

Thanks for the quick reply Mark. I did have to edit the text (i.e. /mnt/home)to have it search my entire hard drive. It was a very speedy search, 100 GB in about one minute but for some reason it doesn't report any mp3 files. I think this utility has potential though.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#4 Post by MU »

please look, if the filenames use lower case for the .mp3.
I think the script just uses .mp3 , but not .MP3.

I can try to enhance it.
Please help me by doing this:

Naviate in ROX to a folder with some .mp3.
Right-click in ROX -> XTerm here

Now in the opened console enter
pwd

ls -al

Post the output of both comands here (select the text with the mouse, and Middle-click in a forum-message to paste it.

Maybe that gives me a hint.

Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#5 Post by MU »

Oh, before you do that, please look if there is a file /tmp/play-mp3.tmp

If yes, open it with a texteditor.
It should contain the names of the found files.

Do you have that file?

Mark

Yogi
Posts: 207
Joined: Fri 19 Aug 2005, 18:50

#6 Post by Yogi »

MU wrote:

please look if there is a file /tmp/play-mp3.tmp

Yogi:

yes, and it has the files I was looking for. By the way, it is case sensitive. For example, my search for "beatles" revealed nothing. However, "Beatles" found every one. All of my music files are appended as ".mp3" , not "MP3". But I don't know if that really matters.

# pwd
/mnt/hda1/977

ina Grove.mp3
-rwxr-xr-x 1 root root 3552695 Jan 16 12:57 The Doobie Brothers - Li sten To The Music.mp3
-rwxr-xr-x 1 root root 2441762 Jan 16 23:29 The Doobie Brothers - Wh at A Fool Believes.mp3
-rwxr-xr-x 1 root root 2412296 Jan 16 23:15 The Eagles - Desperado.m p3
-rwxr-xr-x 1 root root 3256155 Jan 16 21:40 The Eagles - Life In The Fast Lane.mp3
-rwxr-xr-x 1 root root 3504316 Jan 16 15:46 The Eagles - New Kid In Town.mp3
-rwxr-xr-x 1 root root 3451966 Jan 16 17:01 The Eagles - One Of Thes e Nights.mp3
-rwxr-xr-x 1 root root 2458891 Jan 17 00:39 The Eagles - Take It Eas y.mp3
-rwxr-xr-x 1 root root 3270572 Jan 16 13:49 The Eagles - The Long Ru n.mp3
-rwxr-xr-x 1 root root 3267332 Jan 16 19:48 The Guess Who - Attilla' s Blues.mp3
-rwxr-xr-x 1 root root 1827988 Jan 16 23:36 The Guess Who - Laughing .mp3
-rwxr-xr-x 1 root root 1440433 Jan 16 21:06 The Guess Who - No Sugar Tonight.mp3
-rwxr-xr-x 1 root root 2516605 Jan 17 01:23 The Guess Who - No Time. mp3
-rwxr-xr-x 1 root root 3120943 Jan 16 12:49 The Hollies - Long Cool Woman (In A Black Dress).mp3
-rwxr-xr-x 1 root root 2689295 Jan 16 19:44 The James Gang - Funk #4 9.mp3
-rwxr-xr-x 1 root root 2774872 Jan 16 17:49 The Kinks - Lola.mp3
-rwxr-xr-x 1 root root 1814716 Jan 16 20:41 The Kinks - Tired Of Wai ting For You.mp3
-rwxr-xr-x 1 root root 2816672 Jan 16 22:22 The Knack - My Sharona.m p3

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#7 Post by MU »

ok,
please try this command (2 lines):
playlist=`cat /tmp/play-mp3.tmp`
nohup xmms "$playlist"

Does that give you an error?

Also download the play-mp3.pup again, I had uploaded a new one after some minutes after the first post.

Yogi
Posts: 207
Joined: Fri 19 Aug 2005, 18:50

#8 Post by Yogi »

Pointing ROX to one of the music folders and "Xterm here" with your new commands yields the following:

# playlist='cat/tmp/play-mp3.tmp'
# nohup xmms "$playlist"
nohup: appending output to `nohup.out'

Also, XMMS player opens on the desktop along with X Play Files two-panel navigator. XMMS is empty (no song files showing in the playlist editor).

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#9 Post by MU »

Not ' but `
That's important.

I also just uploaded a new version, that should ignore the case (it finds .mp3 and .MP3).
Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#10 Post by MU »

Here is a tip, how you can search folders spread over different harddisks, without scanning them completely.

Create a folder /root/quickmp3

Now create symlinks to your harddisks.
ln -s "/mnt/hda1/977" "/root/quickmp3/977"
ln -s "/mnt/hda5/whatever" "/root/quickmp3/whatever"

Now in play-mp3, use /root/quickmp3 as the searchfolder.

This should massively increase the searchspeed, because now it ignores for example /mnt/hda1/windows

Mark

Yogi
Posts: 207
Joined: Fri 19 Aug 2005, 18:50

#11 Post by Yogi »

Mark,

Way to go! I re-downloaded both of the dotpups and they work perfectly! I edited /usr/local/play-mp3/play-mp3 to have it search my entire hard drive (120 GB) and it found exactly what I wanted. And the best news is it performed this function in less than five seconds!! Fantastic. XMMS pops up and has all those songs in the playlist and starts playing. This search utility is light years ahead of anything else I've tried, and that includes Windows. Thank you so very much for your efforts.

p.s. I don't know if this utility could be used to find other types of files. If it can that would be great be it is very, very fast!

Thanks again!

Yogi
Posts: 207
Joined: Fri 19 Aug 2005, 18:50

#12 Post by Yogi »

Mark,

I just missed your last reply about using your "tips". My previous post did not use your "tips". It works fine as is. Just edited as such: FOLDER=/mnt/home. That's all it needed.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#13 Post by MU »

I could write a small Gtk-Interface.
Then you could "set up" other filetypes and programs to execute.
But don't know if I can do it today.

Meanwhile you might look at the code, it is quite short, and you simply might replace .mp3 and xmms in it.

:P

turma is slower, because it searches text in textfiles, while my small script just searches in the filenames (not in the files itself).

Mark

Guest

#14 Post by Guest »

OK. Sounds good. This might be something others users would find useful, too. Whether it's another all purpose search utility or even if it is just limited to mp3 files. I know I'll end up using it quite alot just for my music.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#15 Post by MU »


costal martignier
Posts: 198
Joined: Sat 28 Jan 2006, 15:55

#16 Post by costal martignier »

for searching i really like the good old unix tools locate (slocate) and updtedb :)

it's so cool because you can pipe the whole output to what ever you want :)

it's incredible fast and normaly included in every linux distribution...
i took mine from ubuntu in puppy, because they are missed in puppy...


regards
costal

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#17 Post by MU »

My small program uses "find".
it is a bit slower (but still fast in Puppy), but needs no database.

example:
find /root -type f -name *.mp3

Mark

costal martignier
Posts: 198
Joined: Sat 28 Jan 2006, 15:55

#18 Post by costal martignier »

find was allways to cryptic for me, never used it :)

really a shame because i use linux more the 6 years now ;)

:oops: :oops: :oops: :oops:

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#19 Post by MU »

you could create a script "flocate":

Code: Select all

#!/bin/bash
find / -type f -name "$1"
Then it acts like slocate:
flocate *.mp3


But if it searches mounted drives, it may last long.
Instead of "/" I would use a subfolder like /root or /usr

Schnell

costal martignier
Posts: 198
Joined: Sat 28 Jan 2006, 15:55

#20 Post by costal martignier »

many thx, but this is really slow as hell ;)
i can configure updatedb to catalogize everything i need, and it's incredible fast :)

the drawback, a little database file that takes some MB...

i can live with that!

danke dir vielmals :)

bis danndan
costal

Post Reply