HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: regor on 2021-05-13 11:22:50

Title: Playlist-Tools-SMP
Post by: regor on 2021-05-13 11:22:50
Playlist-Tools-SMP (https://github.com/regorxxx/Playlist-Tools-SMP)
(https://img.shields.io/github/release/regorxxx/Playlist-Tools-SMP.svg) (https://github.com/regorxxx/Playlist-Tools-SMP/blob/main/CHANGELOG.md)(https://www.codefactor.io/repository/github/regorxxx/Playlist-Tools-SMP/badge/main) (https://www.codefactor.io/repository/github/regorxxx/Playlist-Tools-SMP/overview/main)(https://api.codacy.com/project/badge/Grade/e04be28637dd40d99fae7bd92f740677) (https://www.codacy.com/gh/regorxxx/Playlist-Tools-SMP/dashboard?utm_source=github.com&utm_medium=referral&utm_content=regorxxx/Playlist-Tools-SMP&utm_campaign=Badge_Grade)(https://img.shields.io/github/license/regorxxx/Playlist-Tools-SMP) (https://github.com/regorxxx/Playlist-Tools-SMP/blob/main/LICENSE)
A collection of Spider Monkey Panel (https://theqwertiest.github.io/foo_spider_monkey_panel) Scripts for foobar2000, built within a menu, which serves as a hub for 'usage examples' and shortcuts to the most requested foobar missing functionalities: remove duplicates by tags, revive dead items, check errors on tags, spotify-like playlist creation, advanced queries, etc.

(https://user-images.githubusercontent.com/83307074/116756221-471e8500-a9fb-11eb-96c9-2c269bf91fef.gif)


Features

(https://user-images.githubusercontent.com/83307074/116756215-44239480-a9fb-11eb-8489-b56a178c70f4.gif)

It's impossible to offer a complete list of the things that can be done with these tools, in a few words: anything related to playlist creation, sorting, library maintenance, automation, etc. But a readme for every utility can be found using the corresponding menu.

The sky is the limit once you use the current scripts to create your own buttons and tools. Currently contains pre-defined use-cases for these scripts:

The menus are highly customizable. They are created on demand according to the selected tracks or current playlist, and many entries can be added, removed or edited to suit your needs. Also if some scripts are missing, the menu is rebuilt skipping those entries (letting you to install selectively what you need).

(https://user-images.githubusercontent.com/83307074/116756213-4259d100-a9fb-11eb-9452-657389977f69.gif)

(https://user-images.githubusercontent.com/83307074/116756219-4685ee80-a9fb-11eb-80be-413f0e691dd4.gif)

Also integrates
 1. Search-by-Distance-SMP (https://github.com/regorxxx/Search-by-Distance-SMP): creates intelligent "spotify-like" playlist using high-level data from tracks and computing their similarity using genres/styles.
 2. Music-Graph (https://github.com/regorxxx/Music-Graph): An open source graph representation of most genres and styles found on popular, classical and folk music.
 3. Camelot-Wheel-Notation (https://github.com/regorxxx/Camelot-Wheel-Notation): Javascript implementation of the Camelot Wheel, ready to use "harmonic mixing" rules and translations for standard key notations.
 4. Menu-Framework-SMP (https://github.com/regorxxx/Menu-Framework-SMP): Helper which allows to easily create customizable and dynamic menus.

(https://user-images.githubusercontent.com/83307074/116759000-cebac280-aa00-11eb-8a81-9a450e13205a.gif)

Installation
Copy all files from the zip into YOUR_FOOBAR_PROFILE_PATH\scripts\SMP\xxx-scripts 
Any other path WILL NOT work without editing the scripts. (see images\_Installation_*jpg) 
For ex: mine is c:\Users\xxx\AppData\Roaming\foobar2000\scripts\SMP\xxx-scripts\... 
For portable installations >= 1.6: .\foobar2000\profile\scripts\SMP\xxx-scripts\... 
For portable installations <= 1.5: .\foobar2000\scripts\SMP\xxx-scripts\... 
Then load any button script into a SMP panel within foobar. 

There are buttons bars and independent buttons for each script and the playlist tools menu. 'buttons_playlist_tools_menu.js' is associated to the tools menu seen on the gifs, while '_buttons_merged.js' is the entire bar.

Download latest release (or nightly releases) at github:
https://github.com/regorxxx/Playlist-Tools-SMP
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-05-24 23:22:29
For the next release I'm working on macros. i.e. the ability to record and save multiple calls to different menu entries. For ex:
"My macro" -- DO  -> "Most played Tracks" then "Select All" then "Incremental key"
X

Then calling it...
X

It works in conjunction with the menu framework I have already shared, which lets you call menu entries by name, even when the menu has not been drawn. Therefore it's feasible to record where the user clicks when calling the menu, and store the different entries clicked for later usage.

At that point the sky is the limit.... for example, you can create a playlist with top rated tracks from 2021, filter playlist to only allow 1 track per artist, then select 1/4 of the playlist and sort it by key and select the rest and filter to only keep tracks with >4 rating. All that in just one click, totally configurable.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-05-26 11:00:00
Finally got macros fully working, with a configurable list, like other submenus previously done.
Only limitation:  Can not save user input on popups. Using entries which make use of those on macros will require user input every time they are called later.
X

To complement the use of macros, 3 new menus has been added: sort, select and cut playlist length.
Sort lets you do standard sorting (randomize, reverse, bpm, date or mood) but also advanced sorting which requires extra logic (by key using Camelot Wheel or by DynGenre).
The key logic was introduced previously, so no need to explain it again.
DynGenre sorting sorts tracks by genre/style considering a continuous line from Industrial music to Downtempo music. Thus similar styles/genres are grouped together. Uses notation described at 'dyngenre_map' on dyngenre_map_xxx.js.
X

The select menu lets you select specific parts of a playlist (like the third quarter), clear the selection, delete selected or unselected tracks, etc.
Obviously it can be used as a standalone utility, but it's real power comes when used along macros.
It allows to automate playlists manipulation along the other tools in the same macro without needing user input.
(for ex.. create a playlist by similar genre -> then select half of the tracks and sort then by incremental key -> then select the other half and sort them by decremental key)
X

The last tool lets you crop playlist length to the desired number, either starting from the beginning or the end of the playlist.
X

Since tools that create new playlists always change focus to those, it should be pretty easy to even create a macro which creates 10 playlist (similar by genre, by key, harmonic mix, etc.) at once with different settings, sortings, lengths, etc. linked -for ex.- to the currently playing track.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-05-26 21:22:31
Update the rest of the scripts too (specially the playlist manager) when used along this. The menu framework has a breaking change and it affects multiple scripts.

This release add macros and greatly expanded playlist and selection tools.

## [1.1.0] - 2021-05-26 (https://github.com/regorxxx/Playlist-Tools-SMP)
### Added
- Macros: Pre-recorded multiple calls to different menu entries. Save clicked entries by name.
- Select Menu: New menu meant to be used along macros. Select All / Clear selection. Select first / last track. Select random track (single) /random # tracks (multiple). Delete selected tracks / Non selected tracks. Select by halves. Select by thirds. Select by quarters.
- Cut playlist Menu: New menu meant to be used along macros. From start. From end. (multiple numbers)
- Sort Menu: New menu meant to be used along macros. Randomize, reverse, by BPM, by Mood, by Date, by Key (Camelot Wheel), by genre/style (DynGenre)
- Send playlist to playlist: New menu meant to be used along macros. Sends all tracks from current playlist to another playlist.
- Close playlist: New menu meant to be used along macros.
- Go to playlist: New menu meant to be used along macros.
- Find or create playlist: New menu meant to be used along macros.
- Send selection to playlist: New menu meant to be used along macros.
- Harmonic mixing: multiple debug additions.
- Search by Distance: New config menu.
- Search by Distance: Entry to compute and show graph on browsers.
- Search by Distance: Entries to descriptors.
- Search by Distance: New tool to find genre or styles not set on the graph (descriptors).
- Search by Distance: New entry to test the Graph on demand for errors.
- Search by Distance: New entry to test the Graph on demand against a set of paths predefined on 'music_graph_test_xxx.js'.
- Search by Distance: New entry to reset the Graph cache on demand.
- Search by Distance Cache: is now saved to a json file and reused between different sessions. Cuts loading time by 4 secs for 70K tracks on startup (!).
- Search by Distance Cache: gets automatically refreshed whenever the descriptors crc change. i.e. it will be recalculated with any change by the user too.
- Search by Distance Descriptors: Multiple new additions.
- Portable: Additional checks for portable installations.
### Changed
- Harmonic mixing: small changes and optimizations.
- Harmonic mixing: code for pattern creation moved to camelot_wheel.js.
- Harmonic mixing: code for sending to playlist moved to helpers and reused in multiple scripts.
- Search by Distance: updated with latest changes.
- Search by Distance Debug: Greatly expanded the debug functions to check possible errors or inconsistencies in the descriptors. It should be foolproof now.
- Split tools menu into 3 submenus: Playlist\Selection\Other tools.
### Removed
- Removed all lodash dependence and deleted helper.
### Fixed
- Search by Distance Descriptors: Multiple fixes on descriptors found with the new debug code.
- Buttons framework: icon bugfix.
- 'Top rated Tracks from...\From year' crash on input.
- 'Most Played Tracks from Date' crash.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-05-27 17:53:52
Next release will have fully configurable menus, which can be disabled/enabled by pressing shift + click on the button. Pressing on any entry will not load the associated menu anymore. (this in addition to only load entries when the scripts files are present, so they may be disabled either this way or removing the files)

The menu approach is more fine grained, since it allows to delete even parts of the same script (for ex. Only showing 1 Search Similar method).

X

Standard queries have been added too, just like regular foobar search. But entries can be saved, and reused later (like autoplaylist presets). With sorting. Dynamic queries have sorting added too now.

Finally, have added the possibility to add sorting entries to the sort menu (just like the regular foobar sorting). They work in conjunction to the advanced sorting logics (like key or grouping by similar genre), and are meant to be used along macros. Since macros allow to save any set of menu entries, they can now be used as an advanced alternative to autoplaylist and random pools component. Some examples of what you can do with a macro:
- You can set a query, a sort order, remove duplicates by any tag, filter and finally limit length to X tracks.
- Create 5 playlist, with different queries or sources, and use them as pools for a final playlist. (random pools has 2 main limitations: only 1 playlist associated to pools, and no way to mix specific pools to a final playlist -all or nothing-)
- Auto tag tracks found on a playlist (using Go to Playlist -> Select all -> Write tags).
- Send automatically all new added tracks on the library to a playlist for other processing. (Standard query 'Recently added' -> Send to -> ...)
- Etc.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-05-28 22:49:46
## [1.2.0] - 2021-05-28 (https://github.com/regorxxx/Playlist-Tools-SMP)
### Added
- Dynamic Queries: sorting can be set (on user configured entries).
- Alt Menu: Shift + L. Click on menu button allows to switch some entries functionality. Individual tools or entire submenus may be disabled/enabled. When all entries from a tool are disabled, the entire script files associated are omitted at loading.
- Standard Queries: new menu to apply standard queries and save user configured entries. Sorting too. (meant to be used along macros as an "autoplaylist" tool combined with other tools)
- Selection: added Global Playlist length as random # selection.
- Cut playlist length: added Global Playlist length as option (from start and end).
- Configuration: can set to which entries forced query is applied: Standad Queries, Dynamic Queries, Search same by tags. In any other case, it's always applied.
### Changed
- Macros: Entry name for last call and forced entries now omits ('main\' or the main menu name) when the entry resides on the main menu. i.e. just use the entry name for main menu entries, and submenu\entry name for the rest.
- Menu framework: updated.
- Legacy Sort: arbitrary sort entries can be added / removed. Standard foobar sorting. Can be undone.
- Advanced Sort: Can be undone.
### Removed
### Fixed
- Dynamic Queries: adding a new entry no longer executes it (thus creating a playlist too).
- Search same by tags: didn't apply user set playlistLength and forcedQuery to created playlists (using functions defaults instead).
- Standard Queries: didn't work when current playlist was empty.
- Cut playlist length: didn't allow undo.
- Send playlist's tracks to...: didn't allow undo.
- Remove tracks from...: didn't allow undo.
- Send selection to...: didn't allow undo.

Also updated the readme (on github) to explain much better what each thing does.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-05-31 17:40:28
## [1.3.0] - 2021-05-31 (https://github.com/regorxxx/Playlist-Tools-SMP/releases/tag/v1.3.0)
### Added
- Pools: playlist creation similar to Random Pools component. Multiple playlists sources (pools) can be set to fill a destination playlist. Configurable selection length per source, query filtering, picking method (random, from start, from end) and final sorting of destination playlist. Arbitrary presets can be added / removed.
- Pools: the library becomes a source when no playlist name is given. In that case the query is used to retrieve items from the library. At that point is equivalent to using a playlist as a source. i.e. you can mix sources using playlists and library, or even using multiple times the library as source. (This is obviously a shorthand to recreate first the source playlists with macros using queries)
- Pools: queries can also use dynamic queries format, where #TAG# is replaced with value for the currently focused track. i.e. it can create dinamic pools where the query changes according to the selection, thus not forcing an specific playlist type. A 'GENRE IS #GENRE#' source would translate into a rock, jazz, ... playlist according to current selecion. (This is obviously a shorthand to recreate first the source playlists with macros using dynamic queries)
- Presets: entire user preset list can be exported, for editing on a text editor or later importing in another Playlist Tools panel. (Only works for presets added from this release version and future ones)
- Presets: a presets json file can be imported, merging them with current ones (without overwritting).
- Readmes: Sscatter by tags readme added.
- Playlist history: New tool to traverse through the last active playlists by name or simply previous one (useful for macros since you can go back and forth between 2 arbitrary playlists without knowing their names). The tool tries to track playlists even if they are reordered after saving them to the history, only possible if names are unique.
### Changed
- Query filtering: some new default presets.
- Dynamic Queries...: now allow working with multivalue tags by default. i.e. 'GENRE IS #GENRE#' translates into '(GENRE IS Folk) AND (GENRE IS World)' automatically. When using using TF expressions, multivalue tags are not converted, thus the expression is executed 'as is'.
- Dynamic Queries...: standard queries may be added -only- to the end of a dynamic query expression. i.e. 'GENRE IS #GENRE# AND NOT (%rating% EQUAL 2 OR %rating% EQUAL 1)' translates into '(GENRE IS Psychedelic Rock) AND (GENRE IS Hard Rock) AND NOT (%rating% EQUAL 2 OR %rating% EQUAL 1)'. Merging both types of expressions in other positions will not work as intended.
- Dynamic Queries...: to work reliably with multiple dynamic queries on the same expression they must be enclosed on parenthesis, that way the code knows up to what point it must expand the queries. i.e. '((GENRE IS #GENRE#) OR (STYLE IS #STYLE#))' translates into '(((GENRE IS Psychedelic Rock) AND (GENRE IS Hard Rock)) OR ((STYLE IS Acid Rock) AND (STYLE IS Live)))'. Doing it in any other way will not work as intended.
- Query filtering\Filter playlist by... (query): also converts multivalue tags when using dynamic queries.
- Reset all configuration: resetting all no longer deletes all user presets, but asks to merge them with the default ones (or discards them). Presets can also be exported (previous change) before resetting and later re-imported to do essentially the same. If merging is not chosen, then a backup is automatically created.
- Readmes: all readmes entries now follow the same name of the menus automatically.
- Readmes: Dynamic Queries's readme updated with examples and usage rules.
### Removed
### Fixed
- Search same by tags...\By... (pairs of tags): was using default search paramaters no matter the input.
- Search same by tags...\Add new entry: error when remap tags was empty.
- Query filtering\Filter playlist by... (query): last argument used was not being saved.
- Configuration: setting global forced query or playlist length only updated the properties panel, thus not applying the changes until next script reload.
- Missing font fontawesome-webfont (just cosmetic arrow on button).
- Advanced Sort...\Incremental genre/style (DynGenre): Missing sort_by_dyngenre.js file, so menu entry was missing on previous release.
- Changing Global Forced Query via menus also changed Global Playlist Length.



Recommended to use 'Configuration\Reset all configuration...' after installing (to reload the new presets) (*). You will lose any user configured entry on the process (make a backup of the properties panel if needed).

From now on, user presets can be exported and maintained when using "Reset all", thus making easier to update the panel in the future. Or sharing presets, etc.

3 main changes have been added:
-    Pools (i.e. a total replacement of Random Pools component with many more features). They can obviously be expanded even more with macros.
-    Dynamic queries improvements: see changelog for details... but essentially they allow now complex queries and even multivalue tags expansion. 'GENRE IS #GENRE#' translates into '(GENRE IS Folk) AND (GENRE IS World)'
-    Presets: already mentioned at top.
Title: Re: Playlist-Tools-SMP
Post by: loz on 2021-06-01 13:22:51
Am I correct in assuming that all of your scripts go into the root of 'xxx-scripts' instead of subfolders like 'xxx-scripts\Playlist-Tools-SMP'? If so, that seems to me like that could be problematic in the long term just from a management/updating perspective.

Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-01 15:51:20
Am I correct in assuming that all of your scripts go into the root of 'xxx-scripts' instead of subfolders like 'xxx-scripts\Playlist-Tools-SMP'? If so, that seems to me like that could be problematic in the long term just from a management/updating perspective.


As you note they are all added to the same root (which is only used by my scripts).

The other scripts (playlist manager, world map) use different files, so there is no mixing, except the main helper which is shared between all of them (and I don't plan to change it more). I know it could bring some problems (if I edit the helper, update a repository but no the rest, and someone installs the oldest files over the new ones, thus using an old helper version) , but right now it makes my life easier so... I can not care less about it since these are clearly WIP things updated every week.

At some point I will simply split the main helper to fix that, use packages, different folders or simply create an additional repository for the helpers, so they are always up to date and a requirement for any other script. The last option is the most probable one I will take, since all the panels require the menu framework, the buttons framework and the main helper.

PD: Also the change-logs clearly indicate if I edit one of those helpers and which things could break if mixing files. And I try to follow semantic versioning, so no such changes should happen between minor releases.

PD2: I would love to use packages but it becomes a nightmare when updating things every week and it totally breaks the buttons bar and the idea of having selectively installed things just by deleting/adding files. Or having other people using my scripts as a base for their own ones. Packages are a zip not meant to be touched. So.. I'm more inclined on the additional repository. (open to suggestions though)
Title: Re: Playlist-Tools-SMP
Post by: loz on 2021-06-01 16:18:01
I know it could bring some problems (if I edit the helper, update a repository but no the rest, and someone installs the oldest files over the new ones, thus using an old helper version)...
This is my point. It becomes much easier to mix up files and much harder to troubleshoot if everything is in the same root directory. Secondly, if all the scripts are in subdirectories a user can just checkout the repositories from git and then just git pull each subdirectory when updates are available.

create an additional repository for the helpers
That is definitely a good solution, but it still doesn't completely solve the problem of everything being convoluted in the root directory. These scripts really need some sort of better organizational structure if your project is going to continue long term and evolve, and it is best to keep that in mind earlier on than changing it later when your project is more mature.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-01 16:30:32
Quote
This is my point. It becomes much easier to mix up files and much harder to troubleshoot if everything is in the same root directory. Secondly, if all the scripts are in subdirectories a user can just checkout the repositories from git and then just git pull each subdirectory when updates are available.
I don't see whay you can not do that right now? I would not really advise at all to do that with SMP scripts, which sometimes require a bit of thinking  ::)  If someone wants to just pull my changes without checking the changelog can do it, but it will probably break things whether I add 20 subfolders more or not. That's why I add the releases, I don't expect people doing that.

create an additional repository for the helpers
That is definitely a good solution, but it still doesn't completely solve the problem of everything being convoluted in the root directory. These scripts really need some sort of better organizational structure if your project is going to continue long term and evolve, and it is best to keep that in mind earlier on than changing it later when your project is more mature.
Can't say more... Only planned change is to move scripts without buttons to another subfolder, but that's all. That would mean only 3 or 4 scripts in the root folder (if that's what you mean). But I will simply not move the Playlist manager to a directory, and then Playlist tools to another, and then...  Anything which can be loaded within foobar as a panel will be in the main directory (which will be 3 or 4 files, not the 20 files I have right now yep)
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-01 17:03:56
This is the current structure for future releases, that has the planned change I wrote (most files on 'Main').

X

X

Also ngraph and typo will be moved to helpers-external. Good enough?
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-03 10:27:28
For people using All Music and Last. FM tags, here is a pack of presets which use those tags that can be imported using the config menu (they will be included on next releases)

Feel free to share your own presets too, since that's the point of being a tool fully configurable  :) (and I plan to have multiple presets pack which can be installed as addons)

Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-03 18:54:45
And another 5 presets for pools, they use standard (*) mood, genre and bpm tags. (in next release pools will be able to use the global forced query too, removing that way low rated tracks, etc. easily)

To install, just use the import menu entry:
X

(*) Neither All Music, nor Last FM tags. But the standard ones you got at picard and found in any program (mood, genre, bpm). If you want to use the others, copy the tags with any editor to standard tags or edit the presets -before importing- by yourself replacing "MOOD" with "ALL MUSIC...", etc.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-07 19:29:39
v1.4.0 - File restructuring and cleanup + Presets, shortcuts & bugfixes (https://github.com/regorxxx/Playlist-Tools-SMP)

2 new experimental features (shortcuts and include other scripts), along the file restructuring discussed, new presets and many bugfixes.

## [1.4.0] - 2021-06-07
### Added
- Search by Distance: 4 sets of buttons, one for each method: GRAPH, WEIGHT, DYNGENRE + ONE CONFIGURABLE (method at properties). (This in addition to the fully customizable buttons)
- Shortcuts: Some shortcuts have been added (global shortcuts without requiring panel to be in focus). Are shown on the related menu entries tabbed to the right. Experimental feature, read the popup before activating it at config menu.
- Other tools\Include Scripts: easily include ('merge') multiple SMP scripts into the same panel, thus not wasting multiple panels. Useful for those scripts that don't require any UI, user interaction,... like scripts which set the main menu SPM entries (File\\Spider Monkey Panel). Experimental feature, read the popup before activating.
- Configuration: pools have toogable forced query now.
- Presets: All Music and Last FM presets which use their genre/mood tags (for Search by tags, Dynamic Queries, Playlist Filters and Pools). Pools moods presets (Happy Mix, Sad Mix, Angry Mix, Chill Mix and Slow Chill Mix). Pools genre presets (Rock mix, Hip-Hop mix, etc.).
- Macros: 2 macros examples to test all tools (with or without input). Since all input box have defaults, you can simply press enter and process all without reading for testing.
### Changed
- Search by Distance\GRAPH: mean distance is now also divided by the number of genre/styles of the reference track. That should give more results for tracks with too many tags, while not changing so much for the rest. Distance filters have been updated accordingly in all buttons to reflect the change (and users should do the same in their customized buttons).
- Search by Distance: All buttons have not needed properties deleted to not confuse users about things changed on properties not being reflected on the buttons.
- Buttons framework: updated for better shortcuts and macros compatibility.
- Helpers: Moved all external libraries to 'helpers-external'.
- Helpers: Split 'helpers_xxx.js' file into multiple ones for easier future maintenance.
- Moved all SMP scripts without UI (those not meant to be loaded directly on panels) to 'main'.
### Removed
### Fixed
- Search Same By: button did not work correctly due to bad property parsing.
- Search Same By: bypass query checking if current track has no tags configured on new entry addition. Previously it was not saved due to checking error.
- Playlist manipulation\Harmonic mix: was not working on entire playlist, only on selection in both cases.
- Search by Distance: crashes when trying to access non present properties on the arguments (found while applying the previous changes).
- Search by Distance: crash when sharing cache between 2 panels due to a typo.
- Search by Distance: crash when pool was smaller than set playlist length.
- Pools: using random picking method, sometimes the last element was omitted, thus resulting on (total length - 1) tracks per source choosen.
- Pools: when only 1 track is retrieved from a source, skips picking methods and adds it directly to the final playlist. Previously it was simply skipped (due to previous bug).
- Pools: not working when current playlist was empty. It tried to check for dynamic queries even when there was none, thus failing wihtout a track to check against.
- Pools: random picking method was not really random due to using sort + random method. Using an array shuffle now instead.
- Select...\Select random...: not really random due to using sort + random method. Using an array shuffle now instead.
- Search by Distance: in key mixing and random picking not really random due to using sort + random method. Using an array shuffle now instead.
- Harmonic mix\Harmonic mix from...: not really random due to using sort + random method. Using an array shuffle now instead.
- Tooltip: missing new line before shortcuts tips.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-09 22:41:39
Finally the integration with Playlist Manager is working, and pools will be able to use either playlists within foobar as source or playlist files in folders tracked by any Playlist Manager instance... This feature allows to use virtual playlists as containers, where you can easily collect tracks (since Playlist Manager allows to send tracks directly to a file without loading it) to be used later on pools without polluting the UI with tons of dummy playlists.

It would be an alternative to tagging files with custom tags (like 'Rock Ballads') to then create queries to send those tracks to playlists (which could also be done with pools). Instead, you could simply send the tracks to a playlist named 'Rock Ballads' and use it later as a source, while not having the playlist loaded within foobar but just on the manager. Obviously there are many other uses (like having an arbitrary number of playlists used as sources: for ex. a mix of all Summer playlists of the last 10 years which obviously could be archived as m3u8 files but makes no sense to have them loaded within foobar polluting the UI).

In resume, sources may be a mix of any of these 3: library (query filtering), playlists within foobar (query filtering optional) and playlist files (idem).

Next release will also have some quality of life changes for presets, with descriptions popups before importing, summary of menu entries which will be added, etc. along better documentation for some tools

A playlist file within a manager instance is used as source using Pools tool. Duplicated tracks are omitted, so only 5 tracks are used (although the total reported count is 12). On the example, 1 more track is taken from the library.
X

An example of a preset created within foobar and exported to json. Used on the screenshot above. Note the queries reported on the console an the ones here doesn't match because a global forced query is added to all sources (configurable).
X
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-10 22:23:35
Continuing with the presets, search by distance buttons will be able to use pre-defined sets of tags (saved as json) instead of a track as source for playlist creation. That's exactly what MusicIp's moods (https://www.spicefly.com/article.php?page=musicip-moods)did and here is called "themes". I plan to expand that functionality allowing to save tracks as "themes" on demand and also allow using a playlist as a source (instead of a json file)... but right now it simply uses a json file which emulates one track.

Themes may be added to the properties panel of custom search by distance buttons either as a file path or directly as a JSON string. Whenever that property is set, the theme is used as source instead of the current track.

To make it easier to work with them, custom buttons now have a contextual menu called with shift + L. Click which lets you select any theme file in the presets folder or 'none' (current track standard behavior). Themes may be created easily with any text editor, allowing to create your own sets of buttons for custom playlist creation. An example file is provided.

X

X

X

Finally, continuing the pools feature, search by distance's output may be used as a source (apart from playlist and Library queries), greatly surpassing what Random Pools component and MusicIp allow. Setting a pool this way requires importing a preset file, since it's not viable to add so many arguments via popups.

Allows any of the 3 methods (GRAPH, WEIGHT and DYNGENRE) and uses the previous feature (Themes) along another one "Recipes". Themes would be the "virtual track" used as reference and Recipes work the same than MusicIp's recipes (https://www.spicefly.com/article.php?page=musicip-recipes) allowing to define how the playlist should be created (the arguments passed to 'do_searchby_distance').

After applying the recipe and theme, under the hood, it does the same than using any search by distance's button or menu entry named Search similar by [graph, ...]. But instead of sending the resulting tracks to a playlist, those tracks are used as source for the pool. Then they are processed the same than any other source on the pool. Any type of source can be mixed too (i.e. using a playlist named 'Rock', a playlist file 'summer.m3u8' in the manager, a library query '%RATING% GREATER 3' and the output of SearchBy to get tracks similar by key and genre to a given reference.

X

Recipe and pools preset example are provided to test it.

In theory the same behavior could be emulated using "macros" feature, creating first the playlist with the appropriate tool, then selecting tracks by any desired order, sending them to the final playlist and repeating the process as long as needed. The difference here is the use of recipes and themes, which allow easy customization and the possibility to use them in multiple presets. Also recipes allow far more detailed config than using menus + macros, since many advanced features are only used/configurable on custom buttons and recipes may set the same arguments than those. And themes allow to create playlists without a reference track, while the menus for [graph, ...] are always associated to a track.

In the end, both tools are complementary and have their uses. Pools is meant as a direct replacement of Random Pools and MusicIp's, offering many more possibilities than them. Macros is a general tool to automatize anything, but obviously is the "hard" way to do it.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-15 17:33:21
v2.0.0 - Improved pools and Major buttons rework (https://github.com/regorxxx/Playlist-Tools-SMP)
DO NOT COPY OVER PREVIOUS INSTALLATION (*). Remove all previous panels within foobar and follow the instructions at the readme and installation tips. You can safely delete all files at 'xxx-scripts' first. If you are using other scripts, then download their latest version too and reinstall (Playlist Manager and World Map can be updated without de-installing their panels first, i.e. you can maintain all your settings).

See changelog for all changes.

    Playlist manager integration for pools.
    Search by distance integration for pools.
    New presets for pools.
    Recipes and themes for Search by distance.
    Major buttons rework with easy to install and configure toolbars which allow to add\remove buttons on the fly.

(*) File structure has changed and now all buttons are meant to be used with a main toolbar file for easy config. Not doing so will lead to missing features.


## [2.0.0] - 2021-06-15
### Added
- Playlist Manager Integration: Listeners to retrieve tracked playlist paths from Playlist Manager panels.
- Pools & Playlist Manager Integration: May now use playlist files tracked by Playlist Manager panels as source. i.e. Playlist A would match first a playlist within foobar with same name, then a playlist file with matching '#PLAYLIST:Playlist A' tag and finally anu playlist file named 'Playlist A.m3u8'. Autoplaylists are excluded (use queries instead) and fpl files too. This feature allows to use virtual playlists as containers, where you can easily collect tracks (since Playlist Manager allows to send tracks directly to a file without loading it) to be used later on pools without polluting the UI with tons of dummy playlists.
- Pools & Search by GRAPH\WEIGHT\DYNGENRE: May now use the output from 'Search by (method)' as source, setting source name as '_SEARCHBYGRAPH_X', '_SEARCHBYWEIGHT_X', etc. (where X is any number). Therefore it allows intelligent playlist creation instead of using queries for the pool. Multiple sources can be set this way (beware of computing time) and mixed with the other sources (library and playlists). This new source may only be used by creating a preset pool with a text editor, since it requires to set so many arguments that is not reasonable to do it via popups. 'recipe' and 'theme' (see below) keys must be set when using this type of source (a recipe may force a theme too). Both may point to a filename (i.e. another preset like themes -see below-) or contain the arguments object. Examples are offered in the presets folder for all use-cases.
- Search by GRAPH\WEIGHT\DYNGENRE: now allows user configurable menus (which can only be added using the properties panel or loading presets). Reasoning: it's not practical to add so many popups to just set a new entry but it makes sense to be able to add new entries to the tool... so it's left to the user to add them manually. The presets may link to recipes and themes as arguments too (see below).
- Search by distance: Recipes presets may be used to set variables of the function. Whenever the argument is set, it's used instead of related property. Custom button now allows to use a recipe file. Once set, button would always use the recipe as arguments instead of the properties variables. A recipe may force the use of a theme.
- Search by distance: custom button now allows to set the recipe file used by pressing Ctrl + L. Click. 'None' would use the current properties variables, which is the default behaviour.
- Search by distance: themes presets may be used as reference instead of tracks. Whenever the argument is set, it's used instead of the selection. Custom button now allows to use a theme file. Once set, button would always use the theme as reference instead of the current selection.
- Search by distance: custom button now allows to set the theme file used by pressing Shift + L. Click. 'None' would use the current selection, which is the default behavior.
- Search by distance: custom button now allows to create a theme file using the currently focused track's tags.
- Configuration\Search by distance: new entry to create a theme file using the currently focused track's tags.
- Readmes: for Presets usage, Global Shortcuts, Include Script, Search by GRAPH\WEIGHT\DYNGENRE (specific readmes for each method) and Recipes\Themes.
- Presets: new presets for Search by GRAPH\WEIGHT\DYNGENRE.
- Buttons: new 'buttons_toolbar.js' toolbar which can be customized without editing the js file. Allows to enable/disable buttons -even add multiple copies- on demand and customize toolbar background color (L. Click on the bar).
- Buttons: new 'buttons_playlist_history.js' button. On click switches to previous playlist (since it's a switch, pressing it indefinitely always switches between the same 2 playlists). Shift + L. Click shows the entire list of previous playlists.
### Changed
- Popups: all titles renamed to script name + sub menu name.
- Presets: current date is added as description when exporting user presets or creating a backup.
- Presets: now include a description ('readme' key) which is shown after importing them. Property associated is also shown (the one linked to each configurable menu), along the entries -ny name- which will be imported. Presets are not imported until popup is accepted.
- Search by distance: shows on console the track or theme used as reference (name and path).
- Search by distance: custom button code cleanup and improvements on name changing.
- Search by distance: custom button tooltip shows the theme and recipe being used, along tips to change them.
- Readmes: updated pools readme with latest changes.
- Data: json file for presets is now formatted to be readable.
- Portable: when properties are set for the first time, now use relative paths on profile folder for portable installations (>= 1.6). When possible, any other stored path is also stored as relative paths (for example themes or recipes on buttons).
- Buttons: icons to all buttons.
- Buttons framework: skip icon drawing if font is not found.
- Buttons framework: allow a menu when clicking on the panel (and not on buttons).
- Helpers: warn about missing font on console if trying to load a font and is not found.
- Code refactoring and cleanup.
- Split all buttons into examples, toolbar and buttons folder. 'buttons_toolbar.js' is now the main script -in root folder- which can be loaded within a panel for easy configuration of buttons from this repository or any other. 'buttons_playlist_tools.js' is the independent button.
### Removed
### Fixed
- Presets: after resetting all config, presets were not being deleted.
- Presets: duplication after adding multiple presets.
- Pools: crash removing entries due to a typo.
- Search by distance: setting both genre and style weights to zero output nothing with GRAPH method instead of using the values for the graph and not for weighting.
- Search by distance: when playlist length is set to Infinite, warnings are no longer shown about number of tracks being less than it (which obviously always happened).
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-15 17:48:46
A small gif to show how the buttons work now:
X

Everything is now configurable on the bar, either with menus or properties. If you want multiple copies of the same button, just add it again. Buttons can be repositioned and the background is customizable.

Playlist tools also has the enable/disable menu to switch functionality of its entries.

And search by distance buttons are fully configurable with either themes, recipes or individual arguments set on menus to your liking. Recipes may link to (forced) themes. And pools may link to both. So presets can be created inheriting multiple files easily.

This should be the end of the file restructuring, making it easier to update thins on the future too.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-17 16:24:12
v2.0.1 - Bugfixes and shortcuts/query improvements (https://github.com/regorxxx/Playlist-Tools-SMP)
Minor bugfixes and improvements. See changelog.
Recommended to call 'Configuration\Reset all configuration...'  to load the new changes. You can maintain your presets (see the popups), so only new changes are applied ;)
Don't forget to apply 2.0.0 recommendations too if updating from a earlier version!


## [2.0.1] - 2021-06-17
### Added
- Shortcuts: now saved as json file (at '.\profile\js_data\playlistTools_shortcuts.json'), to be easily configurable. Shortcuts can be arbitrarily added, changed or deleted. Menu entries linked to a shortcut will show the keys in their name tabbed to the right. See popup when enabling them. New entry to open shortcuts file.
- Standard queries...: New default standard queries to retrieve entire library with or without forced query. Restore defaults to load them. (To be used with macros)
- Macros: New default macros to check all library tags (automates retrieving entire library and using check tags). Restore defaults to load them.
- Global Forced Query: 'Playlist Manipulation\Query filtering' is now also added to the list of toogable forced query application.
### Changed
- Queries behavior on Standard queries, Dynamic queries, Query filtering and Pools menus is now unified. 'ALL' always retrieves entire source, no matter if global forced query is enabled or not. Empty retrieves source filtered with forced query (or behaves as 'ALL' if it's disabled). Updated related readmes with the changes.
- Config menu: reworked a bit the menus for Global forced query, Shortcuts and presets.
### Removed
### Fixed
- Check tags: Fixed typo on dictionaries path after file restructuring on latest release. Recommended to reset folder calling 'Other Tools\Check tags\Configure dictionary...\Sets dictionaries folder...' and deleting the current value. Then the default one will be restored.
- Duplicates and Tag filtering:  User settings (tags and number allowed) were not being loaded at startup.
- Standard queries...: menu error when using a query with 'ALL' and global forced query was enabled.
- Typo on 'Top rated Tracks from...\From year...'. Adjusted 'Test Tools (with input)' macro with the change. Recommended to restore defaults for macros to apply the change (and change any user-set macro with that entry).
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-20 22:01:56
v2.0.2 - Symlink zip decompressing hotfix (https://github.com/regorxxx/Playlist-Tools-SMP)
This is just a copy of the previous release with replaced symlinks, using duplicated files instead. Some file archivers (like 7zip) don't manage symlinks well and gave errors decompressing the zip... so this fixes it. PeaZip works fine, but since 7zip is pretty popular...

There are no other changes, so if you had no problems using the previous release, can be skipped


## [2.0.2] - 2021-06-20
### Added
### Changed
- Duplicates of main buttons files are now on the root, instead of using symlinks. Some file archivers, like 7zip, did not decompress correctly the releases...
### Removed
### Fixed

.
Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-06-25 18:52:58
A problem about playlist revive.....When I move a file from a partition to another partition , let's say D\music to E\music (obviously the folders are included in the media library) or when I rename a folder this is what happens

Playlist Tools - Other Tools - Playlist Revive - Replace dead items on selection (or if I use Replace dead items on current playlist), I have this kind of errors :

Query not valid. Check query:
(title IS I Will Always Love You) OR (undefined)

I don't know why but I can't revive dead items in a playlist....

Problem number 2.
Most played tracks from.....from last -- 1 week (for example)
It seems that songs that have a high playcount are favoured, so they get at the top of the playlist
I'll give you this example: Let's say that in the last week I have listened Bon Jovi - Always , ONLY once, BUT the total playcount for this song is 30.
This week I also listened Madonna - Frozen , 10 times BUT the total playcount for this song is 12.
The conclusion:  Most played tracks from last week will look like this :
Bon Jovi - Always (playcount in a week :1 , total playcount : 30)
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
I think it should be exactly the opposite, like this :
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
Bon Jovi - Always  (playcount in a week :1 , total playcount : 30)

I tested on a few songs and it's the same. This way Most played tracks from.....from last -- 1 week (or other period) it's a bit useless because I'll see songs with high playcount at the top (obviosly if I played those songs with high playcount in the selected period), it doesn't reflect the reality. Maybe you can fix it
As I said in the other post , I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-26 11:44:06
Ups missed the comment. Sorry.

Quote
A problem about playlist revive.....When I move a file from a partition to another partition , let's say D\music to E\music (obviously the folders are included in the media library) or when I rename a folder this is what happens

Playlist Tools - Other Tools - Playlist Revive - Replace dead items on selection (or if I use Replace dead items on current playlist), I have this kind of errors :

Query not valid. Check query:
(title IS I Will Always Love You) OR (undefined)

I don't know why but I can't revive dead items in a playlist....
Will check it since that's clearly a bug! The second query is the MD5 of the file, you are probably using MP3s (or a format without audio crc checksums), they have no MD5, so the query becomes undefined and throws a query error just after testing it.

It was supposed to skip that tag, but I clearly made a mistake. Will be solved on next release, thanks!

Quote
Problem number 2.
Most played tracks from.....from last -- 1 week (for example)
It seems that songs that have a high playcount are favoured, so they get at the top of the playlist
I'll give you this example: Let's say that in the last week I have listened Bon Jovi - Always , ONLY once, BUT the total playcount for this song is 30.
This week I also listened Madonna - Frozen , 10 times BUT the total playcount for this song is 12.
The conclusion:  Most played tracks from last week will look like this :
Bon Jovi - Always (playcount in a week :1 , total playcount : 30)
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
I think it should be exactly the opposite, like this :
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
Bon Jovi - Always  (playcount in a week :1 , total playcount : 30)

I tested on a few songs and it's the same. This way Most played tracks from.....from last -- 1 week (or other period) it's a bit useless because I'll see songs with high playcount at the top (obviosly if I played those songs with high playcount in the selected period), it doesn't reflect the reality. Maybe you can fix it
As I said in the other post , I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed
I understand you use both statistics plugins (the one that comes with foobar, and the advanced one which adds playcounts stamps). That tool only works if both are installed, there is a check to disable the tool if they are not found... but just to be sure.

Now you are seeing the tracks are sorted by total playcount,  instead of playcount on the period. Are you are right, I coded it that way (the final sorting after getting the tracks), which It's clearly a typo. Again, will be fixed on next release.
Thanks for both reports
Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-06-26 16:29:58
regor, good news, I solved the mystery with playlist revive. After I read your comment I looked more closely at the audio files. I tested only on flac files (they had tags for Artist, Title, and other tags) I didn't used mp3
I was confused because if you do right click on a file in foobar - Properties - Details , if you look at the panel at section General , you have Audio MD5.
So, I thought, ohh, it's ok. But it wasn't . If you use foo_audiomd5, you'll have in metadata AUDIOMD5...
After I scanned the files with foo_audiomd5, it works (AUDIOMD5 was added in metadata) the dead items in the playlist are replaced correctly
So, this is why these error reports appearred :
Query not valid. Check query:
(title IS I Will Always Love You) OR (undefined)

and in the console I had this:
Called: Playlist Revive\Replace dead items on selection
Found 1 dead item(s) on active playlist: test
query_combinations(): tagsArray [] was null, empty or not an array

So, if I understood correctly AUDIOMD5 must be present in metadata ( using the component foo_audiomd5), in all the files in the library.

Maybe its possible to add a little warning in the error report about this, to be more explicative, something like this : "files must have a value for AUDIOMD5 tag , scan the files using foo_audiomd5 component " or something else :)

"I understand you use both statistics plugins (the one that comes with foobar, and the advanced one which adds playcounts stamps). That tool only works if both are installed, there is a check to disable the tool if they are not found... but just to be sure."

Yes, I use both plugins (Playback Statistics and Enhanced Playback Statistics). Most Played Tracks in a Year works great  , problems were only with Most played tracks in a period of time (weeks, days), as I said



Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-26 18:23:10
No no... Audio MD5 tag is used for query creation, if and only if it's found. It was an "extra" if you also use that plugin (which I do), because it would find the files faster.

But that it's only used at query creation, and should have been skipped if not found. That's the error. Therefore there is no need to warn about foo_audiomd5 since it's not a requirement at all (BUT I could add a note in the readme about it being useful for faster matching).

At a later point I compare md5 info (from file), which as you noted, it's found on the details panel. And only exists for some formats. When there is no md5 info, it simply matches file size. If there is not a match, then it compares tags. and computes a similarity. So... the audio md5 tag is not used at all at later points.

The tools allow to only replace with exact matches or by some similarity threshold. That's why there are so many entries on the tool. Also the "simulate option" just simulates the processing, but does nothing. I prefer to do that always before editing a playlist so I know what will be going on. And finally the console always shows the tracks changed, contrary to what the plugin revive did (which changed things without telling you what was changed).

By the way, there is a readme for every tool at config/readmes. If something doesn't work as the readme says, feel free to report it since that's probably a bug. (and I will add some of these comments there too).
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-26 18:40:43
Was a one line problem.

Line 56 -> (filter empty queries)
Code: [Select]
const query = query_join(queryArr.filter(Boolean), "OR");

Feel free to totally delete the AUDIOMD5 tag if you don't use it. It's not required at all.

And this will be the readme, hope it's clearer now.
Quote
Alternative to foo_playlist_revive.
Playlist Revive makes dead items in a playlist alive again by replacing them with the matching ones in media library.
A handy utility for those who often move or rename their media files/folders.

Querying:
   - TITLE
   - AUDIOMD5 (tag from foo_md5 if found) (*)
   - MD5 (tag from foo_md5 if found) (*)

Matching (rules by order):
   - Audio MD5 (file info) (Exact Match) (*)
   - AUDIOMD5 (tag from foo_md5 if found) (Exact Match) (*)
   - MD5 (tag from foo_md5 if found) (Exact Match) (*) (**)
   - TITLE + Length + Size (Exact Match)
   - Tags (Similarity)

Usage:
   - Select the tracks in the relevant playlist.
   - Apply script (using a button, menu entry, main menu SMP, etc. associated to it).
   - The tools allow to only replace with exact matches or by some similarity threshold.
   - 'Simulate' options just simulates the processing, does nothing but reporting you -planned- changes.
   - The console always reports the tracks changed and info, contrary to what foo_playlist_revive plugin did.

(*) Audio MD5 is a feature of some formats which store audio checksums as part of their file info.
That's different, although similar, to a tag named AUDIOMD5 (or MD5) by foo_md5 plugin.
On the first step -querying-, the tag is used if available (it's not a requisite).
On the second step -matching-, the file info is used if available (for some formats), if it's not found
then it tries the tag counterpart. If it's not found it tries the next rule, ...
(**) foo_md5 plugin lets you configure the tag name. I use those 2 as possible names to look for.
Plugin can be found here: https://foobar.hyv.fi/?view=foo_audiomd5
Note that for formats having CRC checks (like flac), you can also get an md5 tag with mass tagger scripts:
$info(md5) -> copy -> AUDIOMD5
You can find such preset at '.\presets\Masstagger'

Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-06-27 02:26:35
 Yes, now it makes sense, thanks for explaining. I downloaded the file and I tested again, this time it works ( even without  AUDIOMD5, as you said) but another problem appears : the other songs in the playlist disappear,  only the fixed song remains.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-27 16:54:22
Songs not "dead" are removed or the dead songs not revived are removed from the list?

Can't reproduce any of those cases. Have tried with a playlist with:

- Tracks on library.
- Dead items but with alternative on library.
- Dead items with no match.

After reviving playlist, with selection or entire playlist, all items are the same on the playlist. Dead ones are substituted, but that's all. The one without match is left, the same than the other tracks
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-27 19:52:41
A problem about playlist revive.....When I move a file from a partition to another partition , let's say D\music to E\music (obviously the folders are included in the media library) or when I rename a folder this is what happens

Playlist Tools - Other Tools - Playlist Revive - Replace dead items on selection (or if I use Replace dead items on current playlist), I have this kind of errors :

Query not valid. Check query:
(title IS I Will Always Love You) OR (undefined)

I don't know why but I can't revive dead items in a playlist....

Problem number 2.
Most played tracks from.....from last -- 1 week (for example)
It seems that songs that have a high playcount are favoured, so they get at the top of the playlist
I'll give you this example: Let's say that in the last week I have listened Bon Jovi - Always , ONLY once, BUT the total playcount for this song is 30.
This week I also listened Madonna - Frozen , 10 times BUT the total playcount for this song is 12.
The conclusion:  Most played tracks from last week will look like this :
Bon Jovi - Always (playcount in a week :1 , total playcount : 30)
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
I think it should be exactly the opposite, like this :
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
Bon Jovi - Always  (playcount in a week :1 , total playcount : 30)

I tested on a few songs and it's the same. This way Most played tracks from.....from last -- 1 week (or other period) it's a bit useless because I'll see songs with high playcount at the top (obviosly if I played those songs with high playcount in the selected period), it doesn't reflect the reality. Maybe you can fix it
As I said in the other post , I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed

Revising the code of top tracks from... everything seems to be right. They are indeed sorted by playcount, but the count is taken from the period.

Could you send me 2/3 tracks with those tags (with play timestamps) to check? I'm currently on a system without enhanced statistics, so can not check that part!
Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-06-27 20:14:40
This is what I do : I make a playlist with songs from library
Then I move a song in a new folder that I create (the created folder is in library, on the same drive) , or I just simply move a song from one drive (let's say D\Music) to another drive (E\Music), both on library

Songs not "dead" are removed . The only song that remains in the playlist is the revived item( song) . So, the ''dead" song is successful
revived, BUT the other not dead songs are removed . All songs are in library,


"- Dead items with no match.""

If I try this all songs remain in the playlist , but obviously it's useless
I've sent you a message with a gif


Yes, I'll send you 2 tracks in 20-30 minutes
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-27 21:03:40
The playlist revive is done now. Thanks for the gif... you see selecting the culprit or all changed totally the behavior, would have not found the problem without it.

Check latest file :)

PD: has also fixed another related bug
Quote
- Other tools\Playlist Revive: undefined queries when file didn't had AUDIOMD5 tag (from foo_md5) are now skipped. The plugin was never a requirement, but an extra to find faster matches by query. If you use the plugin, their tags will also be used; otherwise, the tool queries by title and compares md5 file info first (if avalaible) or file size (for exact match) and then all tags to compute similarity.

- Other tools\Playlist Revive: reviving selection (instead of entire playlist) no longer outputs only the selected items, but recreates the entire playlists; dead items with matches are replaced and dead items without a match or other items are left untouched. Current item selection will also remain selected after processing.

- Other tools\Playlist Revive: bug on reviving All playlists which made only active playlist to be actually changed (the rest was analyzed but not touched).
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-06-28 11:56:39
This week I also listened Madonna - Frozen , 10 times BUT the total playcount for this song is 12.
The conclusion:  Most played tracks from last week will look like this :
Bon Jovi - Always (playcount in a week :1 , total playcount : 30)
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
I think it should be exactly the opposite, like this :
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
Bon Jovi - Always  (playcount in a week :1 , total playcount : 30)

I tested on a few songs and it's the same. This way Most played tracks from.....from last -- 1 week (or other period) it's a bit useless because I'll see songs with high playcount at the top (obviosly if I played those songs with high playcount in the selected period), it doesn't reflect the reality. Maybe you can fix it
As I said in the other post , I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed

Solved. Was a really stupid typo I made at some point while refactoring the code at a later release... I was substracting current date to played dates, instead of doing the opposite. So it was in fact reporting tracks less played -but at least played once- in the given period hahahaha (*). Resulting in playcounts -within the given period- from low (top) to high (bottom). Having an absolute playcount track at top was just a coincidence on your library.

Btw the files did not prove useful at all because the statistics are saved within foobar config and not the files. But anyay it's solved now.

Replace at .\main\top_tracks_from_date.js

(*) Not sure if such function has any utility btw. Usually we want to find the most played tracks... but maybe it has some use to revisit tracks played less on a given period (?)
Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-06-28 23:39:45
Yay, great that it's solved :) Well, I remember that I saw Moya Brennan - Show Me , at the top of the list, I accidentally listened this song only once and I knew it was the song with the most playcounts in the library (but lately I didn't listened at all) so I said "hmm something is wrong here" :) So I tested again with other 2 songs with high playcount , I listened them only once .
So now it makes sense why they were at the top of the list :) Good that it's solved, I tested again and everything seems ok
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-07-15 21:56:46
Have updated the repository with all the latest changes and all bugfixes.  There are major changes, HTTP control integration (https://hydrogenaud.io/index.php?topic=62218.1125), some new tools, readme for all tools, auto-show readmes when adding buttons, etc. If anyone want to test it, download the files directly from the repository not the releases.

(it's recommended to also download the latest files from the rest of my scripts, since I have changed all with major changes)

Changelog is up to date on github. Check unreleased.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-07-21 09:45:24
Since someone asked for it, to change key tag on Playlist tools (for harmonic mixing) change this variable at: xxx-scripts\main\playlist_tools_menu.js (line 21)
X

(it will be configurable on next release)


Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-07-24 20:51:13
Have updated the repository with the new menus to remap tags, an important change to harmonic mixing and pools which should greatly speed up (x1000) their use with large handle lists and new presets (masstagger).

If anyone want to test it, download the files directly from the repository not the releases. Please have in mind the relative path bug on SMP has not been solved yet, so I have no idea if it will work for you!
(it's recommended to also download the latest files from the rest of my scripts in that case, since I have changed all with major changes)


EDIT: Export your Playlist Tools preset list (at config menu) to have a backup if you added your own entries to the menus! The last update will break previous properties (and thus presets). Save them and re-import them after installing.
Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-07-25 12:11:37
Maybe I misunderstand something but when I use:  Playlist tools - other tools - import track list - import from file \ url  , I get no result, using the example track_list_to_import.txt .

As you see in the pic, I put a song in the library Aretha Franklin - Respect, but it doesn't find anything.

Also, when I export a playlist from Spotify in txt. format I have this, for example :
Aretha Franklin - Respect

I tried to modify this [". ","%title%"," - ","%artist%"] from your example, but it didn't worked.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-07-25 16:02:26
Error on my side. Missed some quotes somewhere on a last minute change so no query worked. Fixed, replace file at 'main\'. Now should work in all cases. Updated also github.

And it seems I also forgot to add it to the 'test tools' macro, which would have found the problem too automatically (both macros run all tools from menu for easy testing). Fixed it too (at github and requires restoring defaults on macro menu).
Thanks!
Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-07-25 21:29:26
Yep, your example (that text file, track_list_to_import) is working now.
But now I think it's a error on my side :)
I made another txt file (a playlist exported from Sotify in txt format), track_list_to_import. It looks like this :

Cock Robin - Stumble and Fall
Joe Hisaishi - A Road to Somewhere
The Police - Every Breath You Take

You have this (for your txt file) : [". ","%title%"," - ","%artist%"]

What should I use for my case? I probably tried everything , except the good version :)

Btw, this is a nice little feature, now it's easier to import a playlist from Spotify to Foobar and vice versa. Also it will be cool if we can save more presets, not only your example
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-07-25 21:57:09
Yep, your example (that text file, track_list_to_import) is working now.
But now I think it's a error on my side :)
I made another txt file (a playlist exported from Sotify in txt format), track_list_to_import. It looks like this :

Cock Robin - Stumble and Fall
Joe Hisaishi - A Road to Somewhere
The Police - Every Breath You Take

You have this (for your txt file) : [". ","%title%"," - ","%artist%"]

What should I use for my case? I probably tried everything , except the good version :)

Btw, this is a nice little feature, now it's easier to import a playlist from Spotify to Foobar and vice versa. Also it will be cool if we can save more presets, not only your example
In fact I created it for online playlists found at random places: 'Top 100 guitar tracks', etc. It was a pain having to look for all the tracks  matching them manually in my own library! But yep, it may be used to sync spotify playlists and probably other use-cases.
This is an easy way to share playlists between users too, since they are path agnostic and may be loaded in anyone's library matching just what they got.

Uhm... I could make it remember the last "preset" used.  But not sure about adding a list or presets, it's unnecessarily complex.
I mean, if you download random lists from internet, you will need to edit it no matter what. And if you use it for an specific source (Spotify) then using the last one should be good enough, since it will always be the same.

Code: [Select]
["%artist%"," - ","%title%"]

You probably used the right one But it's a(nother) bug on my side. I didn't contemplate the first value being a tag (expected a number, etc.), so it always failed. Use the above code with the new file. Now it should work as expected in any case, no matter the tag positions.
Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-07-25 22:40:01
Yeah, I used that too , good that it's solved :)
"Uhm... I could make it remember the last "preset" used.  But not sure about adding a list or presets, it's unnecessarily complex."

You're right . I only asked for presets because I didn't managed to get the results that I wanted (but now we know it was because of the bug) and I was thinking : "hmmm , maybe we need presets here, so next time I will have faster results with the playlist? " haha :)
No need for presets

Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-07-29 10:06:34
Now it stores the last value used at Import track list\Import from file \ url...
The other entry uses the same (last) format mask value. No further changes.

Will update it on github later today.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-08-02 18:45:52
Have updated the repository with all the previous fixes. The latest SMP dev build fixes the relative paths bug too, so it should be safe to update to the new version from now on.
https://ci.appveyor.com/api/projects/theqwertiest/foo-spider-monkey-panel/artifacts/_result%2FWin32_Release%2Ffoo_spider_monkey_panel.fb2k-component?branch=master&job=Configuration%3A%20Release
Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-08-05 17:51:05
I have a suggestion if you like it and it's easy to implement. When using: Playlist tools - other tools - import track list - import from file \ url ...... It's possible after we import that text file with songs to have the results about tracks not found on libary, like this :

the buggles - video killed the radio star
peter gabriel - sledgehammer
culture club - karma chameleon
billy ocean - when the going gets tough, the tough get going
guns n' roses - sweet child o' mine

Currently we have this :

Line 0-> Artist: the buggles, Title: video killed the radio star
Line 2-> Artist: peter gabriel, Title: sledgehammer
Line 6-> Artist: culture club, Title: karma chameleon
Line 7-> Artist: billy ocean, Title: when the going gets tough, the tough get going
Line 10-> Artist: guns n' roses, Title: sweet child o' mine
This is useful for big playlists (I had a playlist with 1300 songs from spotify, and this behavior would be great ) , because the returned songs that are not found on the library can easily be imported for example in a playlist on youtube ( using this https://www.tunemymusic.com/File-to-Spotify.php#step5) , and then played inside foobar  (or you can do something else with that playlist)
I'm not saying the old behavior must be removed, just if it's possible to add this too, the possibility to return only Artist - Title (for the songs not present in library).
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-08-06 08:29:15
I have a suggestion if you like it and it's easy to implement. When using: Playlist tools - other tools - import track list - import from file \ url ...... It's possible after we import that text file with songs to have the results about tracks not found on libary, like this :

the buggles - video killed the radio star
peter gabriel - sledgehammer
culture club - karma chameleon
billy ocean - when the going gets tough, the tough get going
guns n' roses - sweet child o' mine

Currently we have this :

Line 0-> Artist: the buggles, Title: video killed the radio star
Line 2-> Artist: peter gabriel, Title: sledgehammer
Line 6-> Artist: culture club, Title: karma chameleon
Line 7-> Artist: billy ocean, Title: when the going gets tough, the tough get going
Line 10-> Artist: guns n' roses, Title: sweet child o' mine
This is useful for big playlists (I had a playlist with 1300 songs from spotify, and this behavior would be great ) , because the returned songs that are not found on the library can easily be imported for example in a playlist on youtube ( using this https://www.tunemymusic.com/File-to-Spotify.php#step5) , and then played inside foobar  (or you can do something else with that playlist)
I'm not saying the old behavior must be removed, just if it's possible to add this too, the possibility to return only Artist - Title (for the songs not present in library).
Note you can easily get what you want with any text editor:
Replace -> ", Title: " with ""
Select and remove "Line X-> Artist: "

For the 2nd step you need a text editor which allows vertical selections, with alt. Notepad works, Word too. It takes 10 seconds on my side to do that.

Replicating the same list on the same popup does not seem a good idea, so I may offer a config to either show Lines (default) or what you suggest.

Note there is a reason why I didn't return a list like you suggest: that list is created with the results the script got from reading the file after applying the masj, i.e. they may be wrong. That's why Lines are shown. Offering an alternate playlist implies the assumption of those lines being right, so that can not be the default behavior.

I will edit the reports of tag checking too for the same reason. I added all text to one popup and It should be in multiple popups.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-08-07 09:26:32
Just updated the repository.  It includes all previous fixes. The invert selection is a pretty simple utility but noticed it was missing on Foobar! Has become really useful along playlist search or macros.

### Added
- Select...\Invert selection: inverts current selection on active playlist.

- Presets: scripts for Picard to retrieve high level tags (gender, valence, danceability, speechiness, ...) from AcousticBrainz high level data. Tags are easily configurable. AcousticBrainz Tags plugin 2.2+ is required (within Picard). Those tags are meant as a direct replacement, using an open source data model, of Spotify's tags... which can only be retrieved with an API in some software and rely on closed source models and data (new data can not be added by users). If some tracks are not in AcousticBrainz database, they may be analyzed locally to then send send the results to their server (https://musicbrainz.org/doc/How_to_Submit_Analyses_to_AcousticBrainz) and later get the results on Picard.
See discussion here: https://hydrogenaud.io/index.php?topic=120982.msg1001549#msg1001549

- Other tools\Import track list: Reads a txt file containing a track list and finds matches, if possible, on library. The results are output to a new playlist ('Import'). The input path may be a file path or an url pointing to a txt file. Specially useful to easily create playlists (with matches from your library) from online playlists, charts, etc. (like '100 greatest rock songs', ...). Skipping the need to manually add one by one the tracks to your own version of the playlist. Not found tracks are reported with a popup. Format mask is saved between calls.

### Changed
- Check tags: Split popup report on 3 different popups according to their content (queries, errors and exclusions).
- Import tool now shows 2 popups.
Title: Re: Playlist-Tools-SMP
Post by: Koshingg on 2021-08-07 23:02:00
Yup, finally we have Invert selection! Probably should be already included in foobar. Actually I wanted to ask you about this for a few days, haha. I was using a old component foo_menu_addons  (1.4.2) but it's from 2010 (I barely founded it, almost 2 years ago, because all links were dead) . Now I can uninstall it :)
And thanks also for the improvements for Import track list
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-08-10 12:04:38
Have also added the expand function (which is essentially the same than Playlist filtering but setting selection), move selection (on current playlist) and jump to next/previous tracks by tags. So it should fully replace the plugin now if we talk about selection manipulation (btw the jump part of the plugin crashed foobar on my side, so the plugin is not safe to use nowadays).
Will also consider creating buttons which can be assigned to the submenus... (for example to have a Selection manipulation button which opens the selection menu directly).

Spoiler (click to show/hide)

PD: using these entries along macros could be used to create really interesting playlist creation macros (since you may traverse the playlist using arbitrary tags to select things).
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-08-10 18:20:50
Was a bit harder than expected but works. The entire submenu tree from Playlist Tools may be recreated into an individual button, making it faster to work with some tools (like foobar main menus) (*). SMP 1.5.2 has been added as requisite on installation notes (since I noticed some people was using older versions... which may break things).

Also fixed a bug on Search by Distance (I accidentally deleted some lines so it always crashed with the latest files), and some minor fixes when adding/removing buttons (properties not being automatically deleted).

All is now updated in the repository. As soon as the relative path bug gets definitely fixed on SMP I will create a proper release...

Spoiler (click to show/hide)

(*) If someone was interested into integrating Playlist Tools within a custom theme, now it should be relatively easy to split all submenus and create a menu bar with the desired theme (ditching the used grey button theme).
Title: Re: Playlist-Tools-SMP
Post by: FritzLn on 2021-08-12 00:35:28
Looking for some guidance

I have a portable installation of foobar 1.6.6

Steps I followed

1. Create scripts\SMP\xxx-scripts folder structure in profile folder :
C:\Users\<MY_USERNAME>\.user\audio.players\foobar2000\profile\scripts\SMP\xxx-scripts

2. Drag Playlist-Tools-SMP-2.0.0 folder from archive folder into xxx-scripts :
C:\Users\<MY_USERNAME>\.user\audio.players\foobar2000\profile\scripts\SMP\xxx-scripts\Playlist-Tools-SMP-2.0.0

3. Enable Layout Editing Mode and create new UI element : Spider Monkey Panel v 1.5.1

4. Click panel created in step 3

5. Click File -> Import -> and locate buttons_toolbar.js

6. Click OK

7. Error window pops up (screenshot posted below)

any ideas? looking forward to using this, thanks!

(https://i.imgur.com/p1uFYd0.png)
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-08-12 08:49:09
Did it wrong. Follow the instructions on the repo or the txt file.
Quote
Copy all files from the zip into YOUR_FOOBAR_PROFILE_PATH\scripts\SMP\xxx-scripts
Quote
Copy all files from the zip into YOUR_FOOBAR_PROFILE_PATH\scripts\SMP\xxx-scripts
Any other path WILL NOT work without editing the scripts. (see images\_Installation_*jpg) (*)
For ex: mine is          c:\Users\xxx\AppData\Roaming\foobar2000\scripts\SMP\xxx-scripts\...
For portable installations >= 1.6: .\foobar2000\profile\scripts\SMP\xxx-scripts\...
For portable installations <= 1.5: .\foobar2000\scripts\SMP\xxx-scripts\...
Multiple scripts may share some files (specially helpers) so overwrite if asked to do so.
Then load any script into a SMP panel within foobar. See info for usage.

All files are meant to reside within xxx-scripts folder, not on a subfolder there.
X

EDIT: Hope it's clear now, will add this image on next releases.
Title: Re: Playlist-Tools-SMP
Post by: FritzLn on 2021-08-12 14:32:44
hmm, i received the same error

i tried both locations:
For portable installations >= 1.6: .\foobar2000\profile\scripts\SMP\xxx-scripts\...
For portable installations <= 1.5: .\foobar2000\scripts\SMP\xxx-scripts\...

is there a special version of Spider Monkey Panel I should be using?
Title: Re: Playlist-Tools-SMP
Post by: FritzLn on 2021-08-12 16:39:52
hmm, i received the same error

i tried both locations:
For portable installations >= 1.6: .\foobar2000\profile\scripts\SMP\xxx-scripts\...
For portable installations <= 1.5: .\foobar2000\scripts\SMP\xxx-scripts\...

is there a special version of Spider Monkey Panel I should be using?

nvm, it's working now

i had to explicitly right click the panel and click reload for it to work after i changed the location of the files

thank you for the help
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-08-19 14:04:11
Last update until September. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
### Added
- Pools: added new property to pools named 'insertMethod' which may be assigned a value. 'standard' or 'intercalate' methods are currently allowed. Standard works as previous behavior, where items from sources are added to the end of the previous sources (before final sorting), therefore the list being source 1 tracks then Source 2 tracks then... Intercalate method inserts items from each source intercalating them (Source 1 Track 1, Source 2 Track 2, Source 3 Track 3, Source 1 Track 2, ...). Note intercalate method is meant to be used without final sorting, otherwise it would be overridden. This may be used to alternately play one song from a set of playlists (instead of using foo_scheduler which has some problems for that specific use-case) https://hydrogenaud.io/index.php?topic=121432.msg1002053;topicseen#new.
- Pools: added new default pool preset 'Top tracks mix (intercalate)' to the default list (may need to restore defaults on the menus to enable it). It's equivalent to the 'Top tracks mix' default pool but intercalating the tracks by rate instead of using a final random sorting.
- Presets: added new presets for the new 'insertMethod' pools' feature. See 'presets\Playlist Tools\pools\intercalate_playlists.json'.

New pools method preview:
Spoiler (click to show/hide)

Currently 'insertMethod' can only be set editing/creating presets (and then loading it). Not using the 'Custom pool' menu entry, (since I have not created input popups for it).

(*) The new default preset will only appear after restoring defaults (Pools\Remove entry from list...‍‌‍​​\Restore defaults or Configuration\Reset all configuration... ) on previous installations. Export user presets if needed to create a backup.
Title: Re: Playlist-Tools-SMP
Post by: Taynt3d on 2021-08-21 01:11:40
I'm getting this error, but I'm pretty sure I have the path right, any tips?

Error: Spider Monkey Panel v1.2.3 ({B78E8E83-4E10-4B0D-BD92-E740CB69E8F3})
include failed:
Path does not point to a valid file: helpers\buttons_xxx.js

File: <main>
Line: 13, Column: 58

Stack trace:
  @<main>:13:58


My path is: C:\Users\______\AppData\Roaming\foobar2000\scripts\SMP\xxx-scripts
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-08-23 21:22:31
Some users are experiencing errors related to an SMP bug when including files. The file is there but SMP does not find it as you noted.
Are you using 1.5.2?
https://hydrogenaud.io/index.php?topic=116669.msg1001720#msg1001720

Try with it, if you still have errors report it at that thread. I have no clue what's going on since the same scripts work fine for some people and me on multiple PCs.
Title: Re: Playlist-Tools-SMP
Post by: Taynt3d on 2021-08-24 19:03:07
I'm using 1.5.2, but no worries, I've found what I was looking to do via Find & Play at this point. Thanks!
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-08-31 21:28:55
I'm using 1.5.2, but no worries, I've found what I was looking to do via Find & Play at this point. Thanks!
Totally different aims, great it works for you though.

Minor update to improve usability of search by distance customizable button: switches to only output acoustic, instrumental or female vocal tracks (+ the recipe or whatever you configuration is to find similar tracks). Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
### Added
- Search by distance: added new presets for Search by Distance customizable button. Added Acoustic, Instrumental and Female Vocal versions for 'Similar tracks (G)' recipe which forces only acoustic, instrumental or female vocal tracks as output. Style, genre and Picard tags (acousticness, speechiness, gender) -see below- are taken into consideration.
- Search by distance: added a submenu on customizable button to set additional query filters (along the forced query): Acoustic, Instrumental and Female Vocal tracks. They can work in conjunction with any recipe as long as the recipe does not force a query too.

Spoiler (click to show/hide)
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-09-19 14:39:27
Just pushed a new update. Please read the new installation instructions. Added async processing for check tags and async support for macros. This update is required if you also update any of my other scripts due to the UTF-8 file saving/reading changes. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
### CHANGED
- Check tags: can now be set to be executed asynchronously, on the background, having a minimum impact on UI responsiveness. This is now the default behavior. Code has also been optimized, requiring now x0.96 the previous time (on synchronous mode). In async mode it takes x1.35 the previous time, a bit more but without blocking the UI. (tests done with 75.6K tracks)
- Check tags: when comparing tag values between different tags (genre -> style) to find possible errors, instead of comparing all tags with all other tags, only related groups are used (faster and more useful): [genre,style], [composer, involvedpeople, artist], etc. Configurable at properties panel.
- Macros: Are executed on synchronous mode by default (previous behavior but enforced now even for async tools).
- Macros: Possibility to set async mode on recorded macros (via popups), to execute all possible entries asynchronously (the list of async tools can be found on 'Configuration\Asynchronous processing'. Those tools will be executed on the set mode independently of the global configuration. If you want to selectively set entries in async mode, just create single macros for them and call those with another macro: Global macro -> Macro 1 (async), Macro 2 (sync), Macro 3 (sync)
- All json files are now saved as UTF-8 without BOM. All json files are now read as UTF-8 (forced).
- Updated installation instructions.
### FIXED
- Pools: Playlist files from Playlist-Manager-SMP were not being read properly due to a typo on path detection.
- Import track list: prefixes not being stripped properly.
- Macros: Typo on one of the entries of the 'Test tools' macro (so it was not being skipped instead of executed).
- Macros: Crash when trying to save a macro with duplicated name.

Reset Macros entries to get the new async versions! -> 'Macros\Remove entry from list...‎‌‎​​\Restore defaults'
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-09-23 16:00:14
Just pushed a new update. Added async processing to search by distance, and a new set of tools for playlist manipulation (merge, intersection, difference). Also updated lock status checks with new SMP functionality, so tools are available according to the allowed actions instead of just being disabled if a playlist is locked.This update is required if you also update any of my other scripts due to the UTF-8 file saving/reading changes. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   - Search by Distance: Checks graph links cache size on startup and warns when file size > 40 Mb. This is done to avoid memory leaks, since the file is fully loaded on memory and a corrupted file may increase the map size indefinitely until crashing the panel.
   - Search by Distance: Customizable button now has all additional menu entries found at Playlist Tools button: debug graph, find genre/styles not on graph, reset cache, etc. i.e. both now should offer the same degree of customization and advanced tools.
   - Playlist manipulation: Merge, intersect and compute difference between playlists. New tools to join the tracks from 2 playlists (without duplicates), make an intersection of both or the difference. Overwrites currently selected playlist.
   ### Changed
   - Search by Distance: Graph links cache is now calculated asynchronously whenever it's required (on first initialization or when manually forced to do so, thus improving the startup time the first time the panel it's loaded and not blocking the UI on posterior updates.
   - Script requires at minimum SMP 1.5.2. now.
   - All tool entries now have specific lock status checks according to their functionality (adding items, reordering, etc.) instead of checking if playlist is globally locked. Therefore some entries may now work on locked playlist, as long as the action to be performed is allowed.
   - Macros: Macros set to be executed async have a flag on the menu entry to warn about it.
   ### Fixed
   - Pools: output playlist was not being checked for locked status properly.
   - Playlist manipulation: 'Go to/close playlist' entries were greyed out when current playlist had no items; they should have only been disabled when there were no playlists.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-09-24 17:14:44
Just pushed a new update. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
### Added
- Buttons: buttons' text color can now be customized via menus on the bar menu (Shift + L. Click on the bar).
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-09-29 19:20:25
Just pushed a new update. A few bugfixes, great optimization of remove duplicates and improvements at import track list. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   - Other tools\Import track list: added stackable conditions to check against the results, the tracks which satisfy more of them (by order) will be preferred. i.e. Tracks with rating > 3 + Not live. A track satisfying both conditions would be preferred to those satisfying only the first one. Note order is important, so the second filter is not checked for a track when the first one has not been passed. In case tracks don't satisfy any of them, then all will be eligible (so filters are not a requisite only a preference). Filters may be configured on the tool sub-menu.
   ### Changed
   - Remove duplicates: optimized the code, now runs at least x2 times faster. Updated all instances where the functions were being used to call the new version (playlist revive, search by distance, queries, etc).
   - Buttons: toolbar configuration menu now is opened with R. Click (instead of Shift + L. Click on empty space). This is done to allow opening the menu anywhere even when the bar has no empty space left anymore.
   - Buttons: colors are changed without reloading the panel.
   ### Removed
   ### Fixed

   - Other tools\Playlist Revive: tracks with commas (',') on title were not being recognized as intended due to tag splitting as soon as that char was found, now fixed. There may be other instances/tools where a tag value has a comma but is not supposed to be 2 different values, although they require to be treated on a case by case basis so the default behavior has been left untouched. Rationale: title format already list tag values separated by comma; replacing that behavior would require to edit all tags within TF scripts like this %artist% -> $meta_sep(artist,###). It would also affect user configurable tags and remapping within scripts and become a nightmare to cover all possible use-cases.
   - Other tools\Import track list: fixed incorrect query creation for values with special chars (%, $, [, ], or '). Now are handled as intended by being enclosed with quotes first. For ex. Anthony's Games as artist translates into Anthony''s Games for the queries.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-10-05 20:24:26
Just pushed a new update. Some changes on Import track list and check tags. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   - Other tools\Import track list: added additional checks for prefixes, multi-value tags, commas and parentheses. It should now find more matches, for ex. when the file's title is missing a comma contrary to the track's title on library (paint it black -> paint it, black) and vice-versa.
   - Other tools\Import track list: reworked the mask matching; it should be more effective now, allowing even reading complex files like m3u playlists.
   - Other tools\Import track list: added multiple predefined presets which can be loaded by number instead of writing a manual mask.
   ### Changed
   - Other tools\Import track list: improved code-page detection.
   - Other tools\Check library tags: tags exclusions are now saved into a file instead of properties panel ('check_library_tags_exclusion.json') in an human readable format to easily edit them instead of using the input menu. Input menu can still be used though. Note this is also a workaround to really long strings on input boxes not being shown properly (SMP limitation).
   - Helpers: reworked code-page detection when reading text files to patch some of the limitations of SMP code-page heuristics.
   - Properties: added extensive checks to most properties (specially to check json strings).

The last changes at 'import track list' tool allow to find matches on library from an m3u playlist. There is even a preset for that ready to be used on those files (it also works on playlist created by Playlist-Manager-SMP).

The point is simple: playlists may be shared between multiple library/users and the paths are totally ignored for that, relying just on items which have the same tags set on the mask. There is even a playlist format based on that idea named XSPF: https://github.com/Chocobo1/foo_xspf_1/ (*)
Spoiler (click to show/hide)

(*)  XSPF support will be added on next releases of Playlist-Manager-SMP (so it can replace the component too), but the ability to apply the same concept on any plain text playlist file has more utilities than only available within an specific format.
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-10-08 21:50:54
Just pushed a new update. Improvements and bugfix on Search by distance. Permanent console log to bypass foobar limitation of 'saving log to file' getting reset on every startup. obviously limited to the script output. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
   ### Added
   - Helpers: added full script console logging to file at foobar profile folder ('console.log'). File is reset when reaching 5 MB. Logging is also sent to foobar2000's console (along other components logging).
   ### Changed
   - Search by Distance: cache now gets refreshed not only when the descriptors change ('music_graph_descriptors_xxx.js' & 'music_graph_descriptors_xxx_user.js') but also when the 2 functions used to calculate the paths or the own graph constructor change and the influences method. Even if changing those functions is not planned, it ensures the cache reflects the actual state of the graph in any case. In particular, the 'influences bugfix' would have required a manual cache reset by the user without this change which now will be performed automatically. The properties panel now tracks the CRC32 of those 6 items as merged strings (instead of only the first 2).
   - Search by Distance: Added 4 methods top check influences: 'fullPath', 'adjacentNodes', 'zeroNodes' and 'direct'. 'direct' is the previous behavior ("bugged") checking only the fist against the last node. 'zeroNodes' the fix listed bellow. 'adjacentNodes' works like zeroNodes but without forcing the adjacent nodes to be substitutions (checks (A,B) against (Y,Z), i.e. max. 4 possible links). 'fullPath' checks all consecutive links on the path (A->B), (B->C), ...) and also applies 'adjacentNodes' logic (to check the origin and final nodes). 'adjacentNodes' is now the default behavior.
   - Descriptors: Added a few anti-influences.
   ### Removed
   ### Fixed
   - Search by Distance: influences were not being correctly parsed when the original or the final node was a substitution (zero weight). Now adjacent nodes which may be substitutions are also checked at both sides, for ex for this path: Hip-Hop <- Rap_supergenre <- Rap_cluster <- Rythm Music_supercluster <- Blue_Note_cluster <- Blues_supergenre <- Blues. Where Hip-Hop is a substitution for Rap_supergenre,  Rap_supergenre is checked against Blues_supergenre and/or Blues for (anti)influences. Note it doesn't check for links at Hip-Hop since the influences link are always added to the generic items by design (in this case Rap_supergenre_supergenre), so there is max. 1 possible link. (note this may be overridden by the default behavior listed at top)

Spoiler (click to show/hide)
Title: Re: Playlist-Tools-SMP
Post by: regor on 2021-10-10 19:11:26
Just pushed a new update. Fixed missing file on the previous update.. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.