Help - Search - Members - Calendar
Full Version: Database Search
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5, 6, 7, 8
foosion
Stable version: 1.3.1
Beta version: 1.4 beta 2
See my 0.9 components page for download links.



Original post follows:

I have made a database search plugin B) (go to the third party plugins topic for details and download link).

I don't think it's perfect yet (search window is not resizable), but it's working. Any comments, problems, suggestions?
Have a look at the configuration page for it contains hints about the usage.
musicmusic
nice:) its working quite well, i used to use album list as my database explorer but now ive got this too smile.gif It is extremely handy for building playlists. the search is also a hella lot faster than the normal playlist search.

bug: (unicode) xp - wierd title.
foosion
QUOTE
bug: (unicode) xp - wierd title.


I guess, I'm setting the window title to an ANSI string. At least this will be easy to fix.
musicmusic
QUOTE(foosion @ Mar 26 2003 - 11:47 PM)
I guess, I'm setting the window title to an ANSI string. At least this will be easy to fix.

Maybe, but it actually displays garbage, sometimes amongst it references to songs in my database, but not the search results. What is it supposed to display?

Also, an option to initially display the entire database would be useful (for me wink.gif )
ssamadhi97
QUOTE(musicmusic @ Mar 27 2003 - 12:57 AM)
sometimes amongst it references to songs in my database, but not the search results.

It actually displays readily formatted playlist entries here every now and then, just for giggles ph34r.gif
Curi0us_George
Damn you. smile.gif I was going to write (err, finish writing) that plugin. biggrin.gif (Actually, I still plan to finish it.)
ssamadhi97
*sniff sniff* a fix'd version must be just around the corner.

ph34r.gif
foosion
QUOTE
What is it supposed to display?


"Database search - x found" substitute x with a number wink.gif

QUOTE
Also, an option to initially display the entire database would be useful (for me  wink.gif )


Not hard to implement, the empty string is contained in all strings tongue.gif but it will be quite slow - that's why I decided to display an empty list.

Btw., you can download the updated version now.

EDIT: If you're interested, you can get the source code (foo_dbsearch.src.zip).

@Curi0us_George: Have you started? What are your ideas for this kind of plugin? I thought about making it more like the albumlist plugin (display-wise), but a listbox was easier to do smile.gif .
Curi0us_George
I hadn't gotten far, honestly. I was having trouble with the database accessing. I finally found some little code snippets which made the database use clearer (it was mostly unclear because I was dead tired the only time I worked on it), but I haven't done anything with it since then.

Here's the reason I want this plugin:
Every time I want to play some files, I open the album list and send everything to the playlist. (And then it auto-plays and I have to hit the stop button). Then I open the playlist search and narrow it down. I basically just want to have a plugin with the playlist search functionality, and the album list buttons.

