-
|
First let me say this is a great project and with the help of Google Translate I managed to port my complete SmarterPlaylist setup (16 scripts) to Goofy. The reason for switching was predominantly that the scheduling of tasks in SmarterPlaylists frequently got messed up during server outages. While porting the scripts the flexibility and lack of limitations in Goofy also made it possible to reduce the 16 scripts to only 9, with no loss of functionality and better dependency. My feature request would be a function to remove a number of tracks from a number of playlists. I have some tracks in several playlists and while listening and wanting to remove a track completely I often just save the track to a Playlist called "Remove TODO". Then when I have time I go through that playlist and remove the tracks from any of multiple playlists that could contain it. This is a tedious task that would be nice to replace with a scripted task that would look like this: let toRemoveTracks = Source.getPlaylistTracks("Remove TODO", "removetodoid");
let targetPlaylists = [
{ id: "searchplaylist1id", name: "Playlist 1" },
{ id: "searchplaylist2id", name: "Playlist 2" },
{ id: "searchplaylist3id", name: "Playlist 3" },
{ id: "removetodoid", name: "Remove TODO" },
];
// removes given array of tracks from given array of playlists
Source.removeTracks(toRemoveTracks, targetPlaylists);Please excuse if this feature has already been requested. It was not possible for me to search the previous discussion because of the language barrier. Thank you for this great project, have a nice day and stay safe and healthy! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
For many tasks don't need to add new features to the library. You can implement own function based on existing the library functions. Especially if you know programming (JavaScript). According request description, the next function can help. Just insert function removeBanTracks() {
let banTracks = Source.getPlaylistTracks('', 'id');
Playlist.getPlaylistArray().forEach(p => {
if (p.owner.id == User.getId()) {
let tracks = Source.getPlaylistTracks('', p.id);
Filter.removeTracks(tracks, banTracks);
if (p.tracks.total > tracks.length) {
Playlist.saveWithUpdate({ id: p.id, tracks: tracks, });
}
}
});
}The two of used functions haven't description into documentation:
If need to limit of playlists, use the next function. function removeBanTracks() {
let banTracks = Source.getPlaylistTracks('', 'id');
let playlists = [
{ id: '', name: '' },
{ id: '', name: '' },
];
playlists.forEach(p => {
let tracks = Source.getPlaylistTracks('', p.id);
Filter.removeTracks(tracks, banTracks);
Playlist.saveWithUpdate({ id: p.id, tracks: tracks, });
});
}By the way, try to run function by hand from manual. This no refer to the feature request, just an advise. |
Beta Was this translation helpful? Give feedback.
For many tasks don't need to add new features to the library. You can implement own function based on existing the library functions. Especially if you know programming (JavaScript).
According request description, the next function can help. Just insert
idin the first line and set trigger.The two …