Skip to main content
Topic: Library Tree Discussion (Read 43828 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Library Tree Discussion

Reply #225
New Version: Library Tree 2.1.2

CHANGELOG

NEW: Option to remember tree state of all views independently (expanded nodes etc; menu > ... options > mode > Remember Tree State).

NEW: Colour options:

1) Option to set a custom colour for the selected item frame: _Custom.Colour Frame Selected (panel properties).

2) Option to set different colours for parts of a line of text:

$colour{normal,hover,selected}

For use in view patterns.

Normal, hover & selected can either be r-g-b or a highlight or dim indicator, e.g.
$colour{r-g-b,r-g-b,r-g-b} or $colour{-,++,+++}

Highlight & dim indicators:

- dim text
-- dimmer text
--- dimmest text
+ bright text
++ brighter text
+++ brightest text

All colours are optional: any undefined are set to default. Format, r-g-b & -/+ style, can be mixed in same $colour{} function.

Examples:
$colour{} reset all colours to defaults
$colour{255-0-0} set normal text colour to red; set hover & selected text colours to defaults since undefined
$colour{,,+++} set selected text colour to brightest; set normal & hover text colours to defaults since undefined
$colour{0-255-0,++} set normal text colour to green & hover text colour to brighter; set selected text colour to default since undefined
$colour{255-0-0,0-255-0,0-255-255} set normal, hover and selected text colours to red, green & cyan, respectively

Example pattern:
Code: [Select]
View by Artist - Album // $colour{-}%album artist%[$colour{+} - %album%][$colour{96-127-127} ∙ '['%date%']'][$colour{111-132-138} ∙ %genre%]$colour{--}|[[%discnumber%.]$colour{--,++,0-192-192}%tracknumber%. ]$colour{-,++,0-228-228}[%track artist% - ]%title%

Colours apply after the $colour code until either another $colour code is encountered or a branch point is reached (| in the view pattern).

Item counts are a special case. They don't form part of the view pattern.
   Align right: drawn separately; not controlled by $colour codes; already dimmed.
   End of text: effected by $colour codes. Use $colour{} at the end of the line [i.e. before branch point: | ]  to reset or set to a different colour if desired ($colour{--} is used in the example above).

Re: Library Tree Discussion

Reply #226
Thank you so much! I'm starting formatting right away.

Re: Library Tree Discussion

Reply #227
@WilB
Perfect, Thank you :)








Re: Library Tree Discussion

Reply #228
I don't know what the problem is, but when you hover over the song, the color does not change (in this case to yellow 255-255-0)

My test code:
Code: [Select]
Test colours // $colour{255-0-0,255-0-0,255-0-0}'('%date%')'$colour{} - %album%|%tracknumber%. $colour{255-0-0,255-255-0,0-255-255}%title%
normal

hover

selected



Re: Library Tree Discussion

Reply #229
I tried your code sample, and it worked as expected for me, i.e. title showed in yellow on hover.

Please ensure the following is enabled: right click menu … > options > show > highlight text on hover.

Re: Library Tree Discussion

Reply #230
Please ensure the following is enabled: right click menu … > options > show > highlight text on hover.
Yes indeed, the option you mention about was missing. Now everything works as it should. Once again, thank you very much for your work  :)

Re: Library Tree Discussion

Reply #231
@WilB

Hello WilB, even with this last version I am getting this error:

Error: Spider Monkey Panel v1.2.2-preview+0db3c6a4 (Library Tree v2.1.2 by WilB)
OrderByRelativePath failed:
allocation size overflow

File: <main>
Line: 542, Column: 61

Stack trace:
  Panel/this.sort@<main>:542:61
  rootNames@<main>:1205:48
  Library/this.getLibrary@<main>:1190:119
  Timers/this.lib/<@<main>:2911:115

Regards,
Andrea

Re: Library Tree Discussion

Reply #232
Ever since I realised you're using a very large library I've routinely run tests on an artificially created 640,000 library.

That works fine on my pc, including with view by folder structure.

The actual error seems to be in the handleList sort: handleList.OrderByRelativePath(); I'm not sure that I have any control over what that's doing, as it's a SpiderMonkey Panel function.

So it's not clear to me whether this is actually a SpiderMonkey Panel issue, possibly related to memory handling / memory available on your device, or whether something could be optimised in the script.

@TheQwertiest - any ideas?

Re: Library Tree Discussion

