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: Library Tree Discussion (Read 129988 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Library Tree Discussion

Reply #350
Just had this script crash (see below). I'm using 1.4.2 of SMP.

Error: Spider Monkey Panel v1.4.2-dev+5fa2496a (Library Tree: Library Tree v2.1.3 by WilB)
lib.node[v] is undefined

File: Library Tree 2.1.3.js
Line: 1635, Column: 11
Stack trace:
  Populate/this.buildTree/</<@Library Tree 2.1.3.js:1635:11
  Populate/this.buildTree/<@Library Tree 2.1.3.js:1634:23
  Populate/this.buildTree@Library Tree 2.1.3.js:1628:12
  Populate/this.buildTree/<@Library Tree 2.1.3.js:1647:42
  Populate/this.buildTree@Library Tree 2.1.3.js:1628:12
  Populate/this.branch@Library Tree 2.1.3.js:1570:14
  expandCollapse@Library Tree 2.1.3.js:2012:10
  Populate/this.lbtn_dn@Library Tree 2.1.3.js:2049:26
  on_mouse_lbtn_down@Library Tree 2.1.3.js:2889:192

Re: Library Tree Discussion

Reply #351
I wasn't able to reproduce the issue. You can try replacing lines 1632-1639 with the following, which ought to fix it.
Code: [Select]
switch (true) {
case l != -1 && !showTracks:
range(item.item).some(v => {
if (lib.node[v] && (lib.node[v].length == l + 1 || lib.node[v].length == l + 2)) return item.track = true;
});
break;
case l == 0 && lib.node[item.item[0].start] && lib.node[item.item[0].start].length == 1: item.track = true; break;
}
Else the fix will be in the next version.

Thanks for reporting.

Re: Library Tree Discussion

Reply #352
Not sure if it's feasible, but a reverse sorting function specifically for the date field would be nice. I wish to be able to sort albums chronologically in order of newest to oldest.

Re: Library Tree Discussion

Reply #353
You can use $nodisplay:

$nodisplay{X} Sorts & groups by X without display of X

For example, the following sorts latest albums first & displays the date.
Code: [Select]
%artist%|$nodisplay{$sub(99999,%date%)}%album%[ '['%date%']']|%tracknumber%. %title%
The next version has embedded extended syntax help + a proper manager for views & filters, so doing things like this should be easier. It should also satisfy requests for integrated thumbnail support and is planned to include an optional 2 panel mode...

Re: Library Tree Discussion

Reply #354
You can use $nodisplay:

$nodisplay{X} Sorts & groups by X without display of X

For example, the following sorts latest albums first & displays the date.
Code: [Select]
%artist%|$nodisplay{$sub(99999,%date%)}%album%[ '['%date%']']|%tracknumber%. %title%
The next version has embedded extended syntax help + a proper manager for views & filters, so doing things like this should be easier. It should also satisfy requests for integrated thumbnail support and is planned to include an optional 2 panel mode...

Thanks very much! I wasn't aware of such a syntax. Looking forward to the next version.

Re: Library Tree Discussion

Reply #355
No reply yet, but here's a new question about Library Tree. This code doesn't seem to work as a custom filter :

Code: [Select]
$nowplaying{$meta(comment,0)} HAS artist

@WilB , could you tell me why it doesn't work?
The goal would be to find other tracks where the artist would be mentioned in the %comment% field of the current playing track.
That's because some of my tracks have a %comment% field that says : "This track has a small sample taken from this other track : ARTIST / TITLE".
In that case I'd like Library Tree to help me fetch that other track.

Re: Library Tree Discussion

Reply #356
Hi WilB,

Thanks for the wonderful script, I appreciate that you are still maintaining it for such a long time :)

I just updated from JScript panel to Spider Monkey Panel and was able to set it up the way it was before. However I have encountered 2 minor issues that I'd like to report/get some clarification for, so I am listing them below:

1. I might be wrong, but i think the setting "options / mode / auto expand single items" doesn't work right now or i have misunderstood this setting. It seems like it is changing the setting "full line selection" setting instead because if I change "auto expand single items" setting, it will enable/disable both of these settings instead.

2. I have a question regarding the "options / node style / highlight nodes on cover" setting.

Currently, if the setting is enabled, the mouse cursor changes to hand symbol when hovering over node text and the mouse cursor stays as default when hovering over the node symbol. When the setting is disabled, the behavior gets reversed, so the mouse cursor stays as default when hovering over the node text and changes to hand symbol when hovering over the node symbol.

Would it be possible to change this behavior so when this highlight setting is enabled, the mouse cursor changes to hand symbol for both the node symbol and the node text and when this setting is disabled, the mouse cursor will not change for neither the node symbol and the node text?

My goal is to disable the mouse cursor changing to hand symbol entirely, for both the node symbol and the node text.

