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

Re: foo_random_pools

Reply #325
Hello @fbuser, that's amazing!
Just 2-3 seconds on my old PC as well!!
Please, recommend to install SQLite to everybody!!
Cheers, Andrea

Re: foo_random_pools

Reply #326
For the record, doing the same with SMP on 70K tracks, plus duplicates removal by title|artist|date (reduced to 65K elegible tracks)... takes 500 ms. Just giving options, since some specific use-cases may be covered with other approaches.

Spoiler (click to show/hide)

Re: foo_random_pools

Reply #327
Hello @regor, I am sorry but I don't know how to do that within SMP.
Would you be so kind to provide some more details? Or share your scripts?
Regards, Andrea

Re: foo_random_pools

Reply #328
Hello @regor, I am sorry but I don't know how to do that within SMP.
Would you be so kind to provide some more details? Or share your scripts?
Regards, Andrea
I put the link on the reply (also on my sig, Playlist Tools), and the video should be self-explanatory once you install the scripts and got it running.

Further discussion should be handled on its own topic though; I just wanted to add my 2 cents to the performance tests done with random pools, since my scripts essentially use TF and queries too.

Re: foo_random_pools

Reply #329
Hello @regor , sorry, I was reading from a smartphone and I missed something.
Regards, Andrea

Re: foo_random_pools

Reply #330
Hello @fbuser , ... just a last favor than I will not disturb you anymore...

How to have a similar SQL random pool of 10 albums?

I tried following one of your example of the help file, but I get the message "no table album" as well as "no table artist"...

Kind regards, Andrea

Re: foo_random_pools

Reply #331
How to have a similar SQL random pool of 10 albums?
This is a bit more complicated, especially if you want to have a good performance. With the more easier way I get 10 albums in about 35s, with some optimizations I got the 10 album in about 2.5s. So let's have a look at this.

  • First you need to create a materialized table from your media library:
    Go to "Preferences -> Media Library -> SQLite utilities -> MediaLibrary table", set for all columns, which you want to be part of the materialized table the "Materialize" flag and set "Materialized table" to "MMediaLibrary" in the upper right corner of the preferences page. Then click on the OK button and confirm, that you want to materialize the table. This will take some time, probably between 10-15 minutes on your PC, as it needs between 3-6 minutes on mine, but it needs to be done only once.

    Afterwards the materialized table will be maintained automatically and needs only to be refreshed, if you change the columns of the materialize dtable or in case the table gets out of sync due to abnormal program exits without having saved the latest tag changes (they are already in the materialized library but not anymore in the foobar2000 library after program restart). But with foobar2000 v2 this should normally not happen anymore.
  • Now go to "Library -> SQLite console" and execute the following SQL statement
    Code: [Select]
    CREATE INDEX materialize.MMediaLibrary_in_album on MMediaLibrary(album||'|'||coalesce("album artist",artist));
  • Finally you can define a pool "10 random albums". The left side of the dialog has the same entries as the pool for "20 random tracks", so you only need to supply different SQL expressions:
    Code: [Select]
    WITH:
    Albums AS (
      SELECT album||'|'||coalesce("album artist",artist) Album
      FROM MMediaLibrary
      GROUP BY 1
      ORDER BY random()
      LIMIT 10
    )

    SELECT path, subsong FROM:
    MMediaLibrary

    WHERE:
    album||'|'||coalesce("album artist",artist) IN (SELECT album FROM Albums)

    ORDER BY:
    album||'|'||coalesce("album artist",artist),coalesce(discnumber,1),tracknumber
    LIMIT remains blank. The proposed solution assumes, that you can identify an album uniquely by a combination of %album% and %album artist%. If this is not the case you need to adjust the expression "album||'|'||coalesce("album artist",artist)" wherever it is used to fit your needs. If you have an own tag to identify an album, e.g. %album id%, you should use this.

For the mentioned easier way you only need to define the pool as specified in the last point and replace the two occurences of MMediaLibrary by MediaLibrary.

Re: foo_random_pools

Reply #332
Hello @fbuser , thank you so much! It works well even on my old 32bit laptop.
All the best, Andrea

Re: foo_random_pools

Reply #333
Nice and useful plugin, but what about people who don't have any concept or idea about how works with SQL plugin or about how build SQL database.
So some of us stuck with older and simple plugin of Random Pools.

Re: foo_random_pools

Reply #334
Nice and useful plugin, but what about people who don't have any concept or idea about how works with SQL plugin or about how build SQL database.
They simply don't use the SQL feature.
So some of us stuck with older and simple plugin of Random Pools.
You're wrong. The SQL feature is only optional and the current version can be used without. There is no need to use an older version.

Re: foo_random_pools

Reply #335
Nice and useful plugin, but what about people who don't have any concept or idea about how works with SQL plugin or about how build SQL database.
They simply don't use the SQL feature.
So some of us stuck with older and simple plugin of Random Pools.
You're wrong. The SQL feature is only optional and the current version can be used without. There is no need to use an older version.

Ok. First of all, thank you for sharing this plugin and sacrifice your life time for develop this plugin.
That was misunderstanding of plugin requirements.

Re: foo_random_pools

Reply #336
just signed up to say what a cool plugin this is! being able to pick music in this way really feels like it's refreshed my library.

in the longer term I want to work out how to make a playlist that would walk along camelot numbers, but right now this tool has taken out so much of the legwork in selection. thanks!

Re: foo_random_pools

Reply #337
just signed up to say what a cool plugin this is! being able to pick music in this way really feels like it's refreshed my library.

in the longer term I want to work out how to make a playlist that would walk along camelot numbers, but right now this tool has taken out so much of the legwork in selection. thanks!
https://regorxxx.github.io/foobar2000-SMP.github.io/scripts/playlist-tools-smp/

Re: foo_random_pools

Reply #338
just signed up to say what a cool plugin this is! being able to pick music in this way really feels like it's refreshed my library.

in the longer term I want to work out how to make a playlist that would walk along camelot numbers, but right now this tool has taken out so much of the legwork in selection. thanks!
https://regorxxx.github.io/foobar2000-SMP.github.io/scripts/playlist-tools-smp/
Can you please stop hijacking this thread to make propaganda for your script, which is actually NOT a replacement for foo_random_pools?

Re: foo_random_pools

Reply #339
? I'm answering to an user request about camelot keys... wow... too much ego here (?)

EDIT: Let me be even more clear. It can be used along YOUR plugin, after playlist creation. So your comment was totally out of context and not justified at all.
Spoiler (click to show/hide)

Re: foo_random_pools

Reply #340
? I'm answering to an user request about camelot keys
By full quoting the user's post and just placing a link to the page of your script without any further comment? Already here you dropped in with hardly comparable results of your script, but ok.

... wow... too much ego here (?)
Not at all. I probably wouldn't even care, if you would not make the wrong statement on your script's page, that it is a replacement of foo_random_pools. The truth is, that it covers some functionality of foo_random_pools and some related additional functionality, besides a lot of unrelated functionality.

To be clear: I create all my components for my own needs in the first place and I share them, so that someone, who find them useful, can use them too. If nobody wants to use them, then it's also ok for me, although it's of course nice to receive some positive feedback like recently from @cheezopath and @Priest_1.

Let me be even more clear. It can be used along your plugin, after playlist creation.
And why didn't you write this before, instead just posting an uncommented link?

So your comment was totally out of context and not justified at all.
I don't think so, see above.

P.S.: If you want to continue discussing this, please send me a pm. This thread is not the right place to continue this.

Re: foo_random_pools

Reply #341
Spoiler (click to show/hide)