Reply #233
Works great and it made my information-overloaded branches much more readable: https://imgur.com/a/MjqhJVJ (at least to me). Thank you again!

One thing I noticed though, is that $colour{} function doesn't work inside other functions (conditional or string). For conditionals it outputs invalid syntax error, for $replace(%some_tag%,'some_string',$colour{x-y-z}'some_string') all sorts of weird breaks happen. I suppose that's intended not to work within functions?

In the end managed to get around it mostly and it's not such a big issue, but I was just wondering, because e.g. $nodisplay{} works within functions.

Re: Library Tree Discussion

Reply #234
Yes I had spotted that one & it should be fixed on my copy. I'm awaiting to see if  @TheQwertiest can help with the issue raised in posts 231 & 232, before releasing an updated version.

But the fix is very minor, and you could change it yourself if you're inclined and don't want to wait until the next version. Shift + right click > menu > configure

On line 616 replace "," with "`" (2 instances on that line)
On line 1790 similarly replace ',' with '`' (1 instance on that line)
i.e. replace the commas on those lines with backticks. Do not alter any other lines.

I tested it with conditional strings, but please confirm it works with your conditional or string scenarios, if you want to try it, else advise me if you prefer to wait until the next version.

HTH

Re: Library Tree Discussion

Reply #235
Yes! Works like a charm:

Thanks again for so quick help!

Re: Library Tree Discussion

Reply #236
But the fix is very minor, and you could change it yourself if you're inclined and don't want to wait until the next version. Shift + right click > menu > configure

On line 616 replace "," with "`" (2 instances on that line)
On line 1790 similarly replace ',' with '`' (1 instance on that line)
i.e. replace the commas on those lines with backticks. Do not alter any other lines.

I confirm, it now works inside the function. Earlier I had to add a square bracket to make it work. Thank you for the correction, it makes operation much easier  ;D


Re: Library Tree Discussion

Reply #238
Is it possible for the color to work inside the $replace function?
Code: [Select]
$if($or($strstr(%title%,feat.),$strstr(%title%,Feat.)),$replace(%title%,Feat.,$colour{128-255-0,128-255-0}feat.$colour{}),%title%[ '('$colour{128-255-0,128-255-0}feat.$colour{} %featuring%')'])
The second part of the code works (without the $replace function)
Code: [Select]
,%title%[ '('$colour{128-255-0,128-255-0}feat.$colour{} %featuring%')']

I don't know if it's possible to work around this  ::)

Re: Library Tree Discussion

Reply #239
@Tropoje $replace is case sensitive, but you can do it over infinite number of arguments, so just make replacements for both cases.

Code: [Select]
$if($or($strstr(%title%,feat.),$strstr(%title%,Feat.)),$replace(%title%,feat.,$colour{128-255-0,128-255-0}feat.$colour{},Feat.,$colour{128-255-0,128-255-0}Feat.$colour{}),%title%[ '('$colour{128-255-0,128-255-0}feat.$colour{} %featuring%')'])

Re: Library Tree Discussion

Reply #240
@Tropoje $replace is case sensitive, but you can do it over infinite number of arguments, so just make replacements for both cases.

Code: [Select]
$if($or($strstr(%title%,feat.),$strstr(%title%,Feat.)),$replace(%title%,feat.,$colour{128-255-0,128-255-0}feat.$colour{},Feat.,$colour{128-255-0,128-255-0}Feat.$colour{}),%title%[ '('$colour{128-255-0,128-255-0}feat.$colour{} %featuring%')'])
Thank you very much for your quick reply  ;D
My goal is to always make changes Feat. (uppercase)  to feat. (lowercase). I have slightly modified your code and now it works as it should. This solves my problem  ;D  ;D  ;D
Code: [Select]
$if($or($strstr(%title%,feat.),$strstr(%title%,Feat.)),$replace(%title%,Feat.,$colour{128-255-0,128-255-0}feat.$colour{},feat.,$colour{128-255-0,128-255-0}feat.$colour{}),%title%[ '('$colour{128-255-0,128-255-0}feat.$colour{} %featuring%')'])

Re: Library Tree Discussion

Reply #241
@TheQwertiest
@AndreaT , does this happen on SMP v1.2.1 as well? Is it consistently reproducible? How big is your library (i.e. the number of tracks)?