Thank you for your feedback, much appreciated!

Re: Library Tree Discussion

Reply #357
1. That's a bug fixed for the next version. It's a trivial fix: there's a break missing in the menu handler on the end of line 2837.

2. That was a design decision so there's always a visual hover indicator. If you want to change the behaviour, you can try searching the script for:
this.hand = true
change to:
this.hand = false
There should be two instances.

Re: Library Tree Discussion

Reply #358
Try:
Code: [Select]
comment HAS $nowplaying{$meta(artist,0)}

I don't have a definitive eta. All release scripts have had a significant upgrade. Ini file has gone from bio plus all scripts now have proper settings dialog. Additionally, there's a bunch of new features mostly eluded to here or there. Code changes are mostly done now. Code clean up and testing needed tho...

Re: Library Tree Discussion

Reply #359
Thank you, changing the value to "false" in line 2124 did the trick :)

Re: Library Tree Discussion

Reply #360
New Version: Library Tree

v2.2.0-Beta.1

HIGHLIGHT
Now supports all types of album art including artist photos & album covers


 
Updated features summary
- Tree viewer + album art support.
- Library and playlist sources.
- Single panel and two panel modes.

Changelog v2.2.0
Added
- Album art
- Playlist source
- Two panel mode (optional)
- '¦' soft splitter that combines different fields into same branch level, e.g.
   %album artist%¦%artist% or %<album artist>%¦%<artist>%
- New options dialog

Changed
- Send to new playlist now checks playlist lock status
- Smooth scroll: enhanced smoothness when using scrollbar
- Refactored code



Re: Library Tree Discussion

Reply #361
@WilB
Nice new version. Thanks.

Having a problem with updating a playlist that has ONLY the disable remove playlist lock. It doesn't update until I remove all locks. I would have thought that the playlist should update - as far as the user is concerned it's not being removed, it's being updated. But it's no big deal, I'm sure we can live with it.

Re: Library Tree Discussion

Reply #362
@WilB
Nice new version. Thanks.

Having a problem with updating a playlist that has ONLY the disable remove playlist lock. It doesn't update until I remove all locks. I would have thought that the playlist should update - as far as the user is concerned it's not being removed, it's being updated. But it's no big deal, I'm sure we can live with it.

Sorry originally posted in wrong thread.

Re: Library Tree Discussion

Reply #363
Currently, SMP only has plman.IsAutoPlaylist and plman.IsPlaylistLocked which both return booleans and is unable to determine the type of locks in place.

It inherited these from JSP during the original forking process long before JSP had a more finely grained method plman.GetPlaylistLockFilterMask added which is able to determine the different types of lock in place.

Maybe the script should check for plman.IsAutoPlaylist instead. They're guaranteed to be read-only and any attempt to update a playlist lock which prevents the adding of new items would silently fail.

Re: Library Tree Discussion

Reply #364
plman.IsAutoPlaylist also seems to resolve the original reason for making the change. Thanks for the info.

I'll change it for the next version.

@Black_Over_Bills_Mothers
If you don't want to wait for the next version there are two instances of plman.IsPlaylistLocked that can simply be changed:
menu: line 154
populate: line 1276

Re: Library Tree Discussion

Reply #365
Try:
Code: [Select]
comment HAS $nowplaying{$meta(artist,0)}
Thanks WilB. I see your point. That doesn't work in my case, but maybe there's no solution for what I'm trying to achieve.
I'm using Library Tree to retrieve songs that are similar to the currently playing song, and put them into a special playlist.
That works for songs that have the same title for example.
But sometimes my comment field has info that looks like this : "This song contains a sample from {Song title} by {Song artist}".
In that case, I'd like to retrieve {Song title} by {Song artist} in my library and add it to the special playlist. Can that be achieved ?

Currently my query is :
Code: [Select]
title IS $nowplaying{$if2($meta(original title,0),$meta(title,0))}
OR original title IS $nowplaying{$meta(title,0)}
OR comment HAS $nowplaying{$meta(artist,0)}

Re: Library Tree Discussion

Reply #366
@wcs13
Quote
I'm using Library Tree to retrieve songs that are similar to the currently playing song, and put them into a special playlist. The following doesn't work in my case:
Code: [Select]
comment HAS $nowplaying{$meta(artist,0)}
Quote
...But sometimes my comment field has info that looks like this: "This song contains a sample from {Song title} by {Song artist}".
In that case, I'd like to retrieve {Song title} by {Song artist} in my library and add it to the special playlist. Can that be achieved ?

You can try:
Code: [Select]
comment HAS $nowplaying{$meta(artist,0)} AND comment HAS $nowplaying{$meta(title,0)}

or for your full code example
Code: [Select]
title IS $nowplaying{$if2($meta(original title,0),$meta(title,0))} OR original title IS $nowplaying{$meta(title,0)} OR comment HAS $nowplaying{$meta(artist,0)} AND comment HAS $nowplaying{$meta(title,0)}

