Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: [fb2k v2] SQL Tree (foo_uie_sql_tree) (Read 137909 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_uie_sql_tree

Reply #50
thanks both tipps worked like a charm, do you know a good online documentation for sqlite, I would like to know the difference between '%string%' and 'string'
but if I use is to exclude all with soundtrack it doesn't work just to add != 'string' to the query, I really need to increase my sql skills  this is a great component to add additional organization in fb2k, thanks

btw small issue, the scrollbars are not add the borders of the window, there slightly (2px) inward

//Update
Nevermind
Code: [Select]
WHERE genre_mv != 'soundtrack' AND genre NOT LIKE '%soundtrack%'

this did trick

foo_uie_sql_tree

Reply #51
and after a few hours of testing the possibility to move queries in another folder would be great and maybe an autorefresh on startup for the queries with sub content

foo_uie_sql_tree

Reply #52
okay found the option for the refresh :| I just like to nag

foo_uie_sql_tree

Reply #53
Superb component... an everything-in-one library viewer.
Drag-and-drop folder/query re-organization in the tree view would be very useful.


foo_uie_sql_tree

Reply #55
Code: [Select]
SELECT round(avg(rating),2) as rating, artist, album
    FROM medialibrary
GROUP BY album,artist
ORDER BY rating DESC


There's a small problem here relating to the queries generated for the rating child nodes in the tree.
The code generates a WHERE clause for the select parameter, e.g.
Code: [Select]
SELECT MetaDb_Handle
FROM medialibrary
WHERE CAST(round(avg(rating),2) AS TEXT) = '4.0'
ORDER BY rating DESC

... which gives an SQL error
Code: [Select]
SQLite Error: (1) misuse of aggregate function avg()


When the top-level SELECT uses an aggregate function, a GROUP BY / HAVING clause is needed for the SQL to be valid.

foo_uie_sql_tree

Reply #56
It's mentioned in the documentation

foo_uie_sql_tree

Reply #57
It's mentioned in the documentation


I see. Is there an option to suppress generation of the child nodes for a particular query? It would be useful for queries like this.

On a different note, might it be possible to add a configurable click-action that sends the selection to a new playlist that's automatically named according to the query node (or chain of nodes)? I always create new playlists for groups of tracks I'm about to queue for playback... I suspect others may use foobar like this, too.

foo_uie_sql_tree

Reply #58
Perhaps something like:
Code: [Select]
  SELECT q.rating, q.artist, q.album
    FROM (SELECT MetaDb_Handle, artist, album, round(avg(rating),2) as rating
            FROM medialibrary
        GROUP BY artist) AS q
ORDER BY q.rating DESC
HTH.

Alessandro

[Edit]Scratch that, sorry. Can't work.

foo_uie_sql_tree

Reply #59
Hello fbuser,

i tried, to use your component, the installation seemed to succeed.
After restarting fb, SQL Tree was listed in the "Installed components", but ALL preference pages only showed "Please select a subpage".
When i closed fb, it(fb) crashed.

I run fb in linux with wine.
I tried many components and all of them (even wsh-panel_mod and foo_upnp) are working like a charm.

I started fb in a terminal, and searched for messages, which could give a hint, but could'nt find any usefull output.

I want to find out, if there is a chance, to use your component in a linux/wine-environment.

So my questions are:
Does your component use any undocumented windows-functions?
If true, there will be no chance, to use it in wine-environment.

Does your component use any other dll's in /system32 ?
If true, there might be a chance, because i can replace the "faked wine dll's" with native ones register them and tell wine, to use them.
I did it this way for wsh-panel_mod and it works.

I took a quick look at your component in a Windows-environment and think it's superb.
But, as i have no windows by my own, i would be very happy, if you could give some guidance, to use it in linux/wine.

foo_uie_sql_tree

Reply #60
You know, this is maybe a CRAZY idea....

....but any chance of some screenshots?   

Keen to see what this plugin looks like / what it can do!

foo_uie_sql_tree

Reply #61
After restarting fb, SQL Tree was listed in the "Installed components", but ALL preference pages only showed "Please select a subpage".
I doubt, that this has something to do with SQL Tree in the first place, when all preference pages are displayed wrongly. It looks for me more like a general problem.
Does your component use any undocumented windows-functions?
No.
Does your component use any other dll's in /system32 ?
No.




foo_uie_sql_tree

Reply #63
Lol....thanks.

But still...

foo_uie_sql_tree

Reply #64
After restarting fb, SQL Tree was listed in the "Installed components", but ALL preference pages only showed "Please select a subpage".
I doubt, that this has something to do with SQL Tree in the first place, when all preference pages are displayed wrongly. It looks for me more like a general problem.
sorry, "ALL preference pages" meant "ALL SQL Tree preference pages"

To clarify this, i copied the complete fb-portable-Install from my Linux-machine to an USB-Disk an ran it on a WIN-XP-SP2-machine......no crash anymore, everything's OK there.
So it's a wine issue and i will post the bug to the wine-devs. To make their live easier, i made a fresh fb-install with CUI and SQL tree as the only components.
As expected, closing fb ends in a crash with following report.

Code: [Select]
Illegal operation:
Code: E06D7363h, flags: 00000001h, address: 7B839672h
Additional parameters: 19930520h 0033F7F4h 00584A04h
Message: Invalid path syntax
Last win32 error: 123

Call path:
entry=>initquit::on_quit=>filesystem::g_get_stats


Code bytes (7B839672h):
7B839632h:  60 8B 45 0C 8B 55 14 8B 75 08 8B 4D 10 83 E0 01
7B839642h:  89 45 AC 85 D2 8B 83 B8 FF FF FF 89 75 A8 C7 45
7B839652h:  B0 00 00 00 00 89 45 B4 74 04 85 C9 75 20 C7 45
7B839662h:  B8 00 00 00 00 8D 45 A8 89 04 24 E8 B6 CA FE FF
7B839672h:  83 EC 04 8D 65 F8 5B 5E 5D C2 10 00 66 90 83 F9
7B839682h:  0F B8 0F 00 00 00 0F 46 C1 89 45 B8 8D 4D BC C1
7B839692h:  E0 02 89 44 24 08 89 54 24 04 89 0C 24 E8 BC 4F
7B8396A2h:  FE FF EB C1 8D 76 00 8D BC 27 00 00 00 00 55 89

Stack (0033F6F4h):
0033F6D4h:  0033F7A8 00000001 0033F758 7BC71D58
0033F6E4h:  00000001 000028D8 7B839672 0033F700
0033F6F4h:  0033F784 0000000C 7BC46913 E06D7363
0033F704h:  00000001 00000000 7B839672 00000003
0033F714h:  19930520 0033F7F4 00584A04 7BC4773D
0033F724h:  00110000 00000002 7BC3511F 0033F7D0
0033F734h:  7BC48082 0092B060 7BCA6FF4 00110000
0033F744h:  7BCA6FF4 0033F7A8 7B83962A 00000000
0033F754h:  00932528 0033F790 0053E330 E06D7363
0033F764h:  00000001 00000003 0033F784 E06D7363
0033F774h:  00000001 00000000 00000000 00000003
0033F784h:  19930520 0033F7F4 00584A04 0033F884
0033F794h:  0052E42E 0033F7F4 00584A04 00932528
0033F7A4h:  0033F898 005803B4 000000B8 00000088
0033F7B4h:  0092B000 0092B000 7BC3511F 7BC3511F
0033F7C4h:  7B894FF4 0033F878 7BCA6FF4 7BCA6FF4
0033F7D4h:  0092B000 7BCA6FF4 0033F83C 7BC472E3
0033F7E4h:  0092B060 0092B000 00930A58 0033F820
0033F7F4h:  00580534 005803B4 C0000000 7BC4781A
0033F804h:  7BC479FD 009325E0 00932520 00000000

Registers:
EAX: 7B82612D, EBX: 7B894FF4, ECX: 00000000, EDX: E06D7363
ESI: E06D7363, EDI: 0033F8C0, EBP: 0033F758, ESP: 0033F6F4

Crash location:
Module: kernel32
Offset: 29672h
Symbol: "RaiseException" (+52h)

Loaded modules:
msimg32                          loaded at 69680000h - 6968E000h
foo_ui_std                      loaded at 014A0000h - 015B9000h
foo_input_std                    loaded at 01220000h - 01390000h
foo_uie_sql_tree                loaded at 00FE0000h - 0110A000h
usp10                            loaded at 69650000h - 6967A000h
mpr                              loaded at 69620000h - 69642000h
wininet                          loaded at 695C0000h - 6961C000h
urlmon                          loaded at 7BD30000h - 7BD94000h
foo_ui_columns                  loaded at 00D40000h - 00ED0000h
winealsa                        loaded at 694A0000h - 694BD000h
mmdevapi                        loaded at 69470000h - 69492000h
imm32                            loaded at 6F4B0000h - 6F4C6000h
winex11                          loaded at 68EF0000h - 68F84000h
crypt32                          loaded at 775F0000h - 7768B000h
ws2_32                          loaded at 71CC0000h - 71CEF000h
iphlpapi                        loaded at 6AED0000h - 6AEF0000h
netapi32                        loaded at 68E20000h - 68E47000h
secur32                          loaded at 68E00000h - 68E1C000h
oleaut32                        loaded at 68D10000h - 68DF0000h
gdiplus                          loaded at 68CA0000h - 68CFE000h
winspool                        loaded at 68C60000h - 68C8A000h
comdlg32                        loaded at 68B70000h - 68C50000h
psapi                            loaded at 68B60000h - 68B6E000h
dbghelp                          loaded at 68B00000h - 68B5A000h
imagehlp                        loaded at 737C0000h - 737CF000h
shared                          loaded at 10000000h - 1002B000h
msvcrt                          loaded at 711A0000h - 7121C000h
zlib1                            loaded at 5A4C0000h - 5A4D4000h
shell32                          loaded at 688F0000h - 68AFD000h
uxtheme                          loaded at 6FCD0000h - 6FCF4000h
shlwapi                          loaded at 68890000h - 688E7000h
msacm32                          loaded at 68860000h - 6887D000h
rpcrt4                          loaded at 687F0000h - 68855000h
ole32                            loaded at 686F0000h - 687DF000h
winmm                            loaded at 68640000h - 686D8000h
dsound                          loaded at 685F0000h - 68633000h
version                          loaded at 685E0000h - 685EE000h
advapi32                        loaded at 68580000h - 685D5000h
gdi32                            loaded at 6D1A0000h - 6D24B000h
user32                          loaded at 68450000h - 68575000h
comctl32                        loaded at 68350000h - 68435000h
kernel32                        loaded at 7B810000h - 7B9B7000h
ntdll                            loaded at 7BC10000h - 7BCC3000h
foobar2000                      loaded at 00400000h - 005FB000h

Stack dump analysis:
Address: 7BC46913h (ntdll+36913h), symbol: "HEAP_MakeInUseBlockFree" (+C3h)
Address: 7B839672h (kernel32+29672h), symbol: "RaiseException" (+52h)
Address: 00584A04h (foobar2000+184A04h)
Address: 7BC4773Dh (ntdll+3773Dh), symbol: "HEAP_FindFreeBlock" (+Dh)
Address: 7BC3511Fh (ntdll+2511Fh), symbol: "RtlLeaveCriticalSection" (+Fh)
Address: 7BC48082h (ntdll+38082h), symbol: "RtlReAllocateHeap" (+2D2h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7B83962Ah (kernel32+2962Ah), symbol: "RaiseException" (+Ah)
Address: 0053E330h (foobar2000+13E330h)
Address: 00584A04h (foobar2000+184A04h)
Address: 0052E42Eh (foobar2000+12E42Eh)
Address: 00584A04h (foobar2000+184A04h)
Address: 005803B4h (foobar2000+1803B4h)
Address: 7BC3511Fh (ntdll+2511Fh), symbol: "RtlLeaveCriticalSection" (+Fh)
Address: 7BC3511Fh (ntdll+2511Fh), symbol: "RtlLeaveCriticalSection" (+Fh)
Address: 7B894FF4h (kernel32+84FF4h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BC472E3h (ntdll+372E3h), symbol: "RtlFreeHeap" (+173h)
Address: 00580534h (foobar2000+180534h)
Address: 005803B4h (foobar2000+1803B4h)
Address: 7BC4781Ah (ntdll+3781Ah), symbol: "HEAP_FindFreeBlock" (+EAh)
Address: 7BC479FDh (ntdll+379FDh), symbol: "RtlAllocateHeap" (+Dh)
Address: 00539E2Ch (foobar2000+139E2Ch)
Address: 00539D72h (foobar2000+139D72h)
Address: 00402B45h (foobar2000+2B45h)
Address: 00521497h (foobar2000+121497h)
Address: 00402C9Fh (foobar2000+2C9Fh)
Address: 0044ACEBh (foobar2000+4ACEBh)
Address: 00570E20h (foobar2000+170E20h)
Address: 010A8B98h (foo_uie_sql_tree+C8B98h)
Address: 005546A0h (foobar2000+1546A0h)
Address: 0044B65Eh (foobar2000+4B65Eh)
Address: 0100807Dh (foo_uie_sql_tree+2807Dh)
Address: 005A67D8h (foobar2000+1A67D8h)
Address: 010A7253h (foo_uie_sql_tree+C7253h)
Address: 01007FB4h (foo_uie_sql_tree+27FB4h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 010A725Dh (foo_uie_sql_tree+C725Dh)
Address: 0100E8F4h (foo_uie_sql_tree+2E8F4h)
Address: 010B7DD8h (foo_uie_sql_tree+D7DD8h)
Address: 7BC479FDh (ntdll+379FDh), symbol: "RtlAllocateHeap" (+Dh)
Address: 010963C5h (foo_uie_sql_tree+B63C5h)
Address: 00FE85F0h (foo_uie_sql_tree+85F0h)
Address: 00FE8599h (foo_uie_sql_tree+8599h)
Address: 010B8A88h (foo_uie_sql_tree+D8A88h)
Address: 01096120h (foo_uie_sql_tree+B6120h)
Address: 00FE869Fh (foo_uie_sql_tree+869Fh)
Address: 00FE871Ah (foo_uie_sql_tree+871Ah)
Address: 010AE64Fh (foo_uie_sql_tree+CE64Fh)
Address: 00FE5242h (foo_uie_sql_tree+5242h)
Address: 010BB03Ch (foo_uie_sql_tree+DB03Ch)
Address: 010BB790h (foo_uie_sql_tree+DB790h)
Address: 0054F308h (foobar2000+14F308h)
Address: 7BC3511Fh (ntdll+2511Fh), symbol: "RtlLeaveCriticalSection" (+Fh)
Address: 00402DADh (foobar2000+2DADh)
Address: 00590414h (foobar2000+190414h)
Address: 010B7DD8h (foo_uie_sql_tree+D7DD8h)
Address: 010B7DD8h (foo_uie_sql_tree+D7DD8h)
Address: 014A713Ch (foo_ui_std+713Ch)
Address: 010AE6CAh (foo_uie_sql_tree+CE6CAh)
Address: 00FE972Ah (foo_uie_sql_tree+972Ah)
Address: 010DABD0h (foo_uie_sql_tree+FABD0h)
Address: 010BB03Ch (foo_uie_sql_tree+DB03Ch)
Address: 010BB790h (foo_uie_sql_tree+DB790h)
Address: 0150455Ch (foo_ui_std+6455Ch)
Address: 010B7DD8h (foo_uie_sql_tree+D7DD8h)
Address: 0047D7C5h (foobar2000+7D7C5h)
Address: 0042F448h (foobar2000+2F448h)
Address: 004BC938h (foobar2000+BC938h)
Address: 00FEA0E5h (foo_uie_sql_tree+A0E5h)
Address: 0042F448h (foobar2000+2F448h)
Address: 010AE861h (foo_uie_sql_tree+CE861h)
Address: 0046E5FAh (foobar2000+6E5FAh)
Address: 010DABD0h (foo_uie_sql_tree+FABD0h)
Address: 0054BF99h (foobar2000+14BF99h)
Address: 0046FBB9h (foobar2000+6FBB9h)
Address: 0053B4B5h (foobar2000+13B4B5h)
Address: 6D1B8E0Ah (gdi32+18E0Ah), symbol: "nulldrv_RestoreDC" (+49Ah)
Address: 6D234FF4h (gdi32+94FF4h)
Address: 00570E20h (foobar2000+170E20h)
Address: 00570E20h (foobar2000+170E20h)
Address: 7BC46913h (ntdll+36913h), symbol: "HEAP_MakeInUseBlockFree" (+C3h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 0057FD04h (foobar2000+17FD04h)
Address: 0057FCE8h (foobar2000+17FCE8h)
Address: 7BC47C36h (ntdll+37C36h), symbol: "RtlAllocateHeap" (+246h)
Address: 7BC464ABh (ntdll+364ABh), symbol: "validate_block_pointer" (+2Bh)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BC3511Fh (ntdll+2511Fh), symbol: "RtlLeaveCriticalSection" (+Fh)
Address: 7BC3511Fh (ntdll+2511Fh), symbol: "RtlLeaveCriticalSection" (+Fh)
Address: 00539E2Ch (foobar2000+139E2Ch)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 00540996h (foobar2000+140996h)
Address: 0053DE20h (foobar2000+13DE20h)
Address: 00540996h (foobar2000+140996h)
Address: 0053E6B8h (foobar2000+13E6B8h)
Address: 0053B4B5h (foobar2000+13B4B5h)
Address: 0055BCDBh (foobar2000+15BCDBh)
Address: 100027D8h (shared+27D8h)
Address: 00575C44h (foobar2000+175C44h)
Address: 0053B4B5h (foobar2000+13B4B5h)
Address: 1000281Eh (shared+281Eh)
Address: 00575C44h (foobar2000+175C44h)
Address: 0046FD2Dh (foobar2000+6FD2Dh)
Address: 00400000h (foobar2000+0h)
Address: 0053B4B5h (foobar2000+13B4B5h)
Address: 7B894FF4h (kernel32+84FF4h)
Address: 00543B27h (foobar2000+143B27h)
Address: 005AB400h (foobar2000+1AB400h)
Address: 0053D62Ah (foobar2000+13D62Ah)
Address: 0053A0FEh (foobar2000+13A0FEh)
Address: 0053A0F8h (foobar2000+13A0F8h)
Address: 005677D4h (foobar2000+1677D4h)
Address: 005677D8h (foobar2000+1677D8h)
Address: 7B894FF4h (kernel32+84FF4h)
Address: 00564471h (foobar2000+164471h)
Address: 0053DE20h (foobar2000+13DE20h)
Address: 0053A0F8h (foobar2000+13A0F8h)
Address: 0055BF5Dh (foobar2000+15BF5Dh)
Address: 0053B462h (foobar2000+13B462h)
Address: 00400000h (foobar2000+0h)
Address: 0053B4B5h (foobar2000+13B4B5h)
Address: 7B894FF4h (kernel32+84FF4h)
Address: 0053DE20h (foobar2000+13DE20h)
Address: 7B85961Ch (kernel32+4961Ch), symbol: "call_process_entry" (+Ch)
Address: 7BC4BD3Ah (ntdll+3BD3Ah), symbol: "RtlImageNtHeader" (+Ah)
Address: 7B894FF4h (kernel32+84FF4h)
Address: 7B85A88Fh (kernel32+4A88Fh), symbol: "start_process" (+5Fh)
Address: 0053B4B5h (foobar2000+13B4B5h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BC71D90h (ntdll+61D90h), symbol: "call_thread_func_wrapper" (+Ch)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BC7484Dh (ntdll+6484Dh), symbol: "call_thread_func" (+7Dh)
Address: 7B85A830h (kernel32+4A830h), symbol: "start_process" (+0h)
Address: 7BC89300h (ntdll+79300h), symbol: "__wine_exception_handler" (+0h)
Address: 7B8396B0h (kernel32+296B0h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 7BCA6FF4h (ntdll+96FF4h)
Address: 7BC747D9h (ntdll+647D9h), symbol: "call_thread_func" (+9h)
Address: 6814DFF4h (libwine.so.1+12DFF4h)
Address: 7BC71D6Eh (ntdll+61D6Eh), symbol: "RtlRaiseException" (+22h)
Address: 7B85A830h (kernel32+4A830h), symbol: "start_process" (+0h)
Address: 6814DFF4h (libwine.so.1+12DFF4h)
Address: 7BC49F3Eh (ntdll+39F3Eh)
Address: 7B85A830h (kernel32+4A830h), symbol: "start_process" (+0h)
Address: 680296ADh (libwine.so.1+96ADh), symbol: "wine_call_on_stack" (+1Dh)
Address: 7B85A830h (kernel32+4A830h), symbol: "start_process" (+0h)
Address: 01000000h (foo_uie_sql_tree+20000h)
Address: 01000000h (foo_uie_sql_tree+20000h)
Address: 01000000h (foo_uie_sql_tree+20000h)
Address: 01000000h (foo_uie_sql_tree+20000h)
Address: 01000000h (foo_uie_sql_tree+20000h)
Address: 01000000h (foo_uie_sql_tree+20000h)
Address: 01000000h (foo_uie_sql_tree+20000h)
Address: 681A1311h (libc.so.6+24311h)

Environment:
App: foobar2000 v1.1.10
OS: wine-1.3.36, on: Linux / 3.0.0-14-generic
CPU: Intel® Pentium® M processor 1700MHz, features: MMX SSE SSE2
Audio: default; Intel 82801DB-ICH4 - Intel 82801DB-ICH4; Intel 82801DB-ICH4 - Intel 82801DB-ICH4 - IEC958
UI: Columns UI 0.3.8.8

Components:
Core (2011-12-02 15:07:36 UTC)
    foobar2000 core 1.1.10
foo_input_std.dll (2011-12-02 15:05:54 UTC)
    Standard Input Array 1.0
foo_ui_columns.dll (2012-01-15 08:27:12 UTC)
    Columns UI 0.3.8.8
foo_ui_std.dll (2011-12-02 15:06:24 UTC)
    Default User Interface 0.9.5
foo_uie_sql_tree.dll (2012-01-15 08:31:40 UTC)
    SQL Tree 1.0.2

Recent events:
Watching: C:\users\me\Eigene Musik
Startup time : 0:00.836293
Shutting down...

Is there any additional advice from you i can forward to the wine-devs ?

foo_uie_sql_tree

Reply #65
sorry, "ALL preference pages" meant "ALL SQL Tree preference pages"
That is strange. The preference pages are integrated straight forward via implementing some interfaces. If there was something wrong with the implementation, I would expect, that it fails either on each platform or not at all.

Code: [Select]
Illegal operation:
Code: E06D7363h, flags: 00000001h, address: 7B839672h
Additional parameters: 19930520h 0033F7F4h 00584A04h
Message: Invalid path syntax
Last win32 error: 123

Call path:
entry=>initquit::on_quit=>filesystem::g_get_stats
Is there any additional advice from you i can forward to the wine-devs ?
I can only guess here. The function filesystem::g_get_stats is not called directly from SQL Tree. However, it is called indeed indirectly in initquit:on_quit. A check, if the database file exists is possibly done here, where the file name is an URL of the form: file:///<path to configuration directory>/foo_uie_sql_tree.db. But if the crash is really related to this, I would expect it already on program start, as the metionend check is actually done there and should not be done anymore on program shut down.

Anyway, I uploaded a new version of SQL Tree, which removes an additional parameter from the URL, which is actually not needed for checking the existence of the database file. Maybe this helps.

 

foo_uie_sql_tree

Reply #66
Anyway, I uploaded a new version of SQL Tree, which removes an additional parameter from the URL, which is actually not needed for checking the existence of the database file. Maybe this helps.

Yea, it does!!!
Thanx a lot!!!

To close the case, i made some additional tests:
Normal-/Portable-fb-Install with CUI & SQL Tree only on wine stable release -> works
Normal-/Portable-fb-Install with CUI & SQL Tree and  additional components* on wine 1.2 stable release -> works
Normal-/Portable-fb-Install with CUI & SQL Tree and  additional components* on wine 1.3 latest developer release -> works

The above test-cases were made on Ubuntu 10.04 LTS (Gnome) and Lubuntu 11.10 (OpenBox).
So, it can be supposed, that your component works in all up-to-date linux/wine environments.
With this in mind, you can be shure, i'm not the only guy, you made happy.

Thanx again!


foo_uie_sql_tree

Reply #67
@fbuser

---feedback---
Being glad, SQL Tree works in wine now, it took only 20 minutes to port all my TF-"queries" (8 queries with about 5 levelsl) to proper SQL-queries and setup a nice SQL Tree with different node-apearances according to their level.
For me, the UI of SQL Tree is selfexplaining and the backend does it's job properly.
The ability, to make a snapshot of an existing Medialibrary in a relational database, which is accessible outside fb opens horizons for SQL-devs.
The ability of per node settings for icon,colour and font is a great improvement to CUI's AlbumListPanel, which does its job but becomes a textdesert with increasing nodedepth.

---feature request---
But at the moment for my setup there is one showstopper, for a complete replacement of CUI's AlbumListPanel.
My setup heavily relies on the ability of an libraryviewer, to propagate the selection event (eventsink is in several in wsh_panel_mod scripts -> on_selection_changed(metadb)).

Usecase:
On the left side of my ui resides a libraryviewer.
The right side is horizontally divided in 2 parts.
An upper section to view all info about the nowplaying track.
A lower section to view all info about the selected item in the libraryviewer.
The sense of this:
You can hear Symphony 1, read in the upper section it's workdescription, which may have some hint to another work or composer.
Now you can select this other work or composer in the libraryviewer and read the according info in the lower section.

In summary this is a feature request of my SelectionViewers to get the according event from your SQl Tree View. 

foo_uie_sql_tree

Reply #68
Here are a couple of queries I'm using, for anyone else that might find them useful...

Artist / Release
Code: [Select]
SELECT
    coalesce([album artist],artist,'.Unknown Artist') album_artist
    ,ifnull(substr(date,1,4),'Undated')
        ||' – '||ifnull(album,'Untitled') release
FROM MediaLibrary
ORDER BY
    coalesce([album artist],artist,'.Unknown Artist') COLLATE NaturalNoCase
    ,ifnull(substr(date,1,4),'Undated')
        ||' – '||ifnull(album,'Untitled') COLLATE NaturalNoCase desc
    ,discnumber,tracknumber


Style / Artist / Release
Code: [Select]
SELECT
    coalesce([style],genre,'~Unknown Style') genrestyle
    ,coalesce([album artist],artist,'Unknown Artist') album_artist
    ,ifnull(substr(date,1,4),'Undated')
        ||' – '||ifnull(album,'Untitled') release
FROM MediaLibrary
ORDER BY
    coalesce([style],genre,'~Unknown Style')
    ,coalesce([album artist],artist,'Unknown Artist') COLLATE NaturalNoCase
    ,ifnull(substr(date,1,4),'Undated')
        ||' – '||ifnull(album,'Untitled') COLLATE NaturalNoCase desc
    ,discnumber,tracknumber


Year / Artist / Release
Code: [Select]
SELECT
    ifnull(substr(date,1,4),'.Undated') date_col
    ,coalesce([album artist],artist,'Unknown Artist') album_artist
    ,ifnull(substr(date,1,4),'.Undated')
        ||' – '||ifnull(album,'Untitled') release
FROM MediaLibrary
ORDER BY
    ifnull(substr(date,1,4),'.Undated') desc
    ,coalesce([album artist],artist,'Unknown Artist') COLLATE NaturalNoCase
    ,ifnull(substr(date,1,4),'.Undated')
        ||' – '||ifnull(album,'Untitled') COLLATE NaturalNoCase desc
    ,discnumber,tracknumber

foo_uie_sql_tree

Reply #69
Could'nt wait to see SQL Tree on my productive sytem (55"-screen) in the livingroom.
So i found a workaround for those, who have a setup with wsh-panel-mod, containing code, which relies on the ability of an libraryviewer, to propagate the selection event, delivering a metadb-object.
If anyone is interested, i will post it. (here?)
As every workaround has drawbacks, my feature request for the selection-event is still topical.


Bugreport
Bug: Altering the "SQL query" in tab "Query" query, results in loss of existing settings in tab "Action"
Bug: Altering settings for Action does'nt enable the OK Button, i first have to click on tab "Query", then OK Button is enabled to save settings for actions.
Bug: Click-action is set to: "Send to targetplaylist" A query like below, does'nt send anything to the pl, clicking the Node containing the concatenation "werkartist" or below:
Code: [Select]
SELECT land,composer,genre,gattung,werk || ':' || artist AS werkartist,title
FROM Medialibrary
GROUP BY land,composer,genre,gattung,werkartist,title


---------------------------------------------------------
i am using fb/SQL Tree in linux/wine environment

foo_uie_sql_tree

Reply #70
Bug: Altering the "SQL query" in tab "Query" query, results in loss of existing settings in tab "Action"
Not reproducible. Works fine here.

Bug: Altering settings for Action does'nt enable the OK Button, i first have to click on tab "Query", then OK Button is enabled to save settings for actions.
The first part is not a bug, the second is not reproducible.

The OK Button is only disabled, when "SQL query" in the "Query" tab  is empty and "SQL batch" in the "Batch" tab is empty as well or "Label" in the "Main" tab is empty.

Altering the Action settings will not change the status of the OK Button. Also just clicking on the "Query" tab will not change the status of the OK Button.

Bug: Click-action is set to: "Send to targetplaylist" A query like below, does'nt send anything to the pl, clicking the Node containing the concatenation "werkartist" or below:
Not reproducible. Works fine here. Is there any error message in the console?

foo_uie_sql_tree

Reply #71
Bug: Click-action is set to: "Send to targetplaylist" A query like below, does'nt send anything to the pl, clicking the Node containing the concatenation "werkartist" or below:
Not reproducible. Works fine here. Is there any error message in the console?
Just for clarification

Code: [Select]
SELECT land,composer,genre,gattung,werk || ':' || artist AS werkartist,title
FROM Medialibrary
GROUP BY land,composer,genre,gattung,werkartist,title

click on :
land -> works
composer -> works
genre -> works
gattung -> works
werkartist -> does'nt work
title -> does'nt work
No error message in the console!

I think, i will borow a native Windows-system, to verify wether this and any future assumed bug may be a wine issue.
If no one is averse of this, i will post "bugs", even though they only occure in wine-environment (with hint to this), because a few posts ago this helped, that SQL Tree runs in wine at all.

foo_uie_sql_tree

Reply #72
Bug: Click-action is set to: "Send to targetplaylist" A query like below, does'nt send anything to the pl, clicking the Node containing the concatenation "werkartist" or below:
Oops, I overread, that it only happens for the concatenated column. But this is not a bug. It is a limitation of the parser as written in the documentation:

Quote
For a proper parsing of the select list, expressions containing spaces must be enclosed in parentheses (e.g. case-when expressions)
Either omit the spaces in the expression: werk||':'||artist AS werkartist
or enclose the expression in parantheses as mentioned in the documentation: (werk || ':' || artist) AS werkartist

foo_uie_sql_tree

Reply #73
So the spaces/parentheses restriction was preventing the leaf nodes in my queries from working.

The cursor keys can be used to quickly expand/collapse and navigate a large tree, but the contents of the target playlist don't change unless the mouse button is clicked. Is this related to the selection-event propagation mentioned previously? It's odd for the behaviour to differ between keyboard and mouse input.

foo_uie_sql_tree

Reply #74
Thanx again to fbuser and shame on me for not reading the doc carefully.
Omitting the spaces in the expression makes the query working as expected.