Yes, with SMP 1.2.1 I had to remove Library Tree immediately, it was completely unusable. No way to "start-up" Library Tree View.
With the new SMP 1.2.2 and the new Library Tree View things are going better, At least I can have it running for a while.
My library contains about 600k records (live recordings made over 30+ years).

PS: Nothing critical for me. No hurry. I already reverted back to Album List (it is slow, but it works).
Regards, Andrea


Re: Library Tree Discussion

Reply #243
1. I found a minor issue: Placing $colour{} function before the first string in top branch breaks the jumpsearch. If colouring is involved in conditional or replacement functions, jumpsearch works only for the unformatted alternatives.

2. Now for another thing that I'm not really hopeful about since it looks a bit like I'm asking for the impossible:

Pairing of corresponding meta fields between separate multi-value tags
Ideally I would love to be able to couple different multi-value tags in a way that evaluated corresponding indices of both arrays in tandem. So that branching would look like this:
- $meta(tag_a,0)$nodisplay{$meta(tag_b,0)
- $meta(tag_a,1)$nodisplay{$meta(tag_b,1)
...

How it looks now
Spoiler (click to show/hide)

At this point I gave up with disambiguating those few same-named artists I have, in order not to get these mangled branchings for much more ubiquitous multi-valued artist tags.

Re: Library Tree Discussion

Reply #244
Jump search & $colour: should be fixed for the next version.

Pairing of corresponding meta fields between separate multi-value tags: multi-value tags & $nodisplay.

I did spot an issue with $nodisplay not always being correctly sorted with multi-value tags. That should be fixed for the next version It may address some of the sorting issues you noticed, but not the pairing point.

Pairing: multi-tag evaluation doesn't consider the indices that would be needed for that even for the displayed item (just getting the names is enough) let alone for anything that's not displayed.

Quote
disambiguating those few same-named artists

Personally I would find it rather confusing to have exactly the same named artist appearing in the list twice.

Possibilities:

1) Standard artist names. Album name, for example, can be a disambiguator, e.g.

Code: [Select]
View by Artist // %<artist>%|%album%|[[%discnumber%.]%tracknumber%. ][%track artist% - ]%title%
i.e. disambiguation would be based on album name after click on artist

Code: [Select]
View by Artist - Album // %<artist>% - %album%|[[%discnumber%.]%tracknumber%. ][%track artist% - ]%title%
i.e. album name alongside artist name

2) Artist name with disambiguator, including where it appears in multi-value tags. Doesn't depend on album names being present. For example:

Muse ∙ UK
Muse ∙ US

Disambiguator could be genre, country or city of origin etc. If a unique separator is used, artist names can easily be cut at the separator if used in internet look-ups of lyrics, biographies etc, so as not to break those types of look-ups.

Seeing as you say you only have a few same-named artists, it would be simple to change the tags if you're inclined.

Re: Library Tree Discussion

Reply #245
Yeah, I figured this is the easiest way. Or even to make an additional %artist_disamb% tag for these few cases, where I would have the name with more info, for example with the country code like you suggested. And then the branch would simply have a structure like this $if2(%artist_disamb%,%artist%).

Thanks for help!

 

Re: Library Tree Discussion

Reply #246
I'm awaiting to see if  @TheQwertiest can help with the issue raised in posts 231 & 232, before releasing an updated version.
I don't think there is a need to wait for the new version of SMP, since even if this bug to be fixed, it should not impact SMP API in any way =)

Re: Library Tree Discussion

Reply #247
Hi
I'm seeing error as below when I use view: View by Album //$if(%album%,%album% - $meta(band,0), 'Non Album')|%title%

Error: Spider Monkey Panel v1.2.2-preview+0db3c6a4 (Library Tree v2.1.2 by WilB)
n is undefined

File: <main>
Line: 1683, Column: 6

Stack trace:
  branchCount/<@<main>:1683:6
  branchCount@<main>:1681:5
  Populate/this.buildTree/<@<main>:1667:156
  Populate/this.buildTree@<main>:1649:9
  Library/this.rootNodes@<main>:1276:58
  Timers/this.lib/<@<main>:2911:133

Re: Library Tree Discussion

Reply #248
As I couldn't seem to reproduce, I've sent you a private message to explore what's going on.

Re: Library Tree Discussion

Reply #249
Hi, I am facing the following problem when I start my foobar. It always crashes and I have to reload the panel to operate normally.
I am using SMP v .2.1. and Library Tree v2.1.0.

Thank you

 
SimplePortal 1.0.0 RC1 © 2008-2019