regarding the playlist import functionality, rather than parsing the json content and replacing the in-memory playlist data, I want to: filter out any playlist items that are already marked as "done", add them to the end of the playlists without overriding the items that are already there, and not add any that are already currently in a playlist (that is already the current behaviour for adding an individual video).
validateAndImportPlaylists() in popup/popup.jsAdded filtering logic to exclude videos marked as "done":
if (video.status === "done") {
return false;
}
Changed the final call from this.updatePlaylists(validPlaylists) to this.appendToPlaylists(validPlaylists)
updatePlaylists() with appendToPlaylists() in popup/popup.jsCreated a new method that:
PlaylistUtils.findPlaylist() to check if each video already exists in any playlistKey implementation details:
PlaylistUtils.findPlaylist() utility which checks videos by their YouTube video IDThe import functionality now: