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 Organizer (aka foo_plorg) replacement on Jscript Panel 3 (Read 59763 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

I was missing too these functionalities under Foobar V2 so i tried to develop a replacement on @marc2k3 Jscript Panel 3.
I'm not a professional developer so there may be bugs, just let me know and i'll try to fix them.

The following zip contains 3 files :
main.js file which is the main panel script
panel_pl_organizer.js
pl_organizer.js which is the main code

The last 2 files are to be copied in the fb.ProfilePath + "\pl_organizer" folder
X
You need to create a JScript 3 panel, its code has to be the main.js file (copy/paste).

Jscript Panel 3 link : https://jscript-panel.github.io/docs/



Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #1
This is nice!
There are a few features I'd need to be able to use it more easily. I am even less of a professional developer I'd say, but I can see if I can work anything out.
Anyway:

  • Sort items within folders
  • Type to search - i.e. start typing name of playlist to jump to it
  • Multi-select is a nice-to-have. This would make it much easier to organise when you have a lot of folders


Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #2
Oh, by the way, there's a stray '}' at the bottom of Main.js which causes an error when you first load it :)

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #3
thanks for the feedback new file with the add. stray corrected :

X

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #4
No worries! Thanks.
Also, the dragging to re-order is off by 1. It's counterintuitive but this works correctly:

Code: [Select]
if (this.draggedIndex < this.droppedIndex) this.droppedIndex = this.index-1 ; else this.droppedIndex = this.index;

I've also changed the yellow colour to something I preferred (a darkish purple), because I find the yellow hard to read on my screen. Maybe it'd be good to make that configurable.

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #5
yes, to be honest, i wanted to implement a color picker for the colors hence my weird yellow colors. I'll do that later :)

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #6
@etip

Could you please write the script name, version and update date?

for example:
Playlist Organizer (Jscript Panel 3)
v1.0.0
2023-03-11

--------
Main.js
// ==PREPROCESSOR==
// @name "Playlist Manager" ← Can I change my current name?
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #7
ok i will from now on.
thanks

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #8
Hi etip,

thank you very much for the new (old) foo_plorg! All of it‘s funktion work flawlessly -  no issues at all. I’m very happy with your plugin!

The only thing I would like to change, are some points of it’s design – of course this is very personal. The overall design looks a little bit „old fashioned“ with the different icons. Below I give you a little wish list what I would like to change. I would really like to do by myself but I don’t know how to realise.

1. Remove all icons.  No bold letter – or optional. Folder should differ from playlists just through their width. All playlists are indented to the right and therefore shorter.

2. Opened folder have a small arrow at their very left side. Closed folder an arrow pointing to the right (see attached pictures). No item count on folder – just plain or optional.

3. No vertical line at the beginning of each playlist.

4. Active playlist in which the current track playing is identified by a different colour which can be set by the user.


https://hydrogenaud.io/index.php?action=dlattach;sa=tmpattach;attach=post_tmp_6001_728edf665203b74b10fb3531c2c95391;topic=123820

https://hydrogenaud.io/index.php?action=dlattach;sa=tmpattach;attach=post_tmp_6001_878410b2686ac75d74544db0884172f9;topic=123820
Martin


Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #9
I've done a lot of playing with the code to add some features like better navigation with the keyboard, but a drawback that will stop me being able to use the component is that you can't drag tracks into the playlists shown on the panel.
I'd love to know how one could make that work - if so, I'd be really happy with it!

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #10
Latest version (2023-03-11)
https://hydrogenaud.io/index.php/topic,123820.msg1023622.html#msg1023622

https://i.imgur.com/kk4FMBD.png Default UI
https://i.imgur.com/oOu6UBT.png Default UI - Dark Mode

Google Japanese (Japanese wiki) → English
Playlist Organizer (Playlist Manager) (JScript Panel 3 Script): by etip
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #11
I've done a lot of playing with the code to add some features like better navigation with the keyboard, but a drawback that will stop me being able to use the component is that you can't drag tracks into the playlists shown on the panel.
I'd love to know how one could make that work - if so, I'd be really happy with it!

