-async function processDeleteAccount (accountToRemove: AccountModel) {
- logger.debug('Removing remote account "%s".', accountToRemove.Actor.uuid)
+async function processDeleteVideoPlaylist (actor: MActor, playlistToDelete: VideoPlaylistModel) {
+ logger.debug('Removing remote video playlist "%s".', playlistToDelete.uuid)
+
+ await sequelizeTypescript.transaction(async t => {
+ if (playlistToDelete.OwnerAccount.Actor.id !== actor.id) {
+ throw new Error('Account ' + actor.url + ' does not own video playlist ' + playlistToDelete.url)
+ }
+
+ await playlistToDelete.destroy({ transaction: t })
+ })
+
+ logger.info('Remote video playlist with uuid %s removed.', playlistToDelete.uuid)
+}
+
+async function processDeleteAccount (accountToRemove: MAccountActor) {
+ logger.debug('Removing remote account "%s".', accountToRemove.Actor.url)