Skip to content

Commit

Permalink
- Playlist locks: workaround for [SMP bug](TheQwertiest/foo_spider_mo…
Browse files Browse the repository at this point in the history
…nkey_panel#198) related to playback on locked playlists. It should now work fine, but the 'default action' lock can not be switched anymore. Issue #82
  • Loading branch information
regorxxx committed Apr 15, 2024
1 parent cacffbc commit 73083d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
- UI: wrong offset for first child item within nested folders when the root folder was not shown on the list.
- Drag and drop: conflict drag n' dropping and pressing Ctrl over the "+" button, unintentionally triggering last edited playlist highlighting at the same time (feature introduced at [0.14.0](#0140---2024-03-15)).
- UI: drag and drop and other features requiring a playlist selection did not work properly with selections from other panels which were not using a playlist as source. Issue #81
- Playlist locks: workaround for [SMP bug](https://github.com/TheQwertiest/foo_spider_monkey_panel/issues/198) related to playback on locked playlists. It should now work fine, but the 'default action' lock can not be switched anymore.

## [0.15.0] - 2023-03-21
### Added
Expand Down
15 changes: 12 additions & 3 deletions main/playlist_manager/playlist_manager_menu.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
//12/04/24
//15/04/24

/* exported createMenuLeft, createMenuLeftMult, createMenuRightFilter, createMenuSearch, createMenuRightTop, createMenuRightSort */

Expand Down Expand Up @@ -714,8 +714,8 @@ function createMenuLeft(forcedIndex = -1) {
{ type: 'ReplaceItems', entryText: 'Replacing items' },
{ type: 'ReorderItems', entryText: 'Sorting items' },
{ type: 'RenamePlaylist', entryText: 'Renaming playlist' },
{ type: 'RemovePlaylist', entryText: 'Deleting playlist' },
{ type: 'ExecuteDefaultAction', entryText: 'Default action' }
{ type: 'RemovePlaylist', entryText: 'Deleting playlist' }
// { type: 'ExecuteDefaultAction', entryText: 'Default action' } // BUG: SMP
];
const index = plman.FindPlaylist(pls.nameId);
const currentLocks = new Set(plman.GetPlaylistLockedActions(index) || []);
Expand All @@ -733,6 +733,15 @@ function createMenuLeft(forcedIndex = -1) {
} else {
currentLocks.add(lock.type);
}
// BUG: SMP if any lock is applied, playback doesn't wor unless this is added
const locksNum = currentLocks.size;
if (locksNum) {
if (locksNum === 1 && currentLocks.has('ExecuteDefaultAction')) {
currentLocks.delete('ExecuteDefaultAction');
} else {
currentLocks.add('ExecuteDefaultAction');
}
}
plman.SetPlaylistLockedActions(index, [...currentLocks]);
}, flags
});
Expand Down

0 comments on commit 73083d4

Please sign in to comment.