(I've also considered doing a folder monitoring plugin, but it's not really a priority right now, so I haven't done any work on that at all.)
musicmusic
QUOTE(foosion @ Mar 27 2003 - 12:44 AM)
Btw., you can download the updated version now.

thanks smile.gif

QUOTE
but it will be quite slow


no, still instant smile.gif
anza
QUOTE(musicmusic @ Mar 27 2003 - 07:11 PM)
QUOTE
but it will be quite slow


no, still instant smile.gif

How come everyone keeps on saying this is faster than the playlist search thing? For me at least, this plugin is waaaay slower than the pl-search, which indeed is instant with me. But nice plugin though, I like this smile.gif
musicmusic
QUOTE(anza @ Mar 27 2003 - 05:39 PM)
QUOTE(musicmusic @ Mar 27 2003 - 07:11 PM)
QUOTE
but it will be quite slow


no, still instant smile.gif

How come everyone keeps on saying this is faster than the playlist search thing?

its not really.

in that quote i meant it still loads up instantly, but it is slow if you clear the string subsequently.

when i said it was fast before it wasn't a fair comparison because the playlist search was searching though more than artist/title/album.

after putting the search strings the same, the speed is the same. but for some reason the playlist search is instally slow for me, i.e. when you first enter a character.

edit: ok the new 0.2 version is instant wink.gif
foosion
Get the new version! Search window is now resizable and searching is a bit faster.

Any ideas for improvements (like "Remember window position" - I think that I will add this)?
musicmusic
i just realised the (annoying) search logic. first it would only search one field so i changed "%artist%|%album%|%title%" to "%artist% - %album% - %title%" (i prefer the dashes than just a space)

ok that makes sense. but say artist is "123" and title is "blah (remix)". search for "123 remix" you wont get any results sad.gif

It seems to treat the search as one string, playlist search doesn't behave like this, it will separate the strings at spaces.

Maybe this could be a option?
foosion
QUOTE(musicmusic @ Mar 27 2003 - 08:30 PM)
It seems to treat the search as one string, playlist search doesn't behave like this, it will separate the strings at spaces.

Maybe this could be a option?

blink.gif To be honest, I didn't realize that playlist search behaved like this. I guess this should be changed.

Unluckily, I won't have much time until after the weekend. So if someone else wants to add this, do it. All I ask for, is that you send me your changes, so I can update the official version tongue.gif . Of course you will get credits.

EDIT: reminder: link to source code
Curi0us_George
You just need to tokenize the input. It's going to increase search time, though. You might want to add a "search for exact string" checkbox (checked by default).

P.S. I've gotten fairly far along with my code now. I'm looking at changing the core logic, though. I think I've got a couple of ideas that could drastically speed up searches, but I think the memory overhead might be high.
Curi0us_George
"Damn you Visual Studio!"

I've been searching for a bug for about an hour. For whatever reason, VS wasn't properly linking the most recent versions of some files. A rebuild fixed it. Arg. I couldn't implemented useful things in that hour, instead of inserting debug code everywhere.
anza
The "dedicated display/sorting formatting" strings can't be longer than the box you write them to, would it be possible to fix this?
Curi0us_George
I noticed that the "auto-search" toggle isn't doing anything. (I was comparing the memory use and speed of your plugin compared to mine.) This is with foo_dbsearch 0.4 and foobar2000 0.6b6.
foosion
QUOTE(Curi0us_George @ Apr 3 2003 - 06:12 PM)
I noticed that the "auto-search" toggle isn't doing anything.  (I was comparing the memory use and speed of your plugin compared to mine.)  This is with foo_dbsearch 0.4 and foobar2000 0.6b6.

Also happens with the ANSI version. I was sure it worked before. Expect a fix later.
foosion
[BLAH]
What has started as a simple and lightweight plugin, now evolved into what would more likely be called "geek toy". Yes, that's right, a new version of foo_dbsearch is out, and it rises high above its predecessors in a blinding flash of light! Download it, and unleash its fierce power upon your unsuspecting database! ph34r.gif
[/BLAH]

Sorry, I just had to say this... tongue.gif

A note about the change log: Even it is says that the search sematics have changed, the default display string is set to compensate for that.
I'm waiting for your comments now.
skwire
I'm using the latest Foobar (b7) and the latest DB Search plugin. I love the new, quicker search but I'm having a problem with it. It seems that if I try to close Foobar with the DB Search window visible, Foobar will hang. Can anybody confirm/duplicate this?
Melomane
yes , same problem

win98 se
foobar 0.6 b7
DB Search plugin 0.6 ansi
ssamadhi97
confirmed:

winxp
fb2k0.6b7 nt version + dbsearch unicode
fb2k0.6b7 nt version + dbsearch ansi
fb2k0.6b7 9x version + dbsearch ansi
foosion
Evil deadlock is fixed. Silly me, I thought I could use semaphores for mutual exclusion... concurrency is wonderful. I did not increase the version number, as it was really a tiny change to the source.
skwire
Thanks for the quick fix. =]
Melomane
sorting string not work fine:

copy "display sting" in "sorting string" , "use diplay string for sorting" is not used.
enter query
logically we must obtain the same diplay result, but in reality it is not sorted alphabetical

however the result is correct

sorry for my poor english

win98 se
foobar 0.6 b7
DB Search plugin 0.6 ansi
foosion
QUOTE(Melomane @ Apr 8 2003 - 12:57 PM)
sorting string not work fine:

copy "display sting" in "sorting string" , "use diplay string for sorting" is not used.
enter query
logically we must obtain the same diplay result, but in reality it is not sorted alphabetical

Damn typo caused results not to sorted at all, when "Use display string for sorting" was disabled. sad.gif While greatly improving the speed, this was not the intended behaviour. foo_dbsearch 0.6 update2 does not have this problem, and is now available for download.
Melomane
now your component work fine.

you have only to work at increase speed, correct with my duron 1.1 and my 1000 mpc files, but surement slow with 10000 files and 500 mhz processor...
thank you for your database search
foosion
QUOTE(Melomane @ Apr 8 2003 - 02:49 PM)
you have only to work at increase speed, correct with my duron 1.1 and my 1000 mpc files, but surement slow with 10000 files and 500 mhz processor...
thank you for your database search

foo_dbsearch is very flexible - just think of all the things you can do with separate search/display/sorting strings and the new special fields (show entries that matched all/any words, sort by number of hits, ...). the searching code is also quite simple, which is good for maintenance.
this comes at a price though, and this price is speed...

EDIT: use a separate, but empty sorting string. when you have many entries in the result list, this greatly increases speed laugh.gif
ok, a more practical approach would be to make your formatting strings as simple and short as possible.
Melomane
i love your component!
Heaven17
me too! if you want anything...my house...my car...my sister...just ask!

