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: Playlist-Tools-SMP (Read 85900 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: Playlist-Tools-SMP

Reply #425
Please translate those SQL queries into standard foobar queries first to help you (or whatever you want to do). I don't use jsp3. and not going to decipher the intended usage reading SQL.

Now, something "similar" taking a fast look at it, using Listenbrainz feedback tags (love = 1, hate = -1) and foo_playcount tags would be:
Source 1:
Quote
FEEDBACK IS 1 AND %LAST_PLAYED% DURING LAST 5 HOURS SORT DESCENDING BY %LAST_PLAYED%
Source 2:
Quote
FEEDBACK IS 1 AND %LAST_PLAYED% DURING LAST 5 HOURS SORT ASCENDING BY %PLAY_COUNT%

You can either set the source as playlists, i.e. creating 2 autoplaylists with those queries, or as library sources within pool definition.

Then the picking method would be 'start', since the sources are already sorted. (supposing you want sorting, instead of randomly picking from any of the sources)..

Finally, you can either use 'Selection manipulation\Shuffle by Tags' and use Album as tag. Or automatically apply it on the pool, using '"smartShuffle:" : "ALBUM"'.

Look at the JSON preset as example. It can be imported within the button. There are 2 pools, one using inline queries and another one which is supposed to point to 2 autoplaylists. Note time manipulation is so much easier via queries with the right plugins... also note the examples are simply taking X tracks from source, not creating groups per source and taking X groups (contrary to Random Pools). Read the pools documentation to see all possible ways to set the source.

That will create a playlist adding 15 tracks (if possible) per source, deduplicate them and apply a shuffle algorithm to ensure (if possible) that albums are evenly spaced.

Then, you can add that pool command to the script via File\Spider Monkey Panel\Script Commands\[PANEL NAME]\...



You could also simply manually call the selection manipulation command on the playlist generated by the other plugins though. The same for my deduplication algorithm (which works in a more advanced way).

Since you are already using JSP to call commands, you can technically add more commands and set selection, shuffle, etc. all via CMD commands. Note most of my scripts expose a lot of functions via CDM (you can tweak this behavior).

You can also "include" a headless script within the button, without the need to create a blank panel. So if you translate that simple JSP3 code to SMP, you can also add it to the button.

Re: Playlist-Tools-SMP

Reply #426
I've been waiting for a few days, but all the releases available for download have disappeared.
Has the distribution been suspended?

Re: Playlist-Tools-SMP

Reply #427
Please translate those SQL queries into standard foobar queries first to help you (or whatever you want to do). I don't use jsp3. and not going to decipher the intended usage reading SQL.

Just so I am going step-by-step I decided to translate my SQL queries into the following:

Code: [Select]
NOT [%jsp3_last_played%] DURING LAST 300 MINUTES AND NOT %codec% HAS tags SORT BY "$if($rand(2),[%jsp3_last_played%],[%jsp3_playcount%])"

Here %jsp3_last_played% is a UNIX timestamp indicating when was the last time the track has been played
%codec% is just something I am using to filter my tracks (I have m-TAGS installed and don't want it to be included in my playlist)
%jsp3_playcount% is an integer which gets incremented every time a track gets played.

Ultimately my logic is that every time I run the above query it will select tracks which haven't been played since 5 hours ago and sort them out between two modes, least recently played and lowest play count, hence the rand() function.

Now I am assuming I need to create an auto-playlist with the above query and use Smart Shuffle on it?


Re: Playlist-Tools-SMP

Reply #428
I've been waiting for a few days, but all the releases available for download have disappeared.
Has the distribution been suspended?
What?
https://github.com/regorxxx/Playlist-Tools-SMP/releases

Re: Playlist-Tools-SMP

Reply #429
Quote
Here %jsp3_last_played% is a UNIX timestamp indicating when was the last time the track has been played
Why are you using a unix timestamp variable if you are using queries? Just us a date variable, which is the thing supported on standard TF. Unix timestamps are for JS.

Quote
Ultimately my logic is that every time I run the above query it will select tracks which haven't been played since 5 hours ago and sort them out between two modes, least recently played and lowest play count, hence the rand() function.
You are not using TF properly. Read the wiki: https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_Reference#$rand()
Also, as far as I know, rand would be evaluated on every item, therefore it would just choose "method" for every track. Not sure if that's what you want, the list will not be entirely sorted by method A or B, but every track.

This would be a valid sorting expression. There may be a better syntax though
Quote
$if($greater($rand(),$rand()),%ARTIST%,%DATE%)

Quote
NOT [%jsp3_last_played%]
You don't have to use brackets that way on queries.

Quote
Now I am assuming I need to create an auto-playlist with the above query and use Smart Shuffle on it?
That's a solution. Or as I told you, use a pool following my example.

Re: Playlist-Tools-SMP

Reply #430
Yes

X
X

X
X
I can only download the Playlist-Tools and World-Map packages.
The same thing happens with other browsers. :o

Re: Playlist-Tools-SMP

Reply #431
Quote
Here %jsp3_last_played% is a UNIX timestamp indicating when was the last time the track has been played
Why are you using a unix timestamp variable if you are using queries? Just us a date variable, which is the thing supported on standard TF. Unix timestamps are for JS.

%jsp3_last_played% is a date/time string in the usual fb2k format. No idea what prompted the original comment about timestamps.

Re: Playlist-Tools-SMP

Reply #432
Quote
Here %jsp3_last_played% is a UNIX timestamp indicating when was the last time the track has been played
Why are you using a unix timestamp variable if you are using queries? Just us a date variable, which is the thing supported on standard TF. Unix timestamps are for JS.

%jsp3_last_played% is a date/time string in the usual fb2k format. No idea what prompted the original comment about timestamps.
XD no idea, that's what the user said. It seemed weird to me, but... then I see no problem doing all that via queries instead of sql.

Re: Playlist-Tools-SMP

Reply #433
Yes

[attach type=image]31908[/attach]
[attach type=image]31910[/attach]

[attach type=image]31912[/attach]
[attach type=image]31914[/attach]
I can only download the Playlist-Tools and World-Map packages.
The same thing happens with other browsers. :o
Read the wiki. There is a zip, this is not a package.

Re: Playlist-Tools-SMP

Reply #434
Oops, I'm embarrassed. I'm sorry. :))