Me too

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #12
@Air KEN thank you.
@DJ FRANK G. & @frogworth : i'll look into the drag & drop.
@frogworth : if you want me to integrate your code into mine let me know, that can benefit to others.

New version :
Playlist Organizer (Jscript Panel 3)
v1.1.0
19-03-2023

Changes :

Bug fixes and code optimization
Change color option for :
   - Folder name
   - Buttons
   - Playlist name
   - Selection bar
   - Background
Save configuration:
   - Auto collapse
   - Text and color preference
Album art as background
The right click menu is split in 2 :
   - Within the playlist area for contextual menus
   - Within the header area for customization menus
Got rid of the vertical lines beginning of a playlist

Let me know if you find bugs

The following zip contains 3 files :
main.js file which is the main panel script
panel_pl_organizer.js
pl_organizer.js which is the main code

The last 2 files are to be copied in the fb.ProfilePath + "\pl_organizer" folder

You need to create a JScript 3 panel, its code has to be the main.js file (copy/paste).

Jscript Panel 3 link : https://jscript-panel.github.io/docs/

X

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #13
I was working on this reply, and then I noticed you posted a new version, Apologies if some of what I have written no longer applies and has now been fixed.

Anyway, THANK YOU for developing this, I've been playing around with it this morning and restoring my playlist hierarchy, it's lovely to have a usable playlist manager again, and currently better than any of the alternatives.

A few requests, questions and general thoughts/feedback:

- I can't create a new folder and name it "Default", I am given an error saying it already exists, when it doesn't. Creating a folder with a different name and then renaming it to "Default" afterwards ostensibly works, however I strongly recommend against doing this because if one then renames any playlist (or even cancelling a rename operation), additional redundant folders called "Default" are created. I advise anyone to avoid calling their folders "Default" (at least for the time being.)
- Right-clicking an AutoPlaylist and selecting "AutoPlaylist...", I expect the AutoPlaylist configuration/pattern to open, but nothing at all seems to happen? Is this feature simply broken?
- It doesn't seem possible to drag a playlist from one folder directly to another, need to drag a playlist out of a folder first, before moving it to another.
- I'd like to specify my own font, for consistency with the rest of my layout (I use Tahoma.)
- Is it possible to add a scrollbar, to take some strain off my scrollwheel? (Ideally a Dark Theme-compliant one!)
- I prefer double-click to activate playlists. Some of my playlists are rather large, so I may not want to load them accidentally while organising playlists.
- I may be missing some external dependencies, because the symbols used for the Display Size/Numbers toggle, the scroll up/down buttons, the yellow currently playing playlist icon and the group icons are empty rectangles/not displaying correctly. Also the scroll up button is sort of buried under the help button and very hard to activate. To be honest, I don't particularly need these anyway (re: scrollbar, would be preferable.) Screenshot attached.
- As mentioned in a previous post, some simple colour configuration would be nice, or to have it observe colour settings specified elsewhere.
- I don't need to know the total # of playlists I have at the top. Some way to disable this message and the red line underneath it would be appreciated.
- Also there's quite a lot of padding/negative space on the left side of the panel. Not a big deal, but might be nice to save a bit of screen space.
- The vertical lines to the left of the playlist names may be unnecessary too, but not a big deal either.
- This may be a foo_quicksearch issue (forgive me if so), but the quicksearch playlist disappears from the group it's in and is recreated at the bottom of the tree. This also happened with plorg as of foobar 2.0...
- Where is the playlist/folder layout stored? Can it be backed up or imported? Is there any danger that it could be lost to an unexpected app or panel crash? I thought I'd ask this before I update to the newer version, too.
EDIT (one more) - I am experiencing significant lag when selecting songs in playlists. Does the song you have selected update the panel in some way?

Thanks again, great work with this.

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #14
@etip
Many Thanks.
https://i.imgur.com/QbX7FlF.png
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #15
- I may be missing some external dependencies, because the symbols used for the Display Size/Numbers toggle, the scroll up/down buttons, the yellow currently playing playlist icon and the group icons are empty rectangles/not displaying correctly.

Agree with some of your comments (like scrollbar).
Just wanted to say, this is a dependency of JScript Panel 3 in general. It's FontAwesome you need: https://github.com/FortAwesome/Font-Awesome/blob/4.x/fonts/fontawesome-webfont.ttf?raw=true

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #16
@iridescentaudio : thanks for this constructive and detailed feedback, really appreciated.

- I can't create a new folder and name it "Default", I am given an error saying it already exists, when it doesn't. Creating a folder with a different name and then renaming it to "Default" afterwards ostensibly works, however I strongly recommend against doing this because if one then renames any playlist (or even cancelling a rename operation), additional redundant folders called "Default" are created. I advise anyone to avoid calling their folders "Default" (at least for the time being.)
i can create folder with the name "Default" in my foobar. Does anyone else has that issue ?

- Right-clicking an AutoPlaylist and selecting "AutoPlaylist...", I expect the AutoPlaylist configuration/pattern to open, but nothing at all seems to happen? Is this feature simply broken?
It's fixed in the update i posted today

- It doesn't seem possible to drag a playlist from one folder directly to another, need to drag a playlist out of a folder first, before moving it to another.
Yep, saw that, i thought it was working by design, it doesnt. I'll need to look into it.

- I'd like to specify my own font, for consistency with the rest of my layout (I use Tahoma.)
Adding that to my list, i was planning on tackling the font topic next (it's quite a mess today).

- Is it possible to add a scrollbar, to take some strain off my scrollwheel? (Ideally a Dark Theme-compliant one!)
I know Marc implemented one so i'll be able to use it but for my information, isnt it much easier to use the wheel ?

- I prefer double-click to activate playlists. Some of my playlists are rather large, so I may not want to load them accidentally while organising playlists.
Ok, in my list of todos

- I may be missing some external dependencies, because the symbols used for the Display Size/Numbers toggle, the scroll up/down buttons, the yellow currently playing playlist icon and the group icons are empty rectangles/not displaying correctly. Also the scroll up button is sort of buried under the help button and very hard to activate. To be honest, I don't particularly need these anyway (re: scrollbar, would be preferable.) Screenshot attached.
yep, you had the answer from frogworth.

- As mentioned in a previous post, some simple colour configuration would be nice, or to have it observe colour settings specified elsewhere.
Let me know if this is what you were looking for in the last version.

- I don't need to know the total # of playlists I have at the top. Some way to disable this message and the red line underneath it would be appreciated.
i'll look into making it optional. I may have an issue because this is where the right click custom menu happens now.

- Also there's quite a lot of padding/negative space on the left side of the panel. Not a big deal, but might be nice to save a bit of screen space.
i'm using it for the "note" to highlight the playlist which song is currently playing. i may change that.

- The vertical lines to the left of the playlist names may be unnecessary too, but not a big deal either.
done in the last version.

- This may be a foo_quicksearch issue (forgive me if so), but the quicksearch playlist disappears from the group it's in and is recreated at the bottom of the tree. This also happened with plorg as of foobar 2.0...
does that happen after you create a new search (in that case it cant stay in the folder as foo_quicksearch has no clue that folder exists. I think it deletes and recreates that quicksearch.

- Where is the playlist/folder layout stored? Can it be backed up or imported? Is there any danger that it could be lost to an unexpected app or panel crash? I thought I'd ask this before I update to the newer version, too.
look for a "pl_organizer.txt" file, it should be in your fb.ProfilePath folder (use : console.log(fb.ProfilePath); if you want to know where it is).

EDIT (one more) - I am experiencing significant lag when selecting songs in playlists. Does the song you have selected update the panel in some way?
yes, but it doesnt make sense so i'll post a new version to fix this later.


Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #17
Great, thank you for your answers etip (and frogworth), much appreciated. Yeah, the new version fixed a bunch of things, already much better.

Quote
I know Marc implemented one so i'll be able to use it but for my information, isnt it much easier to use the wheel ?

I have a lot of playlists (132 apparently!) so it takes me four scrolls of the scrollwheel to get between the top and bottom of my playlists. I could get more into the habit of collapsing folders so that I don't need to scroll, I suppose, but my instinct re: plorg is to keep all of them open and use the scrollbar.

By the way, the Auto-Collapse option crashes the panel for me with this error:

Code: [Select]
JavaScript runtime error
Unable to get property 'lvl' of undefined or null reference
File: C:\Users\Dave\AppData\Roaming\foobar2000-v2\pl_organizer\pl_organizer.js
Line: 101, Col: 4

Quote
does that happen after you create a new search (in that case it cant stay in the folder as foo_quicksearch has no clue that folder exists. I think it deletes and recreates that quicksearch.

Yea, any new search will in-effect move the playlist to the bottom. There may be some way to mitigate this in the quicksearch config, I'll investigate.

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #18
New version :
Playlist Organizer (Jscript Panel 3)
v1.2.0
19-03-2023

Version changes :
Drag & Drop from other panels/playlist viewers to populate regular playlists.
Option to double or single click to open a playlist.

The following zip contains 3 files :
main.js file which is the main panel script
panel_pl_organizer.js
pl_organizer.js which is the main code

The last 2 files are to be copied in the fb.ProfilePath + "\pl_organizer" folder
X

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #19
By the way, the Auto-Collapse option crashes the panel for me with this error:

Code: [Select]
JavaScript runtime error
Unable to get property 'lvl' of undefined or null reference
File: C:\Users\Dave\AppData\Roaming\foobar2000-v2\pl_organizer\pl_organizer.js
Line: 101, Col: 4

Can you please tell me what do you do to have that error ? I'd like to try to reproduce it as it seems to work for me.
thanks

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #20
New version :
Playlist Organizer (Jscript Panel 3)
v1.2.0
19-03-2023

Version changes :
Drag & Drop from other panels/playlist viewers to populate regular playlists.
Option to double or single click to open a playlist.

Wonderful to have drag & drop working, thanks so much @etip!

I've attached my new edited version of pl_organiser.js if you're interested.
The changes are basically just for keyboard navigation. I've added:
  • Home and End to easily jump to top and bottom of the list
  • PgUp and PgDn to go page by page
  • Left and Right - if focused on folder, close or open; if on a playlist within a folder, left jumps focus to the containing folder
  • Enter to select a playlist

Any other changes I'd made thus far were cosmetic and are basically resolved by your colour selection :)

Warning: In this version I've also disabled the Delete key, as I find it too dangerous.
If you're willing, I'd like an option to enable or disable this functionality.

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #21
@frogworth
good job!
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #22
@etip BTW, regarding:
Quote
I know Marc implemented one so i'll be able to use it but for my information, isnt it much easier to use the wheel ?

For me, I have such a large number of playlists that using the scrollwheel is quite awkward. Grabbing a scrollbar gives me finer control, in my experience.
I've mitigated this by adding the additional keyboard navigation, but would still like a scrollbar too.

Oh, and the other thing a scrollbar does is give you a visual representation of where you are relative to the entire content of the panel.

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #23
I've attached my new edited version of pl_organiser.js if you're interested.
The changes are basically just for keyboard navigation. I've added:
  • Home and End to easily jump to top and bottom of the list
  • PgUp and PgDn to go page by page
  • Left and Right - if focused on folder, close or open; if on a playlist within a folder, left jumps focus to the containing folder
  • Enter to select a playlist

Any other changes I'd made thus far were cosmetic and are basically resolved by your colour selection :)

Warning: In this version I've also disabled the Delete key, as I find it too dangerous.
If you're willing, I'd like an option to enable or disable this functionality.
Thank you, if you dont mind, i'll implement these navigation options so that we'll have one main script.

Re: Playlist Organizer (aka foo_plorg) replacement on Jscript Panel 3

Reply #24
Thank you, if you dont mind, i'll implement these navigation options so that we'll have one main script.

I'd really appreciate that - I don't want to be forked anyway!
VERY minor thing but I've added "Configure..." back (in the top context menu) here, so that one can alter Main.js without too much bother (it also allows for updating the panel when editing the other .js files).