Giter Club home page Giter Club logo

regorxxx / playlist-manager-smp Goto Github PK

View Code? Open in Web Editor NEW
47.0 2.0 5.0 1.35 GB

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

Home Page: https://regorxxx.github.io/foobar2000-SMP.github.io/scripts/playlist-manager-smp/

License: GNU Affero General Public License v3.0

JavaScript 98.32% Batchfile 1.68%
foobar2000 foobar2000-component foobar2000-theme playlist-manager foobar2000-smp-script m3u8 m3u m3u8-playlist m3u-playlist pls-playlist-files

playlist-manager-smp's Introduction

Hi there :)

I'm Regorxxx. I work as a photographer. In my spare time I do open-sourcing (normally it is about 1-2 hours every day). I'm interested and contributing to free software, and particularly to audio related software. Advocate of open-source and sharing, trying to offer similar features than network players and servers like Spotify, Itunes Genius, YouTube, etc. right in your system: offline and using open data.

foobar2000 audio player ListenBrainz Harmonic mixing Xelection Xelection

Getting in touch

By Mail   At hydrogenaudio   At ko-fi   Donate using Liberapay (requires account on web)

playlist-manager-smp's People

Contributors

regorxxx avatar sonofevil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

playlist-manager-smp's Issues

Filter bar at top

Mimic library viewer filter bar, and replace the current header with that.

Playlist folder button, configuration button #34 and a state button (which should show the current header tooltip) must be rearranged.

Accessibility: playlist icons

Change playlist icons with different icons according to playlist type. It should allow playlist identification even without color codes or tooltip info.

Multiple selection

Multiple playlist selection to apply left click actions: export, set tags, etc.

Design idea:

  • Middle click.
  • Click on icon (when shown).

UI for settings

I've just installed this and finding it impossible to set this up without a UI.

The menu just disappears and you have to start all over again to go through the menu.

Probably a huge undertaking to do.

Playlist highlighting behaving erratically

Sometimes UI does not not jump properly to highlighted playlist on quicksearch, show current/active playlist, etc.

Replace mouse wheel simulation with a single jump.

helpers_xxx_flags.js is gone

Hi, I think a file was lost after update to the lastest..

Error: Spider Monkey Panel v1.6.0 (Playlist Manager: Playlist Manager v0.5.0 by XXX)
include failed:
include failed:
Path does not point to a valid file: helpers_xxx_flags.js

File: buttons_panel_xxx.js
Line: 6, Column: 1
Stack trace:
@buttons_panel_xxx.js:6:1
@playlist_manager.js:13:1

after update to the latest plm

regards :-)

[BUG] Playlists from selection are empty - "Index out of bounds"

Describe the bug
Any new playlist created from selected tracks via drag & drop or menu is empty and accompanied by console errors like this:

[10:23:56 PM] Playlist Manager: Error adding tracks to playlist. Index (118) out of bounds. (sendSelectionToPlaylist)

118 seems to be the number of playlists I have. Looks like it's too many for the script to handle, though it doesn't prevent me from creating playlists, they are just empty for some reason. I can still subsequently add tracks manually.

I know that's a lot of playlists, and that may make it a somewhat rare use case, but it's not just unused junk, they are actually all part of how I manage my music library. But I'm considering ways to reduce the number.

To Reproduce
Steps to reproduce the behavior:

  1. Have 118 playlists.
  2. Select some tracks.
  3. In the playlist menu click "Create new playlist from selection..."
  4. Observe new playlist being empty and error in console.log.

Expected behavior
New playlist contains the selected tracks.

Desktop (please complete the following information):

  • OS: EndeavourOS & Wine 8.9-1
  • Browser: Wine browser
  • Version: Latest Github clone

Toolbar buttons are initially invisible on a dark panel theme

If background is set to black and text to white in Foobar2000's default UI settings, and a new SMP panel with Playlist Manager is created, the toolbar buttons at the bottom are initially invisible. This is affected by the "UI" -> "Button Toolbar..." setting:

Okay, I created a new panel to check the behavior, and they actually start invisible (presumably black on black). But then when I change the setting, and afterwards return it to default, they remain visible. So the problem is permanently resolved for a given panel after changing the setting once.

Originally posted by @sonofevil in #40 (comment)

This behavior was observed on Linux with Wine 8.7-1

[FEATURE] Pinned playlists

Is your feature request related to a problem? Please describe.
Manual sorting is not yet possible.