Re: Playlist-Tools-SMP

Reply #435
This component is a mess. Sorry.

1. Super clustered; I only was using one or two things.
2. It crashes a lot, the aw! thing is showing like a lot.
3. From 10/15 seconds to load Foobar, after uninstall everything Spider Monkey related, now it only takes merely 2 seconds.

As said, I think this is a component for the creator, I mean that for my purposes it is not that convenient. I don't use all that stuff, since I use my phone to listen to my library. I don't do playlists, and most of the stuff I have found here I could do it with other components that work properly. Like quicksearch, randompools...

The randompools substitute is pretty intelligible too, I could not get the component to work properly. And as said, it seems to work only on playlists and random songs, not albums as randompools.

Sorry it is not that I do not appreciate the work, and in general it is clear that you have invested time on it. But for my purposes it just does not work.
Yes, the avatar it is the cover of «The City» by Vangelis.

Re: Playlist-Tools-SMP

Reply #436
Wow xd  ::)  ::)

Quote
As said, I think this is a component for the creator,
Obviously? xd But hey, feel free to give useful feedback to improve things. You can also pay me, then maybe I consider doing things for you. XD

EDIT: not really answering your other concerns, since it's pretty clear you simply don't understand how to use it, you don't understand some of your problems are a SMP thing (not mine) or spent your time reading the readmes found at the menu of every button. Which is fine, this is clearly for me (and I spent quite a lot of time writing documentation, but obviously I will never cover all use cases). Some people may find some things here useful for their needs, which is great :) Others not. Great too. xd I just don't really get your point.


Re: Playlist-Tools-SMP

Reply #438
Hi @regor so I finally got the time to test out the JSON file and tweaked it a bit and the results seem promising. Currently I am using Library as my source with necessary queries to do the job instead of Playlist names as my source.

Regarding smartShuffle if I shuffle based on ALBUM that would that mean the same album doesn't get repeated within 15 or 30 tracks? (using your JSON file again as example it takes only 15 tracks from the library for each query).
Also if I want to use album artist in smartShuffle I guess the correct value for it will be ALBUM ARTIST?

So far everything seems to be working as expected only thing remaining is that when checking File\Spider Monkey Panel\Script Commands\[PANEL NAME]\ I can't seem to find LRP + LPC pool mentioned anywhere any idea what could I be doing wrong here?

Re: Playlist-Tools-SMP

Reply #439
Hi @regor so I finally got the time to test out the JSON file and tweaked it a bit and the results seem promising. Currently I am using Library as my source with necessary queries to do the job instead of Playlist names as my source.

Regarding smartShuffle if I shuffle based on ALBUM that would that mean the same album doesn't get repeated within 15 or 30 tracks? (using your JSON file again as example it takes only 15 tracks from the library for each query).
Also if I want to use album artist in smartShuffle I guess the correct value for it will be ALBUM ARTIST?

So far everything seems to be working as expected only thing remaining is that when checking File\Spider Monkey Panel\Script Commands\[PANEL NAME]\ I can't seem to find LRP + LPC pool mentioned anywhere any idea what could I be doing wrong here?
It means no 2 consecutive tracks would have the same album.  The shuffle is by done by tag, but it does not group the tracks by such tag, just uses the tag values to ensure they are not repeated.

