Deviation Actions

Jscript library search 1.1

By
A Jscript for JScript Panel v1.1.13+ , foobar2000 panel for CUI or DUI

Using explorer and search music in your library,


Feature:
    - Search library.
    - Explorer by Relative Path,Album, Artist, Genre, User define.
    - Smooth scroll.
    - Quick Search by type in panel.
            + Type string to fast navigation ,
            + Use key  ',' (<) or '.' (>) to fast navigation between it.
    - Navigation by arrow key.



Important note:

    - Change to Jscript9 to improve performance



Update 22/5/2016
 
- Update to run in Jscript Panel
- Auto update library
- Fix display when text overflow
- Improve performance, in my lib 8000+ song, it take about : 
    + < 200 ms to load lib (both folder structure);
    + only 1 -> 3 ms for search.



Update 17/5/2015:

-Add Quick Search(auto scroll )
-Improve performance(about 0.035 ->  0.4 second for my library +75000 song, and no lag)


Update 1/9/2013:

- Copy, Paste, Cut,Undo or Redo in text box with keyboard shortcut.
- Fix some error.

Update 2/9/2013:
- Improve performance.

Update 5/9/2013:
- Improve performance.(Upto 100%)

Update 23/10/2013:
-Fix the panel doesn't redraw when you restore foobar2000 window after a minimize.
Published:
© 2013 - 2021 thanhdat1710
Comments58
Join the community to add your comment. Already a deviant? Log In
Br3tt's avatar
Thanks for the update, i'll test it asap :)
du22y's avatar
Hello!
Help me please to solve problem with "&", it shows like this "_"...
like in this screenshot... She _Him ---> She & Him or She And Him
i.imgur.com/DV8AGPH.png

script
pastebin.com/NMC4CZcD
:)
this is your script with fix:pastebin.com/ne33uPCc.
and this is newest version : pastebin.com/cbD4dTbX.

ps : I think the option DT_WORD_ELLIPSIS(0x00040000) is bad perfomance for draw panel , and this made higher cpu when scroll.

Sorry for bad English.
du22y's avatar
Thanks a lot for the script with fix and a new script;)
DT_WORD_ELLIPSIS -- I've added just for the test and see how it will work, thanks for the hint.

in new script, mouse scroll and font zoom does not work until you comment "//" in line 1162, step/= 120;
:)
Markkoenig's avatar
Ok, I'm gonna pull your sweater once more.

Is there a way to organize the grouping process with $if() conditions? For instance, I have vinyl rips, with tags like this : %album artist% %album% %disc% %totaldiscs% %side% %totalsides%. I can add them to the tree, but it always creates nodes even when there's no %disc% or %side% tag. So it's with or without.

Then I tried to bypass the Properties window and add it directly in one of the grouping presets, as well as my usual first grouping parameter, %genre%.

Problem 1 : 
When I add the %genre% parameter as the first, it only adds a second %artist% node in the tree. But when I give it "case 2", then it appears at the right place, after %artist% and %album%.

pastebin.com/F94e2vAf
               
Problem 2 :
When I add the %disc% and %side% parameters, it still creates empty nodes whenever there's no %disc% or %side% tag.

pastebin.com/7ukj4vCp


I'm not even a beginner in this, but I guess I have to modify something elsewhere. Thanks for the help.
 - For problem 1 : this is script`s bug , and this is fix version : pastebin.com/cbD4dTbX

 - For problem 2 : for empty nodes, i think you can change grouph_property to : 
 ' $caps(%genre%)|$caps($if(%album artist%,%album artist%,Unknow Artist))|$caps($if(%album%,%album%,Unknow Album))$caps($if(%disc%,|Disc %disc%,))$caps($if(%side%,|Side %side%,)) '
instead use switch-case in new version.

Sorry for bad English.
Markkoenig's avatar
Nevermind, it crashes as well.
Markkoenig's avatar
Hmm... it crashes when I configure the library path. Console indicates the error comes from this line :         list = fb.GetLibraryItems();
But when I import the script currently in the skin, and change plman.GetPlaylistItems(pl_idx) to the line above, it doesn't seem to crash at all.
Oh, i`m sorry. new version of script only run on wsh panel with version above 1.5.8.beta1 because fb.GetLibraryItems(), that function help to improve time to load library.
newest version of wsh panel mod : www.hydrogenaud.io/forums/inde…
Markkoenig's avatar
Oh, right, I should have thought of that, I kept the previous to avoid making changes. I'll look into it, thanks.
Sorry , for old version, i have quick fix in two function :

