HydrogenAudio

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

Title: Playlist-Manager-SMP
Post by: regor on 2021-05-13 11:41:09
Playlist-Manager-SMP (https://github.com/regorxxx/Playlist-Manager-SMP)
(https://img.shields.io/github/release/regorxxx/Playlist-Manager-SMP.svg?include_prereleases) (https://github.com/regorxxx/Playlist-Manager-SMP/blob/main/CHANGELOG.md)(https://www.codefactor.io/repository/github/regorxxx/Playlist-Manager-SMP/badge/main) (https://www.codefactor.io/repository/github/regorxxx/Playlist-Manager-SMP/overview/main)(https://api.codacy.com/project/badge/Grade/329cf09cbffc46618a64d04e51f32011) (https://www.codacy.com/gh/regorxxx/Playlist-Manager-SMP/dashboard?utm_source=github.com&utm_medium=referral&utm_content=regorxxx/Playlist-Manager-SMP&utm_campaign=Badge_Grade)(https://img.shields.io/github/license/regorxxx/Playlist-Manager-SMP) (https://github.com/regorxxx/Playlist-Manager-SMP/blob/main/LICENSE)
A playlist manager for foobar2000 and Spider Monkey Panel (https://theqwertiest.github.io/foo_spider_monkey_panel) to save and load (auto)playlists on demand, synchronizing, ... along many more utilities.

(https://user-images.githubusercontent.com/83307074/116749102-f8b7b900-a9ef-11eb-9054-08fcb349813d.gif)

Features

(https://user-images.githubusercontent.com/83307074/116749322-4d5b3400-a9f0-11eb-9e55-cdd91370f624.gif)


(https://user-images.githubusercontent.com/83307074/116749095-f6555f00-a9ef-11eb-9723-7229766bed90.gif)

Current limitations
.fpl playlists (native format) are read only and can not be autosaved since the format is closed source and there are no methods on  Spider Monkey Panel (https://theqwertiest.github.io/foo_spider_monkey_panel) to save them on a path (without showing the 'save as' window), neither load them as handle lists (without loading on playlist tabs, for example to update the track count).
Whenever that changes, I will add full support for .fpl, and end pre-release state.

Also integrates
 1. Menu-Framework-SMP (https://github.com/regorxxx/Menu-Framework-SMP): Helper which allows to easily create customizable and dynamic menus.

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 'playlist_manager.js' into a SMP panel within foobar.

Download latest release (or nightly releases) at github:
https://github.com/regorxxx/Playlist-Manager-SMP
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-05-18 17:42:39
Following a github suggestion, have been working on relative paths support for playlist and it should be ready on the next pre-release along these changes.

- Additional checks for portable installations.
- Relative Paths: playlists can now be saved with paths relative to the playlist folder.
- New menu to change playlist extension.
- New menu to relative/abs path config.
- Playlist loading is done using cache matching any of both absolute and relative path playlists, independently of configuration (for saving).
- Fpl playlist data (like tags, size or category) is now saved between sessions (removing some of the intrinsic limitations of the closed format).
- Multiple info popups at some points when working with fpl and pls playlists for the first time.
- Using pls format disables UUIDs menu and forces UUID refresh to none for consistency.
- Using pls format disables some menus for editing data (pls format doesn't allow extra comments).
- Changed the background text when filtering the lists and # items was 0. (previously it showed the default text)
- Multiple bugfixes for fpl and pls file edits.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-05-19 20:07:35
[0.2.2] - 2021-05-19 (https://github.com/regorxxx/Playlist-Manager-SMP)
### Added
- Portable: Additional checks for portable installations.
- Relative Paths: playlists can now be saved with paths relative to the playlist folder.
- Menu: entry to change playlist extension.
- Menu: entry to relative/abs path config.
- Menu: different tools to check for errors (absolute/relative paths mixing, dead items on playlist files, etc.)
- Fpl playlist data (like tags, size or category) is now saved between sessions (removing some of the intrinsic limitations of the closed format).
- Multiple info popups at some points when working with fpl and pls playlists for the first time.
### Changed
- Bugfix: All data arrays get updated on playlist saving/editing (previously only displayed data was updated, leading to some display bugs).
- Bugfix: Multiple bugfixes for fpl and pls file edits.
- Helpers: Playlist loading is done using cache for both absolute and relative path playlists, independently  of configuration (for saving).
- Using pls format disables UUIDs menu and forces UUID refresh to none for consistency.
- Using pls format disables some menus for editing data (pls format doesn't allow extra comments).
- Changed the background text when filtering the lists and # items was 0. (previously it showed the default text).
- Playlist loading should be much faster after the first time all libray paths have been cached, since that was the main culprit of loading time (+1 sec for 70k tracks).
### Removed
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-05-24 17:02:30
Just pushed a few updates you can try until I create a new pre-release. Categories are finally used to filter the playlist panel and not only as info on tooltips. Tags remain for relevant info-only data you may want to add to any playlist file.

## [Unreleased] (Download from repository not from the releases) (https://github.com/regorxxx/Playlist-Manager-SMP)
### Added
- Menu: tool to check for size mismatch. Compares # paths against size tag on files for .m3u8, .m3u or .pls. Also reports playlist files without those tags.
- Menu: New header menu invoked with R. Click at the top of the panel.
- Menu: Show/hide shortcuts info on tooltips.
- Filter: Playlist may now be filtered by category, multiple selection allowed in a menu.
- Filter: If lists are being filtered by category, an indicator is shown in the header text.
- Tooltip: Tooltip for header with complete path, current category filter and shortcuts info.
- Tooltip: Tooltip for playlists with shortcuts info.
- Shortcut: Shift + Click sends current selection directly to playlist file (without needing to load it first).
### Changed
- Shortcut: Shift + Ctrl + Click deletes selected playlist. (previously it was assigned to Shift).
- Menu: Config menus (R. Click) moved to header menus. For consistency now all contextual menus related to the playlists are invoked within the list, and the rest at the top.
- Menu framework: updated.
### Removed
### Fixed
- Deleting a playlist while pressing shift no longer deletes it without sending the file to the recycle bin (for later restoring). It matches menu behavior now.
- Selection indicator not being removed when moving mouse from list to header.

X

X

X

X
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-05-26 20:49:27
## [0.3.0] - 2021-05-26 (https://github.com/regorxxx/Playlist-Manager-SMP)
### Added
- Menu: tool to check for size mismatch. Compares # paths against size tag on files for .m3u8, .m3u or .pls. Also reports playlist files without those tags.
- Menu: New header menu invoked with R. Click at the top of the panel.
- Menu: Show/hide shortcuts info on tooltips.
- Filter: Playlist may now be filtered by category, multiple selection allowed in a menu.
- Filter: If lists are being filtered by category, an indicator is shown in the header text.
- Tooltip: Tooltip for header with complete path, current category filter and shortcuts info.
- Tooltip: Tooltip for playlists with shortcuts info.
- Shortcut: Shift + Click sends current selection directly to playlist file (without needing to load it first).
### Changed
- Shortcut: Shift + Ctrl + Click deletes selected playlist. (previously it was assigned to Shift).
- Menu: Config menus (R. Click) moved to header menus. For consistency now all contextual menus related to the playlists are invoked within the list, and the rest at the top.
- Menu framework: updated.
### Removed
### Fixed
- Deleting a playlist while pressing shift no longer deletes it without sending the file to the recycle bin (for later restoring). It matches menu behavior now.
- Selection indicator not being removed when moving mouse from list to header.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-05-28 13:03:10
Since the latest pre-release already supports sending tracks to a playlist file without loading it, I'm considering adding some integration with Playlist-Tools-SMP (https://hydrogenaud.io/index.php?topic=120978.msg998340;topicseen#new) to create a pools utility.

Playlist tools already can do anything random pools component does (creating pools with queries), but I'm thinking about using pre-set playlists as sources. It will be available on the next release for loaded playlists on foobar, but I want to expand it to playlist files within any instance of a Playlist Manager.

That way it should be pretty easy to have some dummy 'container' playlists where you collect tracks by moods, occasion, whatever, ... (using Shift + Click which sends current selection directly to playlist file without loading it first). And then use the other script to use those 'container' playlists as source pools for a final playlist. The point of this approach is not having those dummy playlists always loaded on foobar cluttering the UI (using macros already allow this, but you have to add select/close playlist steps).

Finally, that should also work along Search-by-Distance-SMP (https://github.com/regorxxx/Search-by-Distance-SMP). Since I wanted to use some 'container' playlist as source to create playlists on the fly with similar tracks to a given set (thus integrating all MusicIP (https://spicefly.com/article.php?page=what-is-musicip) functionality).
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-05-28 21:54:15
## [0.3.1] - 2021-05-28 (https://github.com/regorxxx/Playlist-Manager-SMP)
### Added
- Menu: entry on header menu to reset all categories shown.
### Changed
- Menu framework: updated.
### Removed
### Fixed
- Changing extension to .pls did not update the UUID to "nothing".
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-06-07 19:32:21
v0.4.0 - File restructuring and cleanup (https://github.com/regorxxx/Playlist-Manager-SMP)
Maintenance release for better compatibility with other repositories.

## [0.4.0] - 2021-06-07
### Added
### Changed
- Helpers: Moved all SMP scripts without UI (those not meant to be loaded directly on panels) to 'main'.
- Helpers: Split 'helpers_xxx.js' file into multiple ones for easier future maintenance.
### Removed
### Fixed
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-06-15 17:37:07
v0.4.1 - Playlist Tools integration (https://github.com/regorxxx/Playlist-Manager-SMP)
See changelog for all changes.

    Playlist manager integration for pools. They will use playlists tracked by this manager as source is set to do so.
    Custom color improvements (standard text included).
    Minor improvements.

(*) Recommended to update all other scripts (Playlist Tools, Search by Distance, World Map) too. There have been major changes on those.


## [0.4.1] - 2021-06-15
### Added
- Integration: Listeners to share tracked playlist path with other panels (use 'window.NotifyOthers('Playlist manager: playlistPath', null)'). Used on [Playlist-Tools-SMP](https://github.com/regorxxx/Playlist-Tools-SMP) to use tracked playlist files as source for pools. 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 any 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.
- Colors: added menu option to change standard text color, switchange between CUI\DUI color or custom one.
### Changed
- Portable: when properties are set for the first time, now use relative paths on profile folder for portable installations (>= 1.6).
- Integration: Moved some functions to 'playlist_manager_helpers.js' to easily integrate others scripts with the playlists objects.
- Data: json file for playlists is now formatted to be readable.
- Colors: background color menu moved to 'Set custom colour...' submenu. Now all colour options reside in the same submenu.
- Buttons framework: skip icon drawing if font is not found.
- Buttons: icons to all buttons.
- Helpers: warn about missing font on console if trying to load a font and is not found.
### Removed
### Fixed
- Colors: panel did not repaint with default color values in some cases after using 'Reset all to default' entry.
- Avoid 2 possible crashes when playlist json files get corrupted. Warns about it whit a popup (to restore a backup).
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-06-25 18:52:01
regor, after a period without using foobar , I tested the latest scripts and I have errors in console , they keep appearing (obviously I have the font wingdings 2 installed)
[17:03:00] Missing font: wingdings 2
[17:03:01] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:06] Missing font: wingdings 2
[17:03:06] Missing font: wingdings 2
[17:03:07] Missing font: wingdings 2
[17:03:07] Missing font: wingdings 2
[17:03:07] Missing font: wingdings 2
[17:03:07] Missing font: wingdings 2
Also , when I add a playlist from a json file (I was using Auto-playlist Manager by marc2003, and I had 3 auto playlists), one auto playlist is imported indeed [These are de values used for the auto playlist --- Query pattern : %last_played% DURING LAST 57 WEEKS AND %play_count% GREATER 1  and---Sort pattern : $sub(99999,%play_count%)  --this works ]
But the other 2 auto playlists are not imported, and 2 error reports appear.
For auto playlist number 2, I have this error : "Query not valid:
ALL SORT DESCENDING BY %file_created%"  .
For auto playlist number 3, I have this error : ''Query not valid:
ALL SORT DESCENDING BY "$date(%added%)"
Obviously these 2 auto playlists are ok when I use the auto-playlist Manager by marc2003 or when I create auto playlists in foobar, they don t work here, I don't know why

I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed (Windows 10, 20H2)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-06-26 11:54:49
regor, after a period without using foobar , I tested the latest scripts and I have errors in console , they keep appearing (obviously I have the font wingdings 2 installed)
[17:03:00] Missing font: wingdings 2
[17:03:01] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:02] Missing font: wingdings 2
[17:03:06] Missing font: wingdings 2
[17:03:06] Missing font: wingdings 2
[17:03:07] Missing font: wingdings 2
[17:03:07] Missing font: wingdings 2
[17:03:07] Missing font: wingdings 2
[17:03:07] Missing font: wingdings 2
I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed (Windows 10, 20H2)

The first was reported on github. Not sure if it was you!
It's already fixed, was a typo on my side. It's Wingdings. But the icon works without problems even with the default font.

Quote
Also , when I add a playlist from a json file (I was using Auto-playlist Manager by marc2003, and I had 3 auto playlists), one auto playlist is imported indeed [These are de values used for the auto playlist --- Query pattern : %last_played% DURING LAST 57 WEEKS AND %play_count% GREATER 1  and---Sort pattern : $sub(99999,%play_count%)  --this works ]
But the other 2 auto playlists are not imported, and 2 error reports appear.
For auto playlist number 2, I have this error : "Query not valid:
ALL SORT DESCENDING BY %file_created%"  .
For auto playlist number 3, I have this error : ''Query not valid
Will recreate them and try. It may have something to do with the Descending/ascending part. Should be fixed on next release, since the idea is the playlist manager should be 100% compatible with marc2003's one, and replace it. That's why there is the import thing.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-06-26 13:02:36
Well the problem was query testing.
I test the queries before allowing users to add a new autoplaylist (to avoid errors or crashes if you put something wrong), to do it I use a function which doesn't allow 'SORT' commands on that context, only standard queries.

Spoiler (click to show/hide)

marc2003's script allows you to put anything on the query input without checking it. Crashes for some inputs and if it fails at playlist creation, it doesn't tell you why.

Spoiler (click to show/hide)

So whether you try to create a new autoplaylist or import one with those (SORT) commands, it will fail on my panel. There is no workaround around that since it's a limitation of SMP (GetQueryItems(handle_list, query) ). I will ask the author about a possible new function which checks all. But I will not disable query testing, since I find really weird to be able to crash the entire panel with a typo. Queries should always be tested.

I can perform query testing only for the string part just before SORT, that should work and be a good compromise between testing queries and allowing SORT on them. And that would fix the importing problem.
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-06-26 16:27:22

"The first was reported on github. Not sure if it was you!"

No, it wasn't me :)

Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-06-26 21:11:09
The query and font bugs (along some minor improvments) should be solved if you download the latest files from the repository (not release, but the files directly). The changelog is updated there.
Queries with SORTED BY patterns should now be allowed, and checked for errors too (at least partially).

Try re-importing the json :)

Quote
No, it wasn't me :)
Just a coincidence then, I get notifications from github so I read reports there first.
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-06-27 02:12:12
I downloaded the latest files, now I don't have the font bug, but when I tried to import the json this time no playlist is imported, and  no error reports appear
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-06-27 16:58:19
I can't reproduce your problem, it works fine on my side (tried with +20 playlists, with queries and SORT mixed in may ways).

Could you share your json file? Unless is something related to your file, it must be a config thing on your side.

Also, are you sure you don't have filtering enabled? (like only showing standard playlists!)
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-06-27 20:15:07
regor, it works. Yesterday I tried 10 times, I think , but no result appeared, I even removed the panel , reloaded the script... but today after a windows restart everything ok. Sorry for the false alarm
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-06-27 20:24:04
Don't worry, thanks for your reports :)
Title: Re: Playlist-Manager-SMP
Post by: jotti on 2021-07-12 16:51:14
Hi Regor,
is there a way to automatically add playlists from the playlist_manager panel to the main foobar playlist container? (the "load" action, when you manually click on them)

(My aim is to make the new playlist files added to a specific folder reachable through the foobar upnp server, which apparently doesn't detect the playlist listed in the playlist_manager panel, but only those in the main list. But this have to be done automatically. Here (https://www.reddit.com/r/foobar2000/comments/oim3n0/how_to_automatically_import_playlists_from_a/), someone suggested that maybe with your component this could be done...)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-07-12 18:25:58
Hi Regor,
is there a way to automatically add playlists from the playlist_manager panel to the main foobar playlist container? (the "load" action, when you manually click on them)

(My aim is to make the new playlist files added to a specific folder reachable through the foobar upnp server, which apparently doesn't detect the playlist listed in the playlist_manager panel, but only those in the main list. But this have to be done automatically. Here (https://www.reddit.com/r/foobar2000/comments/oim3n0/how_to_automatically_import_playlists_from_a/), someone suggested that maybe with your component this could be done...)
Currently nope. With the future Playlist Tools release, it should be possible to perform some actions using dummy tracks (names would be commands) if you also have that script.

If I understand your usage, you want to have all playlist from a tracked folder automatically loaded on foobar? Or just specific playlists?
Also according to what condition? At startup? On demand (not easy at all since it requires some integration with the remote control)?

Since there is currently a playlist tag feature implemented, I could add a config option to add a "Load on Startup" tag (or custom tags) to every new playlist added to the tracked folder.
Then I could make the panel to check tags and perform automatic actions according to those tags. That should cover both cases: you could have a panel associated to a folder with automatic tagging and loading, and another without it.
Title: Re: Playlist-Manager-SMP
Post by: jotti on 2021-07-12 23:32:16
Thank you Regor!

If I understand your usage, you want to have all playlist from a tracked folder automatically loaded on foobar? Or just specific playlists?
Also according to what condition? At startup? On demand (not easy at all since it requires some integration with the remote control)?
Yes, ALL the playlists from a tracked folder loaded on foobar. According to no specific condition: as soon as they are added to the folder would be the best way for the usage I have in mind. But at foobar startup would do as well.

Since there is currently a playlist tag feature implemented, I could add a config option to add a "Load on Startup" tag (or custom tags) to every new playlist added to the tracked folder.
Then I could make the panel to check tags and perform automatic actions according to those tags. That should cover both cases: you could have a panel associated to a folder with automatic tagging and loading, and another without it.
That sounds perfect, I think it could work just fine!

Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-07-13 12:15:42
Thank you Regor!

If I understand your usage, you want to have all playlist from a tracked folder automatically loaded on foobar? Or just specific playlists?
Also according to what condition? At startup? On demand (not easy at all since it requires some integration with the remote control)?
Yes, ALL the playlists from a tracked folder loaded on foobar. According to no specific condition: as soon as they are added to the folder would be the best way for the usage I have in mind. But at foobar startup would do as well.

Since there is currently a playlist tag feature implemented, I could add a config option to add a "Load on Startup" tag (or custom tags) to every new playlist added to the tracked folder.
Then I could make the panel to check tags and perform automatic actions according to those tags. That should cover both cases: you could have a panel associated to a folder with automatic tagging and loading, and another without it.
That sounds perfect, I think it could work just fine!


Already got it working. Will update github asap.
Spoiler (click to show/hide)

The tag method is more complex than just automatically loading all playlists but I prefer this method because you can manually write that tag to the desired playlists... so only those are loaded (instead of all). Or just enable autotagging, and it will apply to all. So this allow fine grained control. (*)

(*) You can have multiple Playlist Manager panels to control that but if you only have one, you may have many different playlists there, even auto-playlists... probably it makes no sense to auto-load all of them. So some control is preferred.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-07-15 21:54:11
Have updated the repository with all the latest changes (tags, autoload, etc.) and some bugfixes. 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 in Playlist Tools)

Changelog is up to date on github. Check unreleased.
Title: Re: Playlist-Manager-SMP
Post by: jotti on 2021-07-18 17:50:42
Hi Gregor,
I just updated the script from Github (just replacing all files and folders in xxx-scripts... Is this the right way? I'm new to Spider Monkey Panel...), but it doesn't load. I get this message:

Code: [Select]
Error: Spider Monkey Panel v1.5.1 (Playlist Manager: Playlist Manager v0.2 by XXX)
include failed:
Path does not point to a valid file: helpers\helpers_xxx.js

File: <main>
Line: 27, Column: 1
Stack trace:
  @:27:1
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-07-18 21:25:57
Hi Gregor,
I just updated the script from Github (just replacing all files and folders in xxx-scripts... Is this the right way? I'm new to Spider Monkey Panel...), but it doesn't load. I get this message:

Code: [Select]
Error: Spider Monkey Panel v1.5.1 (Playlist Manager: Playlist Manager v0.2 by XXX)
include failed:
Path does not point to a valid file: helpers\helpers_xxx.js

File: <main>
Line: 27, Column: 1
Stack trace:
  @:27:1

Yes, that's right. Does that file exist at (xxx-scripts)? If it's there, then it's a SMP bug. Update it to latest version (https://theqwertiest.github.io/foo_spider_monkey_panel/) (dev build). If it continues, another user had the same problem with relative paths, so please report it at the SMP thread in that case.
Title: Re: Playlist-Manager-SMP
Post by: jotti on 2021-07-19 21:58:23
Yes, the file is there (in xxx-scripts\helpers), and the bug still appears even with the last SMP version.
But if it affects just me I can patiently wait for the next versions, where it hopefully will be fixed...

(Not sure where I should report this bug, anyway... Here (https://github.com/TheQwertiest/foo_spider_monkey_panel/issues?q=path) I can't find any (recent / open) thread referring to this issue. Do you mean this one (https://github.com/TheQwertiest/foo_spider_monkey_panel/issues/142)? I'm a bit lost when it comes to coding and stuff...)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-07-19 22:09:58
At its thread or github (your link):
https://hydrogenaud.io/index.php?topic=116669.0

Have no idea what's going on, since it works on my side on win 10 and win 7 pcs but another user had problems at win 7.
Title: Re: Playlist-Manager-SMP
Post by: jotti on 2021-07-19 22:18:14
Oh, I see that you've already reported it, thanks.
By the way, I'm on win 10.
Title: Re: Playlist-Manager-SMP
Post by: dreampillet on 2021-07-21 06:42:26
I was having this exact problem with the World Map script. The file is there but I get the same error message saying it doesn't point to valid file. For some reason, the release version of the script seems to work fine for me. I'm using Windows 10 as well.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-07-24 20:53:38
Have updated the repository with a new feature to automatically add tags to tracks added to playlists (see changelog) with TF expressions, a set value or JS functions.This:
https://hydrogenaud.io/index.php?topic=121331.msg1001055;topicseen#new
Also an important bugfix on autosaving (not applying on filtered playlists).

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)
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-07-29 17:56:33
regor, I followed your steps from here https://hydrogenaud.io/index.php?topic=121331.msg1001029#msg1001029 but automatically adding tags to tracks added to playlists it's not working for me . Either it's a bug or I'm doing something wrong http://sendanywhe.re/AR38O8Y7
Title: Re: Playlist-Manager-SMP
Post by: architekt on 2021-07-30 20:17:13
This plugin is awesome! 1 minor detail that took me a while to figure out though. I specified my playlist path as this: "D:\Google Drive\Music\Default". It kept saying it couldn't find any playlists, which made no sense since when I had it open said folder, I saw all my .m3u8 files. Then I tried adding a trailing slash, so I made it: "D:\Google Drive\Music\Default\" and that fixed it. Would it be possible to check if the last character includes the slash, and if not, just append it? Or perhaps make mention of that in the info panel as part of the can't find any playlists standard message that otherwise populates it? Great work btw, this is exactly what I needed.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-01 18:49:16
This plugin is awesome! 1 minor detail that took me a while to figure out though. I specified my playlist path as this: "D:\Google Drive\Music\Default". It kept saying it couldn't find any playlists, which made no sense since when I had it open said folder, I saw all my .m3u8 files. Then I tried adding a trailing slash, so I made it: "D:\Google Drive\Music\Default\" and that fixed it. Would it be possible to check if the last character includes the slash, and if not, just append it? Or perhaps make mention of that in the info panel as part of the can't find any playlists standard message that otherwise populates it? Great work btw, this is exactly what I needed.
Yep, easy enough. That's a "problem" with paths at many places though, not only this script or that specific function. Will check the path inputs of most of my scripts to solve it.

Btw the latest SMP dev build (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) seems to fix the relative paths bug, so I will update the github repositories with proper releases asap.

Quote
regor, I followed your steps from here https://hydrogenaud.io/index.php?topic=121331.msg1001029#msg1001029 but automatically adding tags to tracks added to playlists it's not working for me . Either it's a bug or I'm doing something wrong http://sendanywhe.re/AR38O8Y7
Can't see the link sorry. (you can attach gifs here too btw)
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-08-01 19:48:25
Sorry, here is the gif
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-01 21:56:01
Sorry, here is the gif
You must use double quotes instead of ' x 2. That's how javascript json works. Do it and it should work ;)

And... I will try checking if the input uses ' and replacing it with " to avoid this. Or at least warn about it in the popup.

EDIT: last commit should replace ' ' with " automatically.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-01 22:34:01
This plugin is awesome! 1 minor detail that took me a while to figure out though. I specified my playlist path as this: "D:\Google Drive\Music\Default". It kept saying it couldn't find any playlists, which made no sense since when I had it open said folder, I saw all my .m3u8 files. Then I tried adding a trailing slash, so I made it: "D:\Google Drive\Music\Default\" and that fixed it. Would it be possible to check if the last character includes the slash, and if not, just append it? Or perhaps make mention of that in the info panel as part of the can't find any playlists standard message that otherwise populates it? Great work btw, this is exactly what I needed.
After checking, I'm sorry to say that's something already checked if you use the menus. '\' is added at the end if you omit it. Either you are using a really old version or you added the playlist paths directly at properties (and therefore any path integrity check is user's responsibility).
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-02 18:44:22
Have updated the repository with a few fixes, the previous improvement with quotes and a few new tools to export playlists (copy playlist file to, copy playlist file +tracks, copy playlist file + convert tracks).
See this: https://hydrogenaud.io/index.php?topic=121367

After setting the DSP, output and TF filename expression, the playlist manager is fully integrated with foobar converter... allowing to export entire playlists (and maintain their order) in one click. Can be used as a 'one way sync' tool for portable players, etc.

Spoiler (click to show/hide)

I mixed the output of multiple exports steps in the same folder, but you get the idea...
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-08-02 22:52:00
Thanks, it works now. Great new features , btw
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-03 10:17:49
Changed a bit the last convert feature to allow an arbitrary number of presets (instead of only 1). Also the list shows the DSP, TF and path (disk letter + folder name). I think it's much better now since it allows multiple outputs without needing to re-configure it or asking for user input every time.

Spoiler (click to show/hide)

* (DSP) and (FOLDER) means those var are set with user input instead of predefined.
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-08-05 17:56:01
And another suggestion here, although maybe it can't be done with SMP. It's possible to automatically copy a tag (or more) to another tag when songs are added to library? (something that this old component can do https://hydrogenaud.io/index.php?topic=68139.0 , but it can only accomplish one task, not more)
So, let's say I want to copy the Date tag to another tag, Date2, and Artist tag to Artist2
I know it can be done with masstagger but obviously it would be easier like this, automatically


Edit : just noticed this cool color code for DR, in this gif https://hydrogenaud.io/index.php?topic=30361.msg1001484#msg1001484 Can you share it ? :)

One for bitrate :

$ifgreater(%bitrate%,128,$ifgreater(%bitrate%,320,$rgb(0,0,250,0,0,250)%bitrate%,$rgb(0,250,0,0,250,0)%bitrate%),$rgb(250,0,0,250,0,0)%bitrate%)
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-08-05 21:20:10
I couldn't edit the last post so : cool color code for PLR and DR in this gif https://hydrogenaud.io/index.php?topic=120979.msg1001391#msg1001391 Can you share it ? :)

Edit :
Also it seems the latest dev build doesn't solve the problem :
Error: Spider Monkey Panel v1.5.2-dev+b064066b (Playlist Manager: Playlist Manager v0.2 by XXX)
include failed:
Path does not point to a valid file: helpers\helpers_xxx.js

File: <main>
Line: 27, Column: 1
Stack trace:
  @:27:1

Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-06 08:19:11
And another suggestion here, although maybe it can't be done with SMP. It's possible to automatically copy a tag (or more) to another tag when songs are added to library? (something that this old component can do https://hydrogenaud.io/index.php?topic=68139.0 , but it can only accomplish one task, not more)
So, let's say I want to copy the Date tag to another tag, Date2, and Artist tag to Artist2
I know it can be done with masstagger but obviously it would be easier like this, automatically


Edit : just noticed this cool color code for DR, in this gif https://hydrogenaud.io/index.php?topic=30361.msg1001484#msg1001484 Can you share it ? :)

One for bitrate :

$ifgreater(%bitrate%,128,$ifgreater(%bitrate%,320,$rgb(0,0,250,0,0,250)%bitrate%,$rgb(0,250,0,0,250,0)%bitrate%),$rgb(250,0,0,250,0,0)%bitrate%)
That's already within the manager features. Create an autoplaylist with 'ALL', add auto-tags for tracks where date2 is date, and artist2 is artist. Done. Note auto-tagging will only copy values (merge), never remove previous one (and date and artist is never deleted).

About the DR thing... it's supposed it's already shared on the relevant repositories (not here but Playlist Tools or Search by Distance). (*)

About the SMP bug, please report it at the SMP thread. According to TheQwertiest's log at github, it had something to do with unicode strings on paths. Maybe it would help if you report the full path where you added the scripts.

(*) Will also create another repo for all scripts, presets, etc. for AutoHotkey, Masstagger, Notepad++, Picard, UI, ...
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-07 09:26:11
Just updated the repository. The last changes should hopefully greatly improve tracks' relative path handling even for non standard playlists, therefore improving their loading time too.

### Added
- Relative Paths: new menu entry for playlists which allows to convert (force) all paths to relative paths, stripping all but filenames. i.e. the tracks are expected at the same Dir the playlist resides in. Meant to be used after tracks conversion, exporting, etc.

- Exporting Playlists: new menu entries for playlist exporting, allowing to just copy the playlist file, the playlist file along its tracks (thus converting the paths to relative paths too) or the playlist file plus the tracks converted using DSP presets. The latter option is configurable on the header menu at top 'Export and convert...'. Meant to be used for exporting playlists in one step, not having to edit playlists manually after converting files to match the new files... Can also be used as a 'one way sync' utility at servers, portable players, etc.

- Duplicates: New tool to find duplicated items on playlists without loading them (R. Click, 'Check playlists consistency...' menu).
### Changed
- Loading playlists, checking items on library and finding dead items now evaluates relative paths whether they start with .\ or not. Playlists created with the manager always use '.\', but this improves compatibility with playlists created with other software or manually.

- General speed improvements loading playlists, checking items on library and finding dead items.
### Fixed
- Dead items: the menu entry to find dead items on playlists now skips streams (http or https).
- Checking if all items on a playlist are in the library now works as expected when some items -file paths- are duplicated.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-07 18:10:23
A minor quality of life update.

### Added
- Tooltip & Duplicates: While pressing shift over a playlist, apart from the playlist info, a warning will be given if the current selection is already present on the destination playlist (to avoid adding duplicates). Note Shift + L.Click is the action associated to sending current selection to a playlist file.
### Changed
- Tooltip: Pressing shit, control or both will show on the tooltip the action which will be performed on playlists. If usage info is enabled on tooltips, then only the current action associated to the keys will be shown while pressing them (so it becomes obvious which one is from the list); otherwise -disabled- nothing will be shown until a key is pressed.
- Tooltip: Adjusted max width to 600 px before splitting lines.

Spoiler (click to show/hide)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-13 08:44:58
Another minor update on repo.

### Added
- Skip duplicates: new option to skip duplicates when adding selected items to a playlist. Checks both, if any of the new items is already on the playlist file and if the current selection contains duplicates. Console log shows when this happen without additional warnings or functionality changes (they are simply skipped). Configuration can be toggled at header menu. Only applies when sending selection directly to a playlist file (does not prevent adding duplicates via auto-save).
### Fixed
- Adding current selection to a playlist file (Shift + L. Click) when it's loaded and it's also the current playlist no longer reinserts tracks, thus duplicating them.
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-08-13 22:48:02
"It's possible to automatically copy a tag (or more) to another tag when songs are added to library? (something that this old component can do https://hydrogenaud.io/index.php?topic=68139.0 , but it can only accomplish one task, not more)
So, let's say I want to copy the Date tag to another tag, Date2, and Artist tag to Artist2"

"That's already within the manager features. Create an autoplaylist with 'ALL', add auto-tags for tracks where date2 is date, and artist2 is artist. Done. "

@regor , sorry, it seems you have a dumb foobar user here :) I couldn't manage this a few days ago. I followed your advice , I created the autoplaylist with 'ALL', then  Automatically add tags to tracks ..... and then I don't know what to add there in that window that opens
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-14 00:36:02
"It's possible to automatically copy a tag (or more) to another tag when songs are added to library? (something that this old component can do https://hydrogenaud.io/index.php?topic=68139.0 , but it can only accomplish one task, not more)
So, let's say I want to copy the Date tag to another tag, Date2, and Artist tag to Artist2"

"That's already within the manager features. Create an autoplaylist with 'ALL', add auto-tags for tracks where date2 is date, and artist2 is artist. Done. "

@regor , sorry, it seems you have a dumb foobar user here :) I couldn't manage this a few days ago. I followed your advice , I created the autoplaylist with 'ALL', then  Automatically add tags to tracks ..... and then I don't know what to add there in that window that opens
Code: [Select]
[{"date2":"%date%"},{"artist2":"%artist%"}]
As noted, first item (key) is the tag name, second item (value) is the thing you want to add to the tag. You may add an arbitrary value, another tag, TF expression or predefined javascript functions.

Use it first on a standard playlist (set autotag first), then add a test track. After that remove the tags.
Then create an autoplaylist which should only apply to that track (use title as query) and check it works. (read the popups for autoplaylists on config)

Remember to enable Tracks Autotags on config. Note you may switch the functionality for different playlist types. Readmes will appear when clicking. Will add a few examples on the global switch popup and readme on next release.

Btw just uploaded a small bugfix for the feature (using shift + l. click to add tracks to playlist applied auto tag even if it was disabled on config), just in case you notice that... it's already fixed.
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-08-14 12:20:12
Thanks, that was easy, I was thinking about something else, about that example with add date added to playlist :  [{"addedDate":"JS:todayDate"},{"Playlist Name"}] , haha
It worked , I added a few songs to library and it adds the tags but when I made a final attempt, I have this error and it's the same even if I reload the script or restart foobar ( I tried on a test configuration , so no problem for me) :

Error: Spider Monkey Panel v1.5.2 (Playlist Manager: Playlist Manager v0.2 by XXX)
UpdateFileInfoFromJSON failed:
Invalid JSON info: mismatched with handle count

File: playlist_manager_list.js
Line: 585, Column: 14
Stack trace:
  _list/this.updateTrackTags@playlist_manager_list.js:585:14
  _list/this.updateTags@playlist_manager_list.js:622:10
  _list/this.update/<@playlist_manager_list.js:987:15
  _list/this.update@playlist_manager_list.js:976:10
  _list/this.init@playlist_manager_list.js:1569:8
  _list@playlist_manager_list.js:1643:7
  @playlist_manager.js:78:12

This is from console :

Playlist manager: reading from files
Playlist Manager: Auto-tagging enabled, retrieving tags for new tracks...
Playlist Manager: Auto-tagging tracks...
foo_spider_monkey_panel:
Error: Spider Monkey Panel v1.5.2 (Playlist Manager: Playlist Manager v0.2 by XXX)
UpdateFileInfoFromJSON failed:
Invalid JSON info: mismatched with handle count

File: playlist_manager_list.js
Line: 585, Column: 14
Stack trace:
  _list/this.updateTrackTags@playlist_manager_list.js:585:14
  _list/this.updateTags@playlist_manager_list.js:622:10
  _list/this.update/<@playlist_manager_list.js:987:15
  _list/this.update@playlist_manager_list.js:976:10
  _list/this.init@playlist_manager_list.js:1569:8
  _list@playlist_manager_list.js:1643:7
  @playlist_manager.js:78:12


I'm not sure 100%, but I think this error appeared after I removed a song from the library. I made a autoplaylist ALL , with all the songs from the library, and aplied your query [{"date2":"%date%"},{"artist2":"%artist%"}]

Edit : it seems it happens when I enable Autoplaylists (at start up)  : Tracks Autotag and actions - Automatically tag added tracks on - Autoplaylists (at start up)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-14 14:32:00
Thing is I can not reproduce your problem with a query which checks an specific title. Have not tried with all. It may be that updateJSON tries to save tags to a non existing file because your database has not been refreshed yet after deleting the file, although testing that I found no problems.

If you add this code at line 585 (at playlist_manager_list.js) it should avoid a possible crash in some situations (in particular the error you got). Although files not being present requires more checks.
Code: [Select]
		if (handleList.Count !== tagsArr.length) {console.log('Auto tagging failed due to size mismatch between handle list and tags array'); return;}
X

In any case this only "skips" the problem, I have to found why you got a list of tracks different to the list of tags to be applied.

EDIT: I think I know what the problem is. Wait for another fix.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-14 14:47:21
Added a fix on repo to what I think is the source of the problem. Try it and tell me if it solves it. The crash in any case should be gone with the safeguard I wrote before (which is also included).

Alternatively just download this file. -EDIT  see below-
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-08-14 15:00:07
Foobar starts without SMP crash but now it seems this error appears when I'm trying to do right click on the panel :

Error: Spider Monkey Panel v1.5.2 (Playlist Manager: Playlist Manager v0.2 by XXX)
list.deleted_items is undefined

File: playlist_manager_menu.js
Line: 281, Column: 51
Stack trace:
  createMenuRight@playlist_manager_menu.js:281:51
  on_mouse_rbtn_up@playlist_manager.js:129:71

Console :

Error: Spider Monkey Panel v1.5.2 (Playlist Manager: Playlist Manager v0.2 by XXX)
list.deleted_items is undefined

File: playlist_manager_menu.js
Line: 281, Column: 51
Stack trace:
  createMenuRight@playlist_manager_menu.js:281:51
  on_mouse_rbtn_up@playlist_manager.js:129:71
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-14 15:08:37
Oh yes,  I updated another file today. Sorry, thought that was the only file. Once you do it will be gone. Both offered here now. (updating from repo there are no problems)

The non mentioned update (on the menu file) was a bug introduced some releases ago where the restore menu did not work at all when deleting playlists (I accidentally deleted a line of code). Did not notice it until today, now it works as expected (if you delete a playlist within the manager, you can restore it from the recycle bin).
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-08-14 15:26:48
Everything works ok, problem solved :)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-14 15:31:21
Great; If you ever get the 'Auto tagging failed due to size mismatch between handle list and tags array.' on console, let me know. I will left it there in case some people got problems with tagging at some point, although it should work fine now.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-15 19:09:51
Just pushed a new update on the repo with a bug fix and a handy shortcut to further use categories as virtual folders and easily swap them.

### ADDED
- Categories: double clicking on the header cycles through the categories shown one by one.
### Fixed
- Categories: due to a copy/paste typo, the menu to filter categories only worked when using custom background colors on the panel.

Btw, if someone want to test it, there is a second branch on the repo for full relative path handling. i.e. you may have the playlist folder at a different folder level (H:\Music\_Other things\_Playlists) than the library folders (H:\Music\CDs\...) and still have relative paths working on playlists, where tracks would use something like:
Quote
..\..\CDs\Artist\Album\track 01.flac
Quote
H:\Music
    + [_Other things]
        + [_Playlists]
            - Playlist A.m3u8
            - Other playlist files...
    + [CDs]
        + [Artist]
        + ...

On the main branch the playlist folder must be on the same root than the library folders to have relative paths working (so they may pollute the current root folder specially if there are other files there or the root is the disk itself):
Quote
.\CDs\Artist\Album\track 01.flac'
Quote
H:\Music
    + [CDs]
        + [Artist]
        + ...
    - Playlist A.m3u8
    - Other playlist files...


There are no further differences (although the rel. path branch will not be updated with new features or fixes, is just for testing before merging), and in any case, both branches fallback to absolute paths if relative paths are not used (or not able to use them). Rel. path handling is obviously only 'useful' for people using portable installs, removable devices or network servers, where (track) paths are not fixed to an specific drive letter. Also when playlist may be shared between multiple foobar instances where the drive letter changes, for ex. when the music is on a network drive and you may access it from 2 different PCs or mobile controllers.

Also support for the playlist manager on the online http controller ajquery-xxx is planned:
https://hydrogenaud.io/index.php?topic=62218.msg1000139#msg1000139
At least the loading part and listing all playlist on the manager panel(s). Autosave would work too according to the setting on the foobar server.
Title: Re: Playlist-Manager-SMP
Post by: jotti on 2021-08-18 10:39:56
Hello again Regor,
following a hint here I tried with the release version of the script (v 0.4.1), and it works without crashing.
But I still can't find an option to apply actions to a specific tag (nor I can find the "autotag" option): could it be because the release version (which, in fact, dates to 15 jun) hasn't got all the features that the repository version has? Or am I just missing something?

(I suppose I should see something like in this GIF you uploaded: https://hydrogenaud.io/index.php?action=dlattach;attach=20604;image but right above "font size" in the menu I see only "Show usage info on tooltips")
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-18 11:02:03
Hello again Regor,
following a hint here I tried with the release version of the script (v 0.4.1), and it works without crashing.
But I still can't find an option to apply actions to a specific tag (nor I can find the "autotag" option): could it be because the release version (which, in fact, dates to 15 jun) hasn't got all the features that the repository version has? Or am I just missing something?

(I suppose I should see something like in this GIF you uploaded: https://hydrogenaud.io/index.php?action=dlattach;attach=20604;image but right above "font size" in the menu I see only "Show usage info on tooltips")
That's it. On last updates I have warned about downloading the files directly from the repo, not the release files. If you read the changelog at the repo you will see the 'unreleased changes' section, those are not on the previous release obviously, and that's what you are missing. (I always maintain up to date the changelog on my repos, so you can fully follow them to know if you want to test non released versions)
https://github.com/regorxxx/Playlist-Manager-SMP/blob/9ce231c6a683ac0e1d9eacdd54145201f476bc83/CHANGELOG.md

If you want to try them, download from the repo.

I will not create a release until Spider Monkey fixes definitively the relative path errors some people are experiencing randomly (it just crash at panel startup because SMP does not find the scripts even if they are at the right path). It works fine for me and for other people, so that's why I continue updating it without a release. I would recommend to use/test it since it contains many bugfixes and UI polishing...
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-18 11:11:47
Btw this is the latest update (yesterday). Merged the changes from the relative path branch to the main branch (first point at changes).

Quote
### Added
- Categories: double clicking on the header cycles through the categories shown one by one.
- Added tag filtering menu to only show playlists which contain selected tags. Tag filtering is always reset on startup, no matter what 'Save filtering between sessions' is set to. Use categories for 'virtual folders' or permanent playlist categorization, tags are meant only for informative purpose or auto-tag actions (thus not needing permanent filtering).
- Popup warnings when finding dead items sending selection to playlist (Shift + L. Click), creating a new playlist from active playlist, manually saving a playlist or auto-saving (configurable). Note checking on auto-saving is disabled by default since it may affect performance and also result on popups being thrown multiple times until dead items are fixed.
### Changed
- Relative Paths: Improved relative path support. Playlist folder may now be at a different level than the library folders as long as they share the same root For ex. 'H:\_Playlists' and 'H:\Music\Cds'.
- Cache: Paths from current library items are cached at script loading, it's done async and in iterative steps so it doesn't freeze the UI. It was done previously once, per panel, when loading the first playlist. The change should greatly speed up the loading of the first playlist since most of the work is already done at that step, thus being as fast as consecutive playlist loading before.
- Categories: Current category view is now saved only when 'Save filtering between sessions' is enabled, otherwise it will be reset to show 'All' on startup.
- UI: Tooltip shortcuts are updated as soon as the key modifiers are pressed, even if the the mouse has not been moved (tooltip is redrawn). That should make easier to see the action which would be applied without needing to move the mouse constantly to update the tooltip.
- UI: Header tooltip (with current filter view) is updated after double clicking, even if the the mouse has not been moved  (tooltip is redrawn). That should make easier to see the current category applied while cycling without needing to move the mouse constantly to update the tooltip.
- Added descriptions at top of most menus.
- Minor code cleanup.
### Fixed
- UI: When a playlist of current view had no category, next category letter was not being shown on the letter separators. i.e. Jumping from none (-) to B, skipping A, when there were playlists with categories starting with A, B and some without categories. Long time UI only bug since first releases. Only happened for the category sorting view; when sorting by name, playlist always have a name by design, so first item header was never 'empty' and thus the next one was always shown fine.

Currently it should look like this:
X
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-08-19 14:00:25
Last update until September. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
### Changed
-UI: current selection rectangle now has its width adjusted according to 'Show name/category separators', so it doesn't overlap with the letters at the right when enabled.
-UI: when opening the contextual menu for a playlist (L. Click) the selection rectangle will be shown until the menu close. Previously it was cleared as soon as the menu was created or the mouse left the panel. Opening menus for things not directly related to an specific playlist will maintain the previous behavior.
-UI: entire panel is repaint when moving the mouse over it instead of currently selected playlist only to ensure selection is always properly drawn even with extreme movements.
### Fixed
-Menus: crash when selected playlist index was out of bounds on L. Click menu creation due to menu being created 100 ms later than clicking. If the mouse was moved really fast out of the list within that 100 ms delay, the selected playlist was considered null (crash). It would also change the playlist to which the menu applied if the mouse was moved to another playlist really fast (bug). Fixed both cases now, forcing the playlist index at the exact moment the L. Click was done (on button up).
X
X
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-03 18:20:46
New update with mostly cosmetic bugfixes. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
    ### Fixed
   -Importing Json: skips playlists at importing whenever they don't have a query or are not Autoplaylists. Feature was added at a time where the only playlists items on json where autoplaylists (so importing from marc2003's panel worked fine), now that .fpl playlists also have a virtual counterpart, additional checks must be done. Should also serve as sanity check for manually created autoplaylist json files.
   - Menus: send selection to playlist entry has now appropriate flags to be disabled when there is no selection, it's an autoplaylists, the playlist is locked or it's an .fpl playlist.
   - Menus: using the menus to rename .pls playlist was failing due to a back coded check even if the playlist was properly renamed.
   - Tooltip: when trying to send selection to a playlist and there is no selection, it's an Autoplaylist, the playlist is locked or it's an .fpl playlist, a warning is shown to note it's not possible to do so.
   - Shortcut: send selection (Shift + L. Click) is disabled when it's an Autoplaylist, the playlist is locked or it's an .fpl playlist; instead of simply failing.
   - UI: bug with uppercase playlist names not being correctly identified when mixed along lowercase names (spanning of the same separator multiple times)

Additionally I'm working on creating full documentation for the scripts with latex, this will be the first one. Check 'readmes' folder. Currently wip though (missing some sections, images and gifs), feel free to suggest any faq not present yet.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-06 20:10:06
New update. Reworked the menus (specially the header menu), added some new features for AutoPlaylist and fixed some rare bugs. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
   ### Added
   - AutoPlaylists: new option on contextual menu to clone the selected AutoPlaylist as a standard playlist. i.e. automatizes the process of loading it, copying the track, pasting them into a new playlist and creating a new playlist file from it.
   - AutoPlaylists: new filtering option on header menu for AutoPlaylists on cloning process to remove duplicates according to some tag(s) or TF expression(s). By default is set to 'artist,date,title'. Automatizes the process of removing duplicates by tags after cloning using tools like those found on Playlist-Tools-SMP and automatically fixes one of their worst quirks (having multiple versions of the same tracks).
   ### Changed
   - UI: Auto-Playlists size now gets updated when loading them (since it's essentially performance free).
   - Menus: Reordered menu entries into sub-menus for more logical access: panel behavior, playlist behavior, UI, ...
   ### Fixed
   - Menus: Force relative paths menu entry is now disabled when playlist is locked.
   - Bug on first playlist not being properly updated at some points (at least on manual update) due to a bad coded check for index !== 0.
   - Crash when deleting an AutoPlaylist right after loading it if Track Tagging was enabled due to callback delays.
   - Playlist with special characters did not properly update the playlist path at some instances (the chars were not being stripped until manual refresh).

Additionally I'm working on creating full documentation for the scripts with latex, this will be the first one. Check 'readmes' folder. Currently wip though (missing some sections, images and gifs), feel free to suggest any faq not present yet.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-07 22:50:54
New update. UI polishing and expanded exporting options for auto-playlists. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
### Added
- UI: new option to enable/disable header on selected playlist contextual menu. The header shows the playlist format and name.
- AutoPlaylists: new option on contextual menu to export selected AutoPlaylist as json file (ready to be imported by other instances of the manager). Not backwards compatible with marc2003's panel.
- AutoPlaylists: new option on list menu to export all AutoPlaylist (and optionally .fpl virtual files too) as json file at once (ready to be imported by other instances of the manager). Not backwards compatible with marc2003's panel
### Changed
- UI: contextual menu for selected playlist can now be invoked on the entire selection rectangle (not only over the name).
- Menus: 'Copy playlist file to...' is now available for .fpl playlist too, since it's the only option which doesn't involve playlist editing.
- Menus: 'Bind active playlist to this file...' is now disabled for locked playlists (must unlock them first) and .fpl playlists (in any case).

Additionally I'm working on creating full documentation for the scripts with latex, this will be the first one. Check 'readmes' folder. Currently wip though (missing some sections, images and gifs), feel free to suggest any faq not present yet.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-09 23:11:40
New update. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
    ### Added
- Menus: new option on header menu to set intervals for auto-loading and auto-saving files (previously done only via properties).
    ### Fixed
- Fixed crash when trying to load a playlist with non present items and 'omit not found' was enabled (for ex. exporting features).

The readme is mostly finished with screenshots and explanations of most features btw. Check attached file or repository.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-10 12:13:50
Missed the last additions to auto-loading and auto-saving, now reflected on the manual. Also fixed some typos.
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-09-14 06:32:08
I have a problem with the Playlist manager. At first I thought this might happen because I updated a few components, but after 1 million tests I found what happens :) After I restart the Pc, and I start foobar, the player remains blocked, CPU at 20% , so I have to kill the process . If I start foobar again (once, twice...ten times) everything is ok (foobar is starting and the playlist manager works normally). So, the problem appears ONLY when I start foobar for the first time after I restart the pc (obviously, without this script, foobar starts normally every time, even after a pc restart) Maybe something happened with the latest updates? (I noticed this a few days ago, it might be a week) Or simply a playlist might be corrupt , somehow? Or something else...
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-14 09:16:38
Are you using the latest version (commit)? Which config? That may be a SMP bug, since it sounds similar to other bugs on the past.

There is nothing at startup done by default which should block foobar in any way. And specially not on first init but being fine on subsequent inits. The only thing which takes processing time is autoplaylist size updating which may be disabled and library caching which is done Async on latest versions so it doesn't affect startup at all.

EDIT: can you enable console on an UI panel at startup to show where it fails when freezing? Note if it was a simple infinite loop problem, it would show the popup about a script taking so much time. So that looks like a SMP bug, corrupted files somewhere or something more complex.
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-09-14 10:48:51
I'm using the latest version of the script, also SMP 1.5.2 (I think that's the latest stable version). I'm not at the Pc now. Later in the evening, I'll try to answer.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-14 20:42:24
New update. Auto-playlist size updates can now be enabled without impacting startup time at all due to async processing. Also added some safe checks to file code-pages to ensure files don't get corrupted when using UTF8 without BOM or no identified code-pages. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
### Changed
- Workaround for SMP limits on automatic code-page detection for text files (playlists). If code-page is present in M3U files (#EXTENC:...), encoding is forced instead of using the detected code-page (which may be wrong). .m3u8 files are always considered as UTF-8 files. This should cover most UTF-8 problems (when BOM is not present) on M3U files. .pls format still relies on code-page detection.
- AutoPlaylists: Autoplaylists size now gets updated asynchronously (if feature is enabled), thus not impacting loading time at startup.
- UI: selection rectangle drawing is skipped if color matches the background color.

The readme has been updated (FAQ and Tips) and I'm trying to embed gifs into the pdf to easily show examples. If someone could Check "VII Tips \ Pools using Playlist-Tools-SMP" section and tell me if the gif works properly I would be grateful, seems to be reader dependent.
Title: Re: Playlist-Manager-SMP
Post by: Koshingg on 2021-09-15 13:35:35
No, for me it doesn't work, I tried with 3 pdf readers , but no luck. Maybe you should put the gifs separately, in a folder? (for those that can't see them in a pdf). I solved the problem that I had with the playlist manager, sorry for late reply, it took awhile until I found what was the problem , I'll send you a PM in a few hours to explain
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-15 23:32:20
Works on one PC on my side but not on the other... so yep, that's not a good solution. Thanks. There is an alternative involving splitting the gifs in all its images and creating an animation with them, will try that. It would be preferable to have all the documentation in one place since pointing from time to time to external files clearly breaks its ease of use.

Answered your PM. May be related to the code-page detection change, so last update may have solved it too. Note you can find dead items with the tools within the panel, that may also indicate when a track is "not recognized" even if its on the library.

New update. More things changed to async processing whenever was possible. The popups and readme have been updated to reflect those changes (faq and some comments). Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
### Changed
- Playlists consistency tools: all are now executed asynchronously: Absolute/relative paths..., external items, dead items, duplicated items and playlist size mismatch.
- AutoPlaylists: Autoplaylists automatic track tagging now is done asynchronously (if feature is enabled), thus having a minimum impact on loading time at startup.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-16 10:54:19
No, for me it doesn't work, I tried with 3 pdf readers , but no luck. Maybe you should put the gifs separately, in a folder? (for those that can't see them in a pdf).
New version with an animation embedded. The gif is also linked within the pdf as fallback (obviously it doesnt work now since I'm only sharing the pdf)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-19 14:36:35
Just pushed a new update. Please read the new installation instructions. 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
- All json files are now saved as UTF-8 without BOM. All json files are now read as UTF-8 (forced).
- Updated installation instructions.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-21 10:31:55
Updated the readme with full explanations about integration with Playlist Tools (pools feature) and Export and convert feature. Also a guide to export playlists (and its files) ready to be used on other devices with Foobar2000 mobile . I think I have covered most of the possible uses of the manager and doubts, if you have any more questions let me know.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-23 15:42:11
Just pushed a new update. Readme updated. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
   ### Added
   - UI: Header icon can now be customized according to category being shown with an extra json config file. Check readme for instructions ('Advanced tips').
   ### Changed
   - Requisites: Script requires at minimum SMP 1.5.2. now.
   - UI: Minor UI adjustments to the header.
   - Export and copy tracks to: new configuration to asynchronously copy files, not blocking the UI. This is now the default behavior.
   ### Removed
   - UI: Removed wingdings dependencies. Replaced with Font Awesome (already being in use at other places).
Title: Re: Playlist-Manager-SMP
Post by: jotti on 2021-09-23 18:39:11
Hi Regor,
I bypassed the relative paths error just replacing them with absolute paths (as suggested by this user (https://hydrogenaud.io/index.php?topic=121277.msg1000551#msg1000551)), but it still fails to load, this time displaying this message:

Code: [Select]
Error: Spider Monkey Panel v1.6.1-dev+757cb073 (Playlist Manager: Playlist Manager v0.2 by XXX)
this.properties.bBOM is undefined

File: playlist_manager_list.js
Line: 1831, Column: 2
Stack trace:
  _list@playlist_manager_list.js:1831:2
  @:79:12

I tried some digging here but couldn't find anyone with the same error. Any guess?
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-23 18:45:14
Hi Regor,
I bypassed the relative paths error just replacing them with absolute paths (as suggested by this user (https://hydrogenaud.io/index.php?topic=121277.msg1000551#msg1000551)), but it still fails to load, this time displaying this message:

Code: [Select]
Error: Spider Monkey Panel v1.6.1-dev+757cb073 (Playlist Manager: Playlist Manager v0.2 by XXX)
this.properties.bBOM is undefined

File: playlist_manager_list.js
Line: 1831, Column: 2
Stack trace:
  _list@playlist_manager_list.js:1831:2
  @:79:12

I tried some digging here but couldn't find anyone with the same error. Any guess?
Are you using the latest version? (from commits) Have you installed it at the right path (see installation txt file)?

Your error happens at the beginning of panel loading about a missing property on the panel, so that points to an installation problem. Try re-downloading the files.

Also SMP 1.6.0 is a broken release and I'm not supporting dev releases like 1.6.1 until it has been fixed, the SMP repository recommends to use 1.5.2 and that's what I support. Maybe that's your problem.

EDIT:  btw the user's comment you pointed to has a wrong installation path... so maybe that was also his problem. Please take a look at the installation file.
Title: Re: Playlist-Manager-SMP
Post by: jotti on 2021-09-23 19:41:33
Ok, I downgraded SMP to 1.5.2, and I re-installed the latest version* in the -I think- right path (C:\Users\andre\AppData\Roaming\foobar2000\scripts\SMP\xxx-scripts), but the problem is still there, and nothing loads.

*Be patient, I don't really know what "from commits" means... I just downloaded the zip from here (https://github.com/regorxxx/Playlist-Manager-SMP), green button "code", "Download ZIP"
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-23 21:16:47
Ok, I downgraded SMP to 1.5.2, and I re-installed the latest version* in the -I think- right path (C:\Users\andre\AppData\Roaming\foobar2000\scripts\SMP\xxx-scripts), but the problem is still there, and nothing loads.

*Be patient, I don't really know what "from commits" means... I just downloaded the zip from here (https://github.com/regorxxx/Playlist-Manager-SMP), green button "code", "Download ZIP"
Yep the last path is right if you are using a non portable install, and that's the zip you needed. Then, did you pointed to the new path at the panel? Seems obvious, but maybe you still had the panel trying to load the previous path and thus crashing.

Is the log the same now? I'm testing it on a portable fresh install directly from github and loads fine. Also try clearing the properties at the panel in case you got someting wrong there.
Title: Re: Playlist-Manager-SMP
Post by: altruumann@protonmail.com on 2021-09-23 23:05:57
Ok, I downgraded SMP to 1.5.2, and I re-installed the latest version* in the -I think- right path (C:\Users\andre\AppData\Roaming\foobar2000\scripts\SMP\xxx-scripts), but the problem is still there, and nothing loads.

Hi. I also waited a couple of months that the problem with relative ways is resolved with the new SMP release, but this did not happen (Win10 x64, 1607, SMP 1.5.2). For the scripts to work you will have to manually replace in each script the section that meets at the very top, from this:

Code: [Select]
include('
to this:
Code: [Select]
include(fb.ProfilePath + 'scripts\\SMP\\xxx-scripts\\
I didn't test all scripts functions yet, but i think this works.


Hi. Can you please add colour customization for buttons - for dark themes and styles? I use a high-contrast dark style in Windows, and in a Foobar the buttons in your scripts are displayed as "black font on a dark background". Or if i turn off the style, i have "white buttons on dark Foobar theme background". ::)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-24 09:00:11
Quote
include(fb.ProfilePath + 'scripts\\SMP\\xxx-scripts\\
Yep that's the good one. Thanks
I will create a batch file to do it... since I can't continue with half the people manually changing all files on every update.

Quote
Hi. Can you please add colour customization for buttons - for dark themes and styles? I use a high-contrast dark style in Windows, and in a Foobar the buttons in your scripts are displayed as "black font on a dark background". Or if i turn off the style, i have "white buttons on dark Foobar theme background".
The buttons background are managed by windows themes, so they can not be customized within foobar but follow what you set as you note. The problem is the font color, which is harcoded to black. That's what I have to change, to use the inverted color instead of always black.

Btw, until I do so you can change it at buttons_xxx.js & buttons_panel_xxx.js
Quote
         gr.GdiDrawText(iconCalculated, this.g_font_icon, RGB(0, 0, 0), x_calc - iconWidthCalculated / 5 - textWidthCalculated / 2, y_calc, w_calc, h_calc, DT_CENTER | DT_VCENTER | DT_CALCRECT | DT_NOPREFIX); // Icon
         gr.GdiDrawText(textCalculated, this.g_font, RGB(0, 0, 0), x_calc + iconWidthCalculated, y_calc, w_calc, h_calc, DT_CENTER | DT_VCENTER | DT_CALCRECT | DT_NOPREFIX); // Text
      } else {
         let textCalculated = _isFunction(this.text) ? this.text() : this.text;
         gr.GdiDrawText(textCalculated, this.g_font, RGB(0, 0, 0), x_calc, y_calc, w_calc, h_calc, DT_CENTER | DT_VCENTER | DT_CALCRECT | DT_NOPREFIX); // Text
Change the RGB(0, 0, 0) to any other like RGB(239, 239, 239)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-24 10:12:11
Ok. done. Decompress the entire zip into 'xxx-scripts', read instructions and run the bat file. Will work on any of my scripts and process the entire folder. Should work on future releases too.

Anyway this is a patch, as soon as you update the files it will have to be run again...
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-24 17:10:05
Hi. Can you please add colour customization for buttons - for dark themes and styles? I use a high-contrast dark style in Windows, and in a Foobar the buttons in your scripts are displayed as "black font on a dark background". Or if i turn off the style, i have "white buttons on dark Foobar theme background". ::)

Done, check latest update ;)
Readme updated (with full installation instructions). Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
### Added
- UI: buttons' text color can now be customized via menus.

Check previous reply's script to convert relative paths to absolute paths if Spider Monkey fails loading the scripts.
https://hydrogenaud.io/index.php?topic=120979.msg1003329#msg1003329
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-27 14:02:50
Readme updated with known problems (like the SMP bug (https://hydrogenaud.io/index.php?topic=120979.msg1003323#msg1003323)). Also added the cmd batch file (to switch paths) to the repository as workaround; no further changes. Updated not needed at all for already working installations. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-09-29 19:22:32
Just pushed a new update. Optimization of remove duplicates code. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   ### 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 (currently on AutoPlaylist cloning).
   ### Removed
   ### Fixed
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-10-05 20:27:07
Just pushed a new update. Added support for a new playlist format (for media servers compatibility like Kodi). Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   - Playlist formats: added read-only support for .strm format. Since format only allows one URL per playlist, M3U formats are preferred to create new playlists for the same purpose (which can also be read by streaming players).
   ### Changed
   - Selected playlist menu: Renamed 'Open playlist folder' to 'Show playlist file' on explorer.
   - Properties: added extensive checks to most properties.
   ### Removed
   ### Fixed
   - Autosave & Autoupdate: changing the properties via menus or properties panel could lead to values being formatted as strings instead of numbers, now disallowed at input (menus) and loading (value checking).

(*)  XSPF support (https://github.com/Chocobo1/foo_xspf_1/) will be added on next releases.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-10-08 21:40:43
Just pushed a new update. 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
   ### Removed
   ### Fixed

Spoiler (click to show/hide)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-10-10 19:12:33
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.

Thanks to the user who reported it!
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-10-14 17:25:39
Just pushed a new update. Added even more options to clone autoplaylists and for exporting playlists. Also created some presets ready to be used for foobar2000 mobile or kodi systems (see readme for usage, it has been updated), this along the ability to set format for the output playlist should allow to easily export playlists+files in one step to any device out there. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   - Menus: new entry to 'Clone AutoPlaylist and edit query'. Creates a clone of the selected AutoPlaylist and allows to edit the query afterwards; for easy AutoPlaylist creation using a generic query as base (instead of copying/pasting queries).
   - Export and convert: new default presets for multiple use-cases (Kodi devices, etc.). Use 'Restore defaults' at header menu to reload presets if updating from a previous version.
   ### Changed
   - Export and convert: '.\' is only added to paths when a preset is set to do so, playlist still use as paths whatever TF expression is used considering the file is along the playlist by default (relative path). Rationale: a preset can be set to either use relative paths (with or without '.\' at start) by default or edited to prepend an absolute path via Title Formatting. For ex: '.\%title%.mp3' and '%title%.mp3' are equivalent in practice. While 'MusicHDD:\music\%artist%\%album%\%track% - %title%.mp3' will use absolute path on playlist file (and tracks will have to be copied to such device and path for later use). This greatly simplifies exporting playlist to devices like Kodi in one step (without further manual path editing), since playlists require absolute paths and are usually stored in a different folder and disk than the music files.
   - Export and convert: presets can have their own playlist extension, selected playlist will be converted to that format -if required- on exporting. Note converting from M3U to PLS format involves discarding part of their metadata (tags, etc.).
   - Export and convert: presets can have a name instead of showing the TF expression. Name is set at header menu. This is only cosmetic, to easily identify them.
   - Helpers: additional checks at json loading on all scripts. Warnings via popup when a corrupted file is found.
   ### Removed
   ### Fixed
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-10-18 22:06:06
Pushed a new update. Added full .xspf playlist support (*) along some general file reading improvements to max compatibility with other software and SO's. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   - Playlist formats: .xspf format (https://en.wikipedia.org/wiki/XML_Shareable_Playlist_Format) full compatibility (read, edit and create). Follows the complete specification (https://www.xspf.org/xspf-v1.html): items not found don't break playlist loading (it continues with next item). If  an item is not found at the set the path, it also tries to find matches on library by query using fuzzy matching according to the playlist metadata (Title + Artist + Album + Track number or a combination of those). By default, if lock flag is not set on file, it's loaded as a locked file. Note fuzzy matching by queries may take a great amount of time on large libraries or when a lot of items are missing.
   - Blank lines: new entry to check for blank lines on playlists, although they may be allowed in some formats, some players may behave incorrectly with such playlists (for ex. with .strm files)
   ### Changed
   - When retrieving paths from M3U files, lines are trimmed (blank spaces). In other words, blank lines are simply skipped for any purpose. Other formats don't allow these "errors".
   - Editing metadata on playlists not created by the manager no longer fails neither warns about requiring loading/saving to update the format; now the playlist header is automatically rewritten and then the new metadata added. This change allows to edit metadata for almost any format while not having to rewrite playlists to the currently default format (i.e. allowing .xspf playlists to remain in their format even if the default one is .m3u8).
   ### Removed
   ### Fixed

   - While reading Playlist files, they are now split by lines using any of the possible escape sequence combinations (https://en.wikipedia.org/wiki/Newline) and not only windows ones (\r\n). This should allow to correctly read any playlist file created in any SO (no longer limited to Windows ecosystem).
   - Crash after manual refreshing a playlist with less items than the number of rows.

.xspf (XML Shareable Playlist Format ):  https://en.wikipedia.org/wiki/XML_Shareable_Playlist_Format
Quote
Traditionally playlists have been composed of file paths that pointed to individual titles. This allowed a playlist to be played locally on one machine or shared if the listed file paths were URLs accessible to more than one machine (e.g., on the Web). XSPF's meta-data rich open format has permitted a new kind of playlist sharing called content resolution.

A simple form of content resolution is the localisation of a playlist based on metadata. An XSPF-compliant content resolver will open XSPF playlists and search a catalog for every title with <creator>, <album> and <title> tags, then localise the playlist to reference the available matching tracks
In other words, query matching... so playlists may be shared as is among different users and libraries and still find matches (no matter the physical media structure). Note this is different to autoplaylists, since the latter looks for any track satisfying an arbitrary condition (GENRE IS ROCK), while the former specifically looks for tracks (U2 - One) which may be present or not on the library. An XSPF playlist will never output more tracks than those written on the playlist (contrary to an autoplaylist which allows duplicates and has no fixed size). (*)

There is an example playlist on the repo, attached here too. Put it on the playlist tracked folder and load it, it will try to find matches on your library. It's a collection of 800 tracks from the 90s so it should easily find at least some of them.

(*) Someone may notice I have explicitly disabled XSPF to be used as 'saving' format, such playlists need to be created manually first with a text editor or another player. Then items can be added with SHIFT+L. Button, metatada edited, etc.. I will change this after enough testing.
(**) This is obviosly similar to 'Import track list' tool at Playlist-Tools-SMP, but XSPF being an XML playlist also allows metadata and paths to work as an standard playlist too. It's also universally supported by other players (mostly Unix).
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-10-21 22:36:27
Pushed a small fix for XSFP files. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Meanwhile I'm working on adding XBMC Smart playlist support.
https://kodi.wiki/view/Smart_playlists/XSP_Method
Not only as a read only format, but also to convert current AutoPlaylists within foobar to a Kodi readable format... so they can be used on both devices. Currently I have been able to translate XBMC queries to Foobar queries, the part that takes more time is the reverse process (since foobar queries can be arbitrarily complex...).
Working great so far, and as a bonus, since Smart Playlists allow to use another playlists as sources, they can be effectively used as way to merge different playlists as pools.
Spoiler (click to show/hide)

Spoiler (click to show/hide)

The final aim is being able to translate most of the playlists created within foobar to other devices -and back- without loss of functionality. Manually duplicating those 30 autoplaylists from Foobar into Kodi can easily take days... while this approach would do it in seconds. The same applies copying playlists to Foobar2000 mobile, which requires manually editing paths, track conversion, etc. now all done automatically in one click with the 'Export and convert' presets.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-10-22 21:46:55
Just pushed a new update. Added new menu entry to clone playlists, full support for XBMC Smart Playlists (**) and other QoL changes and fixes. There are multiple playlist example files on the 'Examples' folder. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
   ### Added
   - Playlist formats: [.xsp format](https://kodi.wiki/view/Smart_playlists) full compatibility (read, edit and create). They are Smart Playlists which work on Kodi-like/XBMC systems, pretty similar to AutoPlaylists. Has been added a full layer of translations between XBMC-queries and Foobar-queries which allows conversion on the fly between both formats whenever it's possible. Some exceptions may apply, like most foobar TF functions not being available on .xsp format (check readme for more info). For all purposes Smart Playlists are treated like AutoPlaylists, being locked by default, having a query and sort, can be cloned as standard playlist or AutoPlaylist, etc. Metadata is also saved on the panel .json file, along AutoPlaylists and .fpl playlists metadata. Note queries checking for other playlists by name are also allowed (so it can use as source any playlist format read by the manager, even AutoPlaylists); this can be easily used as a way to merge different playlists as pools (the same it works on Kodi).
   - Menus: new menu entry on selected playlist menu to clone current playlist as another format. Shortcut to easily convert playlists between different formats without using the exporting tools. Checks the paths on the process, so dead items are reported and skipped.
   - Menus: new menu entry to edit limit of tracks output when loading playlist's query (currently only available for .xsp format).
   - Tooltip: limit is shown for AutoPlaylists (infinite) and .xsp playlists (set by playlist file).
   ### Changed
   - UI: Tweaked a bit the default colors to differentiate better every type of playlist, should look better by default now when changing the background to black too.
   - UI: .xsp playlists can be set to have their own color.
   - UI: popup warning if saving a playlist will involve changing the playlist format. This should avoid accidental changes. Configurable on header menu.
   - Edit query (.xsp only): query is now translated into an XBMC query after user input. Structure may change during the process (specially parenthesis and how things are grouped) and non recognized tags/expressions are skipped (those which have no XBMC counterpart). Please recheck query after edition on the tooltip to ensure it has been recognized properly. See readme for more usage info.
   ### Removed
   ### Fixe
d
   - Rare crash when using manual refresh while the mouse was over a playlist file deleted outside the panel.
   - Rare error when trying to create a playlist without a name, the name used was the filename + extension instead of only the filename. Only happened when trying to clone a playlist without UUID but UUIDs were enabled.

Spoiler (click to show/hide)

(*)  May be used to create XSPF playlists from scratch while the option to use .xspf as default format is disabled (testing period).
(**) Please be aware Smart playlist CAN NOT use all the TF variables and functions found on Foobar2000. Check https://kodi.wiki/view/Smart_playlists/XSP_Method for more info, so don't get surprised if things are skipped from the query on the translation process. This is done to ensure they work with Kodi/XBMC. Will update the PDF readme asap with full documentation.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-10-26 14:46:09
Just updated the pdf readme, with full documentation for the XSP format and advanced tips to create queries and use Smart Playlists as 'Pools'. Check on the repository.

It should hopefully help users to use all capabilities of those playlists.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-11-02 15:28:30
Just pushed a new update. Added new option to allow tracking UI-only playlists, thus allowing to use the manager as a playlist organizer (like most plugins out there) (*) along other fixes. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   - Playlist formats: new option to also show UI-only playlists on the manager panel, to use it as a simple playlist organizer. UI-only playlists are non editable but they can be renamed, deleted or restored. Sending current selection to playlist is also allowed. They have its own custom color too. To be able to use all the other features of the manager, consider creating playlist files instead. At any point you may use 'Create new playlist from Active playlist...' to save UI-only playlists as a tracked file.
   - UI: informative popups the first time an .xsp or .xspf playlis are loaded/created.
   - UI: added warnings when multiple playlist share the same name on the tracked folder (configurable).
   - XSP: new option to never auto-save .xsp playlists (thus avoiding format changes) even if they are not locked; this is now the default behavior.
   ### Changed
   - Menus: .xsp playlist now also have an option to copy the playlist file to another location (i.e. exporting the playlist).
   - UI: Smart Playlists are now identified as such in any text instance where they behave as AutoPlaylists, instead of using the generic 'AutoPlaylist' term for all. For ex. on tooltips warning the playlist can not be edited when trying to add a track. This is just a cosmetic change.
   - Duplicates: are now also checked when using the option 'Send selection to playlist' (and not only on Shift + L.Click).
   ### Removed
   ### Fixed

   - UI: cosmetic fix. Fixed 'AutoPlaylists' being written as 'Autoplaylists' on some instances.
   - UUID: UUID was not assigned properly on AutoPlaylist creation if option was enabled (thus not allowing multiple playlists with same name).
   - UUID: solved all instances where full name was not properly retrieved from Name + UUID strings, no matter if the option was enabled or not by using Regex to replace any possible UUID. This happened when UUID was enabled and trying to create new playlist from active playlist, i.e. the suggested name was not the full name.
   - UI: warnings about format changes are now moved after checking if playlist is locked. Previously it warned about it even if nothing would be changed due to the file being locked.

(*) Most options are disabled for these playlists since they don't have a physical file associated and I want to enforce using physical files for the advanced features (that's the reason this manager exists). On the other hand, sending selection to playlist is fully supported, along deletion/restoration... so it should come handy for those not using the playlist tabs bar.

Gif showing how to enable it and general functions:
Spoiler (click to show/hide)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-11-05 18:11:52
Just pushed a new update. Added new shortcut to show active playlist, some additions to UI-only playlists and minor fixes. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   - Shortcut: L. Click on header highlights active playlist on manager if possible (an associated file exists).
   ### Changed
   - Formats: playlist consistency tools (duplicates, external items and dead items), 'Clone as...' and 'Export and convert tracks to...' now also work with UI-only playlists.
   ### Removed
   ### Fixed

   - UI: fixed some instances where the current position on the list view got reset after updating a playlist file.
   - UI: selection indicator is now only displayed if the mouse is over the panel. It was shown on some instances when updating the current view, while trying to remember the last selected item to maintain the current index.
   - UI: fixed some instances where the currently playlist playlist was incorrectly displayed (with playback stopped).
   - Dead items: https streams were incorrectly reported as dead items due to a typo.

Spoiler (click to show/hide)

Also updated the readme with all the latest changes and explaining new features (along UI-only playlists). Images updated to reflect all changes to menus on last updates.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-11-11 17:35:55
Just pushed a new update. Added key quicksearch, built-in playlists backups and some changes to the basic behaviors. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
   ### Added
   - UI: pressing any key while focus is on panel will scroll the list to the first playlist whose first name's letter matches the key (sorting by name), first category's letter (sorting by category) or first size's number (sorting by size).
   - Backup: new option to automatically backup the playlist files by interval, when unloading the script and just after loading a playlist file on UI (if auto-saving is enabled). Setting the interval to zero completely disables the feature on any case; to only backup on script unloading/playlist loading, set it to 'Infinity'.
   ### Changed
   - Auto-saving: playlists are not immediately auto-saved after loading them, but only after a change is made. This is done caching the last playlists loaded until auto-saves fires for the first time later. This change makes unwanted format changing a bit more difficult, requiring explicit user interaction with the playlist to change it.
   - Send selection: loaded playlists are not immediately auto-saved after sending selected tracks to it (menu or shortcut actions). This behavior follows previous comments about not needing to rewrite the playlist. Note sending the selection already edits the playlist file, so this skips the auto-saving step (since its also loaded in the UI) which could involve changing the playlist format.
   ### Removed
   ### Fixed

   - Cache: added safechecks to library cache to ensure loaded item is the one pointed at the playlist. At some instances, after adding/removing library items without reloading the panel cache, some tracks could have been mixed up due to different index.
   - Cache: now gets rebuilt whenever an item is added/removed to the library, not only at startup. This is in addition to the previous check (to automatically solve it).
   - Force relative paths: tool was not working properly for .xspf playlists, now paths are properly replaced considering they are URI encoded.
   - Bind active playlist to file: when canceling the popup that appears trying to bind the active playlist to a playlist file with a non-default format, playlist file binding was properly aborted (no file changes) but the active playlist was already renamed. Now aborting also reverts the renaming, renaming it again back to the original name. This 'fix' also applies
   - Crash on menu due to a typo.

Spoiler (click to show/hide)

Readme pdf has also been updated to reflect all the changes.
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-11-14 12:12:25
Just pushed a new update. Reworked filter buttons and UI. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.

Quote
   ### Added
   - UI: filter buttons are now configurable by R. Clicking on them. The menu on any of the 2 buttons allows to set the selected button to filter by Playlist type, lock status, extension, category or tag. There is also an entry to reset all filtering and the current buttons configuration is saved between sessions (the filtering itself follows its own configuration). Note filters are accumulative, i.e. changing a button from lock status to extension will not reset its previously selected filter. Tooltips have been updated accordingly.
   ### Changed
   - UI: sorting method configuration is now opened by R. Clicking directly on the sort button, following the same behavior thane the [new] filter configuration menus.
   ### Removed
   ### Fixed

   - Bind active playlist to file: when canceling the popup that appears trying to bind the active playlist to a playlist file with a non-default format, playlist file binding was properly aborted (no file changes) but the active playlist was already renamed. Now aborting also reverts the renaming, renaming it again back to the original name. This 'fix' also applies in any case where the playlist saving fails or is aborted.

Spoiler (click to show/hide)
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-12-24 09:15:38
https://github.com/regorxxx/Playlist-Manager-SMP/releases/tag/v0.6.0-beta.1
Quote
External players integration, QOL and stability improvements
Considered a beta due to a SMP's bug on installation. See _TIPS and INSTALLATION.txt
REQUIRES SMP 1.5.2.

    Playlist formats: UI-only playlists, .xsp format full compatibility, .xspf format full compatibility (read, edit and create), read-only support for .strm format.
    Automatic backups. So previous version of playlists may be restored if something goes wrong.
    Quick-search.
    UI reworked: buttons, menus, etc. Much more intuitive now. More customization available.
    New sorting and filtering options.
    UI: new sorting option by first tag. Playlists without tags are considered as 'first'. Note it uses only the first tag of all the available tags for a given playlist, so order is relevant.
    Tons of new options for AutoPlaylists.
    Tons of new tools to check playlist consistency.
    Exporting tools ready to be used along Foobar mobile, Kodi-like systems, etc. (full documentation on PDF!)
    Metadata inheritance on new playlists.
    Improved library caching, animation popup while loading the panel and new instance manager (to share the cache between multiple panels instead of calculating it on every panel).
    Added multiple playlist checks of different nature at saving, loading, etc. to ensure playlists don't get corrupted, have wrong paths, etc.
    More than 20 fixes related to cache, playlist saving, UI, crashes, etc. RECOMMENDED TO USE THIS NEW RELEASE.

See changelog for a full list: https://github.com/regorxxx/Playlist-Manager-SMP/blob/main/CHANGELOG.md
Title: Re: Playlist-Manager-SMP
Post by: regor on 2021-12-29 23:17:41
Just a small update. Also uploaded the latest version of the manual to the repo with explanations of all features up to date. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
## [Unreleased][]
### Added
### Changed
- Tooltip: added metadata inheritance notice on filter button tooltips (category and tag filtering).
- Header menu: added metadata inheritance notice on header filtering submenus (category and tag filtering).
### Removed
### Fixed

Spoiler (click to show/hide)

PD: there is no more changes so if you don't care about the manual update (which explains how metadata inheritance works) and those 2 minor UI cosmetic things, feel free to skip it and use the official release from above. No more updates planned until end of Jan 2022.