Moved discussion from uploads.

Re: Library Tree Discussion

Reply #367
This "Library Tree" is awesome and heavily configurable ;
Thank you for your impressive work.

Re: Library Tree Discussion

Reply #368
@wcs13
Quote
I'm using Library Tree to retrieve songs that are similar to the currently playing song, and put them into a special playlist. The following doesn't work in my case:
Code: [Select]
comment HAS $nowplaying{$meta(artist,0)}
Quote
...But sometimes my comment field has info that looks like this: "This song contains a sample from {Song title} by {Song artist}".
In that case, I'd like to retrieve {Song title} by {Song artist} in my library and add it to the special playlist. Can that be achieved ?

You can try:
Code: [Select]
comment HAS $nowplaying{$meta(artist,0)} AND comment HAS $nowplaying{$meta(title,0)}

or for your full code example
Code: [Select]
title IS $nowplaying{$if2($meta(original title,0),$meta(title,0))} OR original title IS $nowplaying{$meta(title,0)} OR comment HAS $nowplaying{$meta(artist,0)} AND comment HAS $nowplaying{$meta(title,0)}

Moved discussion from uploads.
Not related to this script, but you can achieve exactly that with dynamic queries
COMMENT HAS #TITLE# AND COMMENT HAS #ARTIST# (will fully expand if there are multiple artists, or you can use $meta() if you want only one)

If you want to extract the info from the comment of the current track and get the artist and songs according to that to create a query:
TITLE IS #$substr(%comment%,$add(1,$strchr(%comment%,'{')),$sub($strchr(%comment%,'}'),1))# AND ARTIST IS #$substr(%comment%,$add(1,$strrchr(%comment%,'{')),$sub($strrchr(%comment%,'}'),1))#

X

X

Applied to my dummy track, works perfectly. (obviously I get 0 tracks since I have 0 songs named "song title", etc.)
X

You can even automatize the steps with a macro. Find the now playing track, apply the query to it, select the tracks retrieved by the query and send them directly to the autoplaylist you want with one click.

Re: Library Tree Discussion

Reply #369
My two cents:

View by genre with sub-genres:
Code: [Select]
$if(%genre%, $left(%genre%,$sub($strchr(%genre%,','),1)), --- Undefined ---)|[%genre%|]$nodisplay{%album artist%$if2(%RELEASE_DATE%,%date%)}[%album artist% ]$colour{--}$if(%RELEASE_DATE%,'('%RELEASE_DATE%')  :  ',$if(%date%,'('%date%')  :  ',  :  ))$colour{}$if2(%album%,%directoryname%)|$if(%tracknumber%,$colour{--}%tracknumber%.   $colour{}[%track artist% -- ]%title%,%filename%)


Re: Library Tree Discussion

Reply #370
My two cents:

View by genre with sub-genres:
Code: [Select]
$if(%genre%,$left(%genre%,$sub($strchr(%genre%,','),1))|%genre%,--- Undefined ---)|$nodisplay{$if(%album%,$if($stricmp(%album artist%,%PUBLISHER%),-C,%album artist%$if2(%RELEASE_DATE%,%date%),-S))}$if(%album%,$if(%album artist%,$if($stricmp(%album artist%,%PUBLISHER%),--- Compilations ---|,)%album artist% $colour{--}$if(%RELEASE_DATE%,'('%RELEASE_DATE%')  :  ',$if(%date%,'('%date%')  :  ',  :  ))$colour{}$if2(%album%,%directoryname%),$colour{--}%directoryname%)|$if(%tracknumber%,$colour{--}%tracknumber%.   $colour{}[%track artist% -- ]%title%,$if(%title%,[%track artist% -- ]%title%,%filename%)),--- Singles ---|$if(%artist%,[%artist% -- ]$nodisplay{%tracknumber%}%title%,%filename%))

Update:
- Items with no %album% are sort as "--- Singles ---"
- Items with %album artist% == %PUBLISHER% are sort as "--- Compilations ---"

Re: Library Tree Discussion

Reply #371
@Smurth Thanks for the compliments :)

Nice pattern by the way.

Re: Library Tree Discussion

Reply #372
Hi, I guess I've found a bug / limitation...

When you select several items by using only the keyboard, like CTRL / SHIFT + Arrow keys, the destination playlist is not updated.
(it seems to be updated only on MLButtonUp)

Re: Library Tree Discussion

Reply #373
Try setting the following:
options > behavior tab > keystroke > send to playlist

Re: Library Tree Discussion

Reply #374
Try setting the following:
options > behavior tab > keystroke > send to playlist

It works ; thank you.
There's still CTRL+A which select all (as intended) but not send it to the playlist ; but it's a minor issue.