Seriously, many thanks, you and Curious George keep up the good work. smile.gif
Melomane
foobat 0.6 b11:

ERROR (CORE) : Failed to load DLL: foo_dbsearch.dll, reason: Wrong version number; this component appears to have been built with outdated version of foobar2000 SDK and needs to be recompiled with newer version in order to load; please contact author of this component to obtain an updated version of this component.
Curi0us_George
Peter broke the component compatability apparently, so the version number got bumped up. All the third-party plugins will need to be recompiled against the newest SDK.

edit:
Both Meta Search and (I think) Database Search will need to be re-worked a bit. Some functions were dropped from the new SDK.
apz

idea: add delay before performing a search

with 200gigs of mp3s search on my slowl 1ghz machine it
takes approximatelly 1minute per character, usually I dont
search just for mp3s that have one specific letter/character
so maybe delay the search by a fraction of a second to let
me type rest of the search?

If not that, change so that it starts a search once character
limit is met (ie: 3 chars entered required for minimum
search)


/apz, Life is like an analogy.
anza
Uncheck 'Update search results when query changes' and press enter after you've written the whole thing you're going to search.
foosion
QUOTE(anza @ Apr 13 2003 - 10:17 PM)
Uncheck 'Update search results when query changes' and press enter after you've written the whole thing you're going to search.

That's exactly the right thing to do in this situation. An option to delay the start of the search will not be added.
Melomane
feature request :
use playlist font for database search, or choose font.

it is hard to make ?
Curi0us_George
I don't think there's any way to use the playlist font (or I would have made foo_shizzle do just that), but it's not a big deal to add a selectable font. foosion probably just hasn't gotten around to that yet.
Melomane
if it's not a big deal to add a selectable font...

foosion ?
biggrin.gif
Curi0us_George
Actually, I just remembered something. He's using an owner-drawn list-box, so it might be more trouble. I'm not sure.
foosion
QUOTE(Curi0us_George @ Apr 17 2003 - 11:01 PM)
Actually, I just remembered something.  He's using an owner-drawn list-box, so it might be more trouble.  I'm not sure.

Well, I'm not using an ownerdrawn list box anymore. In fact, official versions of the plugin never had it. It didn't work on XP, do you remember? smile.gif I guess it's not that hard to make the font configurable (there is some helper in the SDK, IIRC). I just don't know when I'll get around to do it, so please be patient. wink.gif
Curi0us_George
Well, just check out the albumlist for a quick, extremely simple example. smile.gif

I guess I misunderstood about the owner-draw listbox. I thought a fixed version of it had made its way into the latest releases.
foosion
QUOTE(Curi0us_George @ Apr 18 2003 - 01:09 AM)
Well, just check out the albumlist for a quick, extremely simple example.  smile.gif

I already knew about this, but thanks for the hint anyway. I will be at my parents' house until Easter Monday, so I won't be working on any fb2k plugin.

QUOTE
I guess I misunderstood about the owner-draw listbox.  I thought a fixed version of it had made its way into the latest releases.

Unfortunately not, but if it had worked, there would probably exist a special version with color codes as an easter egg by now. biggrin.gif
foosion
foo_dbsearch 0.9 public test
Important things first: This version is still for Foobar2000 0.6x. There is no updated documentation, however most of the documentation for foo_dbsearch 0.8 still applies (query syntax, options, ...). The changes are mainly centered around the GUI. So toy with it, and try to break it wink.gif
If anything is unclear, do not hesitate to ask.

download link: foo_dbsearch-0.9.zip

from the change log:
QUOTE
[0.9]
2003-06-26
- upgraded to 0.667 sdk
- added custom list control
- made color codes work in display string
- experimental: enhanced color codes for background color:
  "<text>@<bg>|<sel_text>@<sel_bg>}"
- multiple search domains: integrated are the database and the playlist,
  more possible via plugins
- separated user-defined filter from display string
- removed context menu hack
- renamed %_total_tokens% and %_matched_tokens% special fields to
  %_total_keywords% and %_matched_keywords%
- added configuration for (default) colors
- basic help in configuration (to be enhanced)


@mods: Please move this thread to the 3rd party forum. Thanks.
anza
Not a big issue, but the colors won't change before a restart of foobar. Could this be fixed? smile.gif Otherwise this looks really good, keep up the good work!
ssamadhi97
Can't reproduce, colour changes in the config are applied to the search result window immediately here (fb 0.667, winxp)

Can you please try to describe the problem and what you're doing more accurately?
anza
That's weird, I tried it again and now it works fine ph34r.gif
foosion
Changing the font while the search window was open, did neither redraw the result list nor was the line height updated. Fixed.
Melomane
without contest menu hack , "open directory" isn't useful: can you remove from context menu?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.