Continued work on channel-wide playlists.
This commit is contained in:
parent
72a89ae5ff
commit
70a68d9336
7 changed files with 151 additions and 89 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue