Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Playlist-Manager-SMP (Read 49844 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Playlist-Manager-SMP

A playlist manager for foobar2000 and Spider Monkey Panel to save and load (auto)playlists on demand, synchronizing, ... along many more utilities.


Features


  • Manages Playlist files and AutoPlaylists.
    • Playlist files are linked to physical files (.m3u8, .m3u, .pls or .fpl).
    • AutoPlaylists are saved into json format.
    • All playlist are loaded in cache once, filtering just changes the "painted" playlist on the list.
  • AutoPlaylists: contains all functionality on Auto-playlist Manager by marc2003 plus more.
    • Create, rename, delete AutoPlaylists.
    • Edit query, sort pattern and sort forcing.
    • Adds tooltip info, UI features, filters, etc.
    • Number of tracks output is updated at foobar startup. (and/or 'at manual refresh')
  • Loads .m3u8, .m3u and .pls playlists x100 times faster than standard foobar (if all items are on library). i.e. "As fast as the native format".
  • Auto-saves changes within foobar to binded playlists files. (configurable)
  • Automatically updates changes within the tracked folder. (configurable)
  • New updates are delayed when performing internal updates/processing to avoid conflicts.
  • Bind playlist to files:
    • Tracks playlists for changes and update binded files.
    • Auto-saving (configurable).
    • Deleting the file also ask to delete the binded playlist.
    • Renaming the files also renames the binded playlist.
    • Show binded playlist (becomes active playlist).
  • Lock/unlock playlists (so they are read-only).
    • Automatically locking of native foobar playlists files (.fpl). (configurable)
    • When locked, playlists can not be updated nor edited. They can be deleted.
    • Filename can be changed, but not playlist name (inside the file). This allows to set different playlist and file names if required.
  • Playlist unique IDs. You can have multiple playlists with same name on the UI and binded to different files. (configurable)
    • If changing UUIDs config while having playlists already loaded, then new config will be used whenever they get updated.
    • You can manually force new UUID config just by renaming the files.
  • Show playlist size on the list. (some limits apply for .fpl playlist files) (configurable)
    • All (refresh autoplaylists queries)
    • Only standard playlist
    • No size
  • If you choose not to refresh autoplaylist sizes, then the first calculated size gets used: when imported from json or creating the autoplaylist.
  • Tooltips show different playlist info:
    • Name plus UUID.
    • Playlist size (tracks). Also for AutoPlaylists (the number of tracks output by the query).
    • Category / Tag(s).
    • Status (lock).
    • Query. Sort Pattern. (AutoPlaylists)
  • Cyclic filters:
    • Show All | Only Autoplaylists | Only Playlists
    • Show All | Not locked | Only locked
  • Cyclic Sorting:
    • Name: Az | Za
    • Size: Ascd. | Desc.
    • Category: Az | Za
  • UUIDs: added to the name, so they are separated from non tracked playlist by name when loaded in foobar. Some also allow some level of names duplication.
    • Invisible unicode chars plus (*)
    • (a-f)
    • (*)
    • Or none
  • 3 different writable formats. (some limits apply for .pls playlist files) (configurable)
  • Filter (configurable) and sorting gets saved between reloads.
  • RecycleBin: deleting and restoring.
    • Uses timestamps to uniquely identify files: no collisions with other files within the RecycleBin.
  • A backup of the previous playlist json file is created every time the panel is loaded. Old backups are sent to recycle bin.
  • Properties descriptions change according to things set on the panel, not just the values. i.e. if you change the sort method, then the description reflects the associated states dynamically.
  • UI:
    • UI resizable on the fly.
    • Selection indicators.
    • Now playing and loaded playlist indicators.
    • Empty / not empty playlist indicators. To be used as fallback when size is not shown.
    • Size (configurable).
    • Separators between different names/categories (configurable).
    • Colours for different playlists types and status (configurable).


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 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: 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

Re: Playlist-Manager-SMP

Reply #1
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.

Re: Playlist-Manager-SMP

Reply #2
[0.2.2] - 2021-05-19
### 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

Re: Playlist-Manager-SMP

Reply #3
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)
### 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

Re: Playlist-Manager-SMP

Reply #4
## [0.3.0] - 2021-05-26
### 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.

Re: Playlist-Manager-SMP

Reply #5
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 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. 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 functionality).

Re: Playlist-Manager-SMP

Reply #6
## [0.3.1] - 2021-05-28
### 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".

Re: Playlist-Manager-SMP

Reply #7
v0.4.0 - File restructuring and cleanup
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

 

Re: Playlist-Manager-SMP

Reply #8
v0.4.1 - Playlist Tools integration
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).

Re: Playlist-Manager-SMP

Reply #9
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)

Re: Playlist-Manager-SMP

Reply #10
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.

Re: Playlist-Manager-SMP

Reply #11
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.

Re: Playlist-Manager-SMP

Reply #12

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

No, it wasn't me :)


Re: Playlist-Manager-SMP

Reply #13
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.

Re: Playlist-Manager-SMP

Reply #14
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

Re: Playlist-Manager-SMP

Reply #15
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!)

Re: Playlist-Manager-SMP

Reply #16
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


Re: Playlist-Manager-SMP

Reply #18
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 , someone suggested that maybe with your component this could be done...)

Re: Playlist-Manager-SMP

Reply #19
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 , 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.

Re: Playlist-Manager-SMP

Reply #20
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!


Re: Playlist-Manager-SMP

Reply #21
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.

Re: Playlist-Manager-SMP

Reply #22
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.

Re: Playlist-Manager-SMP

Reply #23
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

Re: Playlist-Manager-SMP

Reply #24
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 (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.