Continued work on channel-wide playlists.

This commit is contained in:
rainbow napkin 2025-03-25 08:23:58 -04:00
parent 72a89ae5ff
commit 70a68d9336
7 changed files with 151 additions and 89 deletions

View file

@ -605,13 +605,16 @@ channelSchema.methods.addToPlaylist = async function(name, media){
//If the playlist name matches
if(playlist.name == name){
//Push the given media into the found playlist
//this.media.playlists[listIndex].push(media);
//Make note of the found index
foundIndex = listIndex
}
});
//Set media status schema discriminator
media.status = 'saved';
//Add the media to the playlist
this.media.playlists[foundIndex].media.push(media);
//Save the changes made to the chan doc