Yep, if you want ALBUM ARTIST, use that.

Note by default almost 100% places where my scripts say "artist" -in default settings-, in fact ALBUM ARTIST is used. If you go to [FOOBAR_PROFILE]\js_data\presets\global\globTags.json, you can see the remap. After a change there, you have to restore defaults on any tool/button.

There is a readme for that called global tag remap at configuration, in fact some of your doubts may also be covered there (like how Smart shuffle works at 'Shuffle by tags'). Every menu has its own readme.

If you didn't change it, the shuffle by artist option at selection manipulation in fact uses ALBUM ARTIST. You can check it by editing the entry though. If you talk about the smart shuffle option within the JSON, just use ALBUM ARTIST.

About your last question, first be sure the panel has a name set. Then, the SMP menus must be enabled at Script integration. Finally, if you just imported the JSON file, reload the panel. That may be, have tested it and it only seems to appear after reloading (will change this behavior if possible in the future). Since the entries are not in a subfolder, they appear as "Pools\LRP + LPC". Any entry always uses the immediate parent menu + entry name.

Re: Playlist-Tools-SMP

Reply #440
It means no 2 consecutive tracks would have the same album.  The shuffle is by done by tag, but it does not group the tracks by such tag, just uses the tag values to ensure they are not repeated.

Yep, if you want ALBUM ARTIST, use that.

Note by default almost 100% places where my scripts say "artist" -in default settings-, in fact ALBUM ARTIST is used. If you go to [FOOBAR_PROFILE]\js_data\presets\global\globTags.json, you can see the remap. After a change there, you have to restore defaults on any tool/button.

There is a readme for that called global tag remap at configuration, in fact some of your doubts may also be covered there (like how Smart shuffle works at 'Shuffle by tags'). Every menu has its own readme.

If you didn't change it, the shuffle by artist option at selection manipulation in fact uses ALBUM ARTIST. You can check it by editing the entry though. If you talk about the smart shuffle option within the JSON, just use ALBUM ARTIST.

About your last question, first be sure the panel has a name set. Then, the SMP menus must be enabled at Script integration. Finally, if you just imported the JSON file, reload the panel. That may be, have tested it and it only seems to appear after reloading (will change this behavior if possible in the future). Since the entries are not in a subfolder, they appear as "Pools\LRP + LPC". Any entry always uses the immediate parent menu + entry name.

Can confirm that refreshing the panel fixed the issue of LRP + LPC entry missing.

Lastly, you've mentioned about a headless option where I don't need to create a blank panel any idea regarding how to do this as well?
When I right click Playlist Tools > Other UI settings, headless mode is greyed out.

Re: Playlist-Tools-SMP

Reply #441
Lastly, you've mentioned about a headless option where I don't need to create a blank panel any idea regarding how to do this as well?
When I right click Playlist Tools > Other UI settings, headless mode is greyed out.

Sorry, I seem to be confusing myself but is there a way to customise Playlist Tools without creating an entire dedicated blank panel for it? If that's out of question any idea how could I tuck it in my layout?

Re: Playlist-Tools-SMP

Reply #442
You can always create a blank panel and set its height to zero, so it's not visible. But that's up to you.

About the "headless mode", I was talking about importing other scripts into the one with Playlists Tools. But that's another thing, you still need that panel. The headless mode at the toolbar settings, is just for buttons which require no user intervention (like Auto-Backup). Obviously a button which offers options to be clicked and used doesn't need a headless mode.

BUT you can add the panel to the tooltar at top and adjust it to only show the icons, for example. All colors are configurable, so it's compatible with any theme. I'm using CUI btw.

Re: Playlist-Tools-SMP

Reply #443
Hi Regor,

I have migrated all Will-B related Spidermonkey panels in my skin to Jsplitter succesfully.

Loading the existing (and in Spidermonkey working) buttons_toolbar.js into a new Jsplitter panel results in the attached error.
Do I do something wrong?

Re: Playlist-Tools-SMP

Reply #444
Known problem. You have to download the files again (from repository, latest commit, not the release), as I noted on multiple threads, previous scripts are not compatible with jsplitter. So I had to add a fix for that (but I have not created a release yet).
https://hydrogenaud.io/index.php/topic,116669.msg1051811.html#msg1051811

Or just wait until I create a new release

Re: Playlist-Tools-SMP

Reply #445
Known problem. You have to download the files again (from repository, latest commit, not the release), as I noted on multiple threads, previous scripts are not compatible with jsplitter. So I had to add a fix for that (but I have not created a release yet).
https://hydrogenaud.io/index.php/topic,116669.msg1051811.html#msg1051811

Or just wait until I create a new release
Found it & works. No more SMP in the skin. Thx!