function indexer(){
    ....
   switch(grouph_by){
       .....
       default:
           for(var i = 0;i < total;i++){
                // Change this line
               index_path[i] = fb.TitleFormat(grouph_option).EvalWithMetadb(list.Item(i)).split("|")[0];
           }        
       break;
   }


function get_fol_path(item,lv){
   switch(grouph_by){
       .....
       default:
           // Change this line
           return (fb.TitleFormat(grouph_option).EvalWithMetadb(item).split("|")[lv]) || "aaaaaa";
       break;
   }
}


and change   change grouph_property to 
'
$caps(%genre%)|$caps($if(%album artist%,%album artist%,Unknow Artist))|$caps($if(%album%,%album%,Unknow Album))$caps($if(%disc%,|Disc %disc%,))$caps($if(%side%,|Side %side%,))'
Thank you for this great script! I would like to replace Album List with it and I have a few questions regarding "Group by Path" view:
1. Is it possible to add drag and drop function?
2. How can I hide root folders to show only sub-folders of the music library?
3. It would be great if numbers in brackets show correspondingly the number of sub-folders (artists) in genre folders, the number of albums in artist folders and the number of songs in album folders. Also I've noticed that folders with one artist/album in them haven't got any numbers at all (instead of (1)).

I've took a screenshot and added notes for better explanation: i.imgur.com/sD8NBrc.png
Also I've got this error on some themes (Safe Mode is disabled): i.imgur.com/m3dZkGG.png
1: You can choose music in panel and drop out to play.
2: See this  Photo to solve .
3: I will add that function then.

Thanks you for your feedback.

Sorry for bad English.
Thank you for your quick reply.

1. Yes, I can drag and drop albums to the playlist, but they are always added to the bottom of it. I mean I can't place album in the middle or at the top of the playlist. And with Album List I can do it: i.imgur.com/lcn3Yot.png
2. Works great! Thanks.
3. I would appreciate that. And not just me, I think. This script combines the best features from Album List+Library Tree+Quick Search Toolbar.

Also what about error? I'm trying to add the script to CatRox theme, but no success so far. :(
du22y's avatar

Hello!
Help please to remove the top search string i don't get it how?

And raise the list of folders in place of the search string.
really need any help.;-)
Sorry for my bad English

sorry for delay, this is your need.
pastebin.com/7pnQYm8E
du22y's avatar
Hi ! Yes this is what I need. Thank you very much.;-)
Markkoenig's avatar
I'm really trying to make this work, but the sorting options... I just do not get it. Where are they? Where is the "User" grouping scheme? How do I stop the script from sorting my entire library track by track in different subfolders?
you can right click > preference > properties 

www.flickr.com/photos/vothanhd…
"Add to Playing Playlist" always adds after the first track in the playing playlist, when it should (I would think) at the end of the playing playlist.
I'm a little late with a reply... Thanks! :)
Br3tt's avatar
another problem that you have to resolve (possible, i've fixed it in my mod) is that the panel doesn't redraw when you restore foobar2000 window after a minimize. check, you'll see that a mouse hover is require to enforce a repaint of main area and a click in top box to redraw it too. It's due to that on restore, a repaint() is automatically generated but repaint_main or repaint_f still set to false, so panel stay black on restore :p
yes, i will fix it.
Join the community to add your comment. Already a deviant? Log In