Describe the solution you'd like
A simple way to make managing a large number of playlists easier might be to allow pinning selected playlists to the top of the list. This could make operations like frequent moving of files from temporary to permanent (i.e. how long a playlist is used before it is deleted) playlists easier. Implementation seems straightforward for physical playlists. I don't know if there is a good way to implement this for UI-only playlists. But as a physical-only feature it could still be quite helpful.

Describe alternatives you've considered
Creating a category for playlists one might otherwise want to pin, and then switching categories (or filtering) as needed. However, this is very inconvenient for the use case described above.

Another alternative would be to utilize tags. Create a "_pinned" tag and then select sorting by tags. Problem: This currently makes it impossible to use other sorting schemes at the same time. Same goes for using name prefixes and then sorting by name. By contrast, a pinning feature could take priority over the selected sorting scheme, such that pinned and unpinned playlists are first separated in the UI and then sorted separately.

capitalizeFirstLetter is not defined

After updating to the latest release there and it gives this error.

Error: Spider Monkey Panel v1.4.1 (Playlist Generation Menu: Playlist Generation Menu by xxx)
capitalizeFirstLetter is not defined

File: playlist_tools_menu.js
Line: 244, Column: 9
Stack trace:
  condFunc/</<@playlist_tools_menu.js:244:9
  condFunc/<@playlist_tools_menu.js:242:42
  condFunc@playlist_tools_menu.js:233:17
  _menu/this.btn_up/<@menu_xxx.js:159:11
  _menu/this.btn_up@menu_xxx.js:157:12
  newButtons.menuButton<@<main>:56:8
  SimpleButton/this.onClick@buttons_xxx.js:134:31
  on_mouse_lbtn_up@buttons_xxx.js:211:17

[BUG] "Playlist generation failed" when removing all tracks from playlist

Describe the bug
Today I synced the scripts with Github, and now whenever I remove all tracks from a playlist, a few seconds later it throws the "playlist generation failed" error (see screenshot).

Otherwise everything works as expected. The file is in reality updated just fine.

Might be related to my other issue, not sure. But UUIDs for playlist names is disabled. It's reproducible on a new SMP panel. Bug probably was introduced between June 6 and now.

To Reproduce
Steps to reproduce the behavior:

  1. Create an empty playlist called "test".
  2. Add some tracks to it.
  3. Remove all the tracks from it.
  4. Wait for error.

Expected behavior
No error.

Screenshots
Screenshot_20230617_182022

Desktop (please complete the following information):

  • OS: EndeavourOS & Wine 8.9-1
  • Browser: Wine browser
  • Version: Latest Github clone

Multi-selection merge load

reupen/columns_ui#176

The way I imagine it, selecting a folder would show all of its sub-playlists appended. Or I could ctrl+click, shift+click to select multiple playlists/folders to show their merged content.

Support relative paths from playlist file to media files

I use fb2k to manage a music collection on my NAS. The library is mounted as a network drive (Z:\) on the machine. Consequently, playlists created by SMP contain that letter in their %path%. As my Playlist folder is in the same folder as my music library, I would prefer them to be relative to the playlist file location. For example:

Playlist file: 
   Z:\Music\Playlists\example-playlist.m3u8

Containing the following absolute path:
   Z:\Music\Albums\Rock\Artist - Album\01. Track.mp3

Desired relative path
   ..\Albums\Rock\Artist - Album\01. Track.mp3

A simple way would be to make the TitleFormat strings used in savePlaylist available as a configuration parameter. That way, they can be used e.g. in VLC on Android to play back their contents on many different devices.

Currently, I have simply modified the following line in helpers_xxx.js, function savePlaylist to the same effect:

let tfo = fb.TitleFormat('#EXTINF:%_length_seconds%,%artist% - %title%$crlf()' + '$replace(%path%,Z:\\Music,..)');

This lock is owned by a different component

I tried to unlock a selection of playlists after figuring that bit out and entered RenamePlaylist but I got this error below.

I thought when it imported them from foo_plorg it would create its own db.

My profile\playlist_manager folder is empty, and only zip files reside in the backup folder. Should the profile\playlist_manager folder not contain something. I tried to move the contents of the zip folder in there but I can't unlock them even though I set the playlist folder to yours after copying the files into that folder.

SetPlaylistLockedActions failed:
This lock is owned by a different component

File: playlist_manager_menu.js
Line: 881, Column: 50
Stack trace:
  func/<@playlist_manager_menu.js:881:50
  func@playlist_manager_menu.js:874:17
  _menu/this.btn_up/<@menu_xxx.js:408:15
  _menu/this.btn_up@menu_xxx.js:398:24
  _list/this.playlistMenu@playlist_manager_list.js:1831:37
  _list/this.executeAction@playlist_manager_list.js:1943:94
  _list/this.rbtn_up@playlist_manager_list.js:1273:11
  @main.js:546:23
  fireEvents/</<@callbacks_xxx.js:149:37
  fireEvents/<@callbacks_xxx.js:145:30

'''

Left click activate / Right click menu on selected

Can this be possible to allow a left click to load the playlist?

Currently, the double left click is buggy and doesn't load the playlist most of the time. As far as I can see the RMB does nothing so can it be mapped to show the menu? Pretty sure this is better UIX.

[BUG] Playlist generation failed, playlist file disappeared

Describe the bug
I've been getting this error when adding or removing tracks from a playlist:

Playlist generation failed while writing file 'Z:\home\lutra.foobar2000\profile\playlist_manager[Q] Queue.m3u8'.

When I check the playlist folder, the file is inexplicably gone. This has happened multiple times with two different playlists. Both playlists have the [ ] characters in the name, so maybe that's a cause, but maybe it's just coincidence cos those are the only playlists I edit a lot.

When I select "update playlist file" it unsurprisingly tells me

Playlist file does not exist: [Q] Queue
Path: Z:\home\lutra.foobar2000\profile\playlist_manager[Q] Queue.m3u8

"Clone as..." and "Copy playlist file to..." options do nothing, so they can't be used to restore the file.

When I restart Foobar, the playlist is gone from the UI as well.

To Reproduce
Steps to reproduce the behavior:

  1. Add or remove tracks from a playlist with [ ] in the name.
  2. Wait for auto-saving or select "Update playlist file"

Expected behavior
Playlist file is updated according to the UI playlist.

Desktop (please complete the following information):

  • Operating System: EndeavourOS & Wine 8.7-1
  • Kernel Version: 6.1.30-1-lts (64-bit)
  • Browser: IE8 Wine
  • Version: git clone about 8 hrs ago

Missing font: wingdings 2

Hi, this repeat several times in console log. I think, playlist manager is the url.
I resettet my font-cache, restarded and reinstalled wingdings 2 from resource-directory, but it still persits.

Console.log

[FEATURE] Manual sorting

Is your feature request related to a problem? Please describe.
Current sorting options are fully automatized and don't allow user customization.

Describe the solution you'd like
Manual sorting of playlist files with drag n drop support. New playlists should be added to the bottom.

Describe alternatives you've considered
Playlist pinning.

Additional context
manual

[BUG] Folder names with regex characters like `[` cause issues

Describe the bug
Folder names aren't escaped before using them in a regular expression in getRelPath() in helpers_xxx_playlists_files.js, leading to obvious issues when folders contain special regex-like characters such as [.

The resulting behavior differs depending on how the folder is parsed in the reg exp. For me, the file paths in the produced playlist M3U files were broken.

Suggested fix
Just a quick fix for this:

function getRelPath(itemPath, relPathSplit) {
	let cache = '';
	relPathSplit.forEach((folder) => {
		const folderEscaped = escapeRegExp(folder);
		const level = new RegExp(folderEscaped + '\\\\', 'i');
		cache = itemPath.replace(level, '');
		if (itemPath === cache) {itemPath = '..\\' + cache;}
		else {itemPath = cache;}
	});
	if (!itemPath.startsWith('..\\')) {itemPath = '.\\' + itemPath;}
	return itemPath;
}

function escapeRegExp(string) {
    return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}

YouTube Support

Describe the feature
Implement YouTube links for tracks not found on library for the different playlists retrieved from ListenBrainz user playlists.

Additional context
Finally managed to scrape youtube without API, so it should be pretty easy. Optional setting.

DrawRoundRect failed:

Completely fresh install of this. Followed the install instructions and get this error.

Is that Spider Monkey Panel v1.6.1-mod that was in SMP the cause of this?

Error: Spider Monkey Panel v1.6.1-mod ({20859B0C-D746-41AB-8B6C-65E679637FBE}: Playlist Manager v0.5.0-beta21 by XXX)
DrawRoundRect failed:
Arc argument has invalid value

File: buttons_panel_xxx.js
Line: 183, Column: 10
Stack trace:
  themedButton/this.draw@buttons_panel_xxx.js:183:10
  drawAllButtons/<@buttons_panel_xxx.js:292:30
  drawAllButtons@buttons_panel_xxx.js:290:7
  on_paint_buttn@buttons_panel_xxx.js:328:2
  @main.js:1049:3
  fireEvents/</<@callbacks_xxx.js:149:37
  fireEvents/<@callbacks_xxx.js:145:30

Nope, reverted back to the original and get this message now.

Error: Spider Monkey Panel v1.6.1 ({20859B0C-D746-41AB-8B6C-65E679637FBE}: Playlist Manager v0.5.0-beta21 by XXX)
DrawRoundRect failed:
Arc argument has invalid value

File: buttons_panel_xxx.js
Line: 183, Column: 10
Stack trace:
  themedButton/this.draw@buttons_panel_xxx.js:183:10
  drawAllButtons/<@buttons_panel_xxx.js:292:30
  drawAllButtons@buttons_panel_xxx.js:290:7
  on_paint_buttn@buttons_panel_xxx.js:328:2
  @main.js:1049:3
  fireEvents/</<@callbacks_xxx.js:149:37
  fireEvents/<@callbacks_xxx.js:145:30

[FEATURE] New playlist from selection

Is your feature request related to a problem? Please describe.
I honestly thought this feature was previously present, but maybe my memory is playing tricks on me. Anyway, I frequently create new playlists from selected tracks. In the default playlist manager, this can easily be done by dragging the tracks into the playlist manager. A new playlist will be created according to a default title formatting scheme that can be customized in the settings. PM-SMP doesn't have this.

Describe the solution you'd like
I don't necessarily need the drag-drop functionality. But it would be very useful to have an option in the list menu that acts like this. Just add the selected tracks to a new playlist and automatically generate the title (personally I'd be happy with "%album-artist% - %album%", but customization would ofc be great).

Describe alternatives you've considered
"Create new playlist file from active playlist..." takes the whole playlist and just copies its title. A "Move selection to playlist" shortcut requires that a named playlist already exists.

[BUG] Unable to create new playlists, fails with error

Describe the bug
Earlier today I didn't have this issue, but after syncing with Github, attempting to create new playlists (whether by drag & drop or by "New playlist file" option), I always get this error on my existing PM-SMPanel:

Playlist generation failed while writing file:
Z:\home\lutra\.foobar2000\profile\playlist_manager\ddd.m3u8

Trace:
add(bEmpty: true, name: Selection from Facet sele…, bShowPopups: true, bInputName: true)

savePlaylist(playlistIndex: -1, playlistPath: Z:\home\lutra\.foobar2000\profile\playlist_manager\ddd.m3u8, ext: .m3u8, playlistName: ddd, useUUID: null, category: Current, tags: , relPath: , bBom: false)

When I try to reproduce this on a fresh SMPanel, it actually crashes the whole panel with this error:

Error: Spider Monkey Panel v1.6.1 ({CEA9F5C1-831A-4B90-9C21-26F9C1892D53}: Playlist Manager v0.5.0-beta21 by XXX)
entry[1] is undefined

File: helpers_xxx_prototypes.js
Line: 111, Column: 1
Stack trace:
  toStr/<@helpers_xxx_prototypes.js:111:1
  toStr@helpers_xxx_prototypes.js:103:55
  _list/this.init/this.add@playlist_manager_list.js:3634:330
  func@playlist_manager_menu.js:905:71
  _menu/this.btn_up/<@menu_xxx.js:399:15
  _menu/this.btn_up@menu_xxx.js:389:24
  func@playlist_manager_list.js:4524:122
  _list/this.lbtn_up@playlist_manager_list.js:1179:14
  @playlist_manager.js:443:9
  fireEvents/</<@callbacks_xxx.js:149:37
  fireEvents/<@callbacks_xxx.js:145:30

Other playlist operations are working normally. Permissions on the playlist folder are unchanged.

To Reproduce
Steps to reproduce the behavior:

  1. Click the "+" button and select "New playlist file...".
  2. Enter any name for the playlist into the popup & click OK.
  3. Observe error and absence of new playlist.

Expected behavior
A new playlist with the selected tracks is created.

Desktop (please complete the following information):

  • OS: EndeavourOS & Wine 8.9-1
  • Browser: Wine browser
  • Version: Latest Github clone

Additional context
Console log:

[4:33:48 PM] savePlaylist(): invalid sources (-1, false)
[4:33:48 PM] Playlist generation failed while writing file:
[4:33:48 PM] Z:\home\lutra\.foobar2000\profile\playlist_manager\www.m3u8
[4:33:48 PM] Trace:
[4:33:48 PM] add(bEmpty: true, name: , bShowPopups: true, bInputName: true)
[4:33:48 PM] savePlaylist(playlistIndex: -1, playlistPath: Z:\home\lutra\.foobar2000\profile\playlist_manager\www.m3u8, ext: .m3u8, playlistName: www, useUUID: null, category: Current, tags: , relPath: , bBom: false)
[4:34:29 PM] savePlaylist(): invalid sources (-1, false)
[4:34:29 PM] Playlist generation failed while writing file:
[4:34:29 PM] Z:\home\lutra\.foobar2000\profile\playlist_manager\25g.m3u8
[4:34:29 PM] Trace:
[4:34:29 PM] add(bEmpty: true, name: , bShowPopups: true, bInputName: true)
[4:34:29 PM] savePlaylist(playlistIndex: -1, playlistPath: Z:\home\lutra\.foobar2000\profile\playlist_manager\25g.m3u8, ext: .m3u8, playlistName: 25g, useUUID: null, category: Current, tags: , relPath: , bBom: false)
[4:36:15 PM] savePlaylist(): invalid sources (-1, false)
[4:36:15 PM] Playlist generation failed while writing file:
[4:36:15 PM] Z:\home\lutra\.foobar2000\profile\playlist_manager\ttt.m3u8
[4:36:15 PM] Trace:
[4:36:15 PM] add(bEmpty: true, name: Selection from GZA, Genius, bShowPopups: true, bInputName: true)
[4:36:15 PM] savePlaylist(playlistIndex: -1, playlistPath: Z:\home\lutra\.foobar2000\profile\playlist_manager\ttt.m3u8, ext: .m3u8, playlistName: ttt, useUUID: null, category: Current, tags: , relPath: , bBom: false)

And for the new panel:

[4:52:16 PM] Playlist manager: reading files from "Z:\home\lutra\.foobar2000\profile\playlist_manager\"
[4:52:16 PM] Spider Monkey Panel v1.6.1: profiler ({CEA9F5C1-831A-4B90-9C21-26F9C1892D53}: loadPlaylistsFromFolder): 250ms
[4:52:16 PM] precacheLibraryPaths: using paths from another instance. {CEA9F5C1-831A-4B90-9C21-26F9C1892D53}
[4:52:38 PM] savePlaylist(): invalid sources (-1, false)
[4:52:38 PM] Playlist generation failed while writing file:
[4:52:38 PM] Z:\home\lutra\.foobar2000\profile\playlist_manager\req.m3u8
[4:52:38 PM] Trace:
[4:52:38 PM] add(bEmpty: true, name: , bShowPopups: true, bInputName: true)
[4:52:38 PM] savePlaylist(playlistIndex: -1, playlistPath: Z:\home\lutra\.foobar2000\profile\playlist_manager\req.m3u8, ext: .m3u8, playlistName: req, useUUID: null, category: Current, tags: , relPath: , bBom: false)

Drag n drop: tracks

Add selected tracks to selected playlist file using drag n drop (instead of keyboard modifiers).

Requires new SMP version.

[BUG] Shortcuts don't seem to work in Wine

Describe the bug
Perhaps I do not understand how shortcuts are supposed to work, but none of the shortcuts seem to do anything. In particular I am trying to assign cycling through categories to shift+left click on header. But if I shift-click on the header buttons, they just behave as if I had clicked normally.

To Reproduce
Steps to reproduce the behavior:

  1. Have at least 2 categories assigned to different playlists.
  2. Go to UI -> Shortcuts -> Left click (header) -> Shift
  3. Click on "Cycle categories"
  4. Shift+left click on any part of the header.
  5. The result is the same as without shift.

Expected behavior
The playlist manager cycles through the categories.

Desktop (please complete the following information):

  • OS: EndeavourOS
  • Browser: IE8 (in Wine)
  • Version: v0.5.0-beta.20

Additional context
EndeavourOS is Arch-Linux-based. I am using Foobar2000 v2.0 installed from AUR with Wine 8.7-1 and SMP v1.6.1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.