- await move(source, destination)
- } catch (err) {
- logger.error('Cannot move HLS file %s to %s after privacy change', source, destination, { err })
- }
+ const source = join(directories.old, video.uuid)
+ const destination = join(directories.new, video.uuid)
+
+ try {
+ logger.info('Moving HLS files of %s after privacy change (%s -> %s).', video.uuid, source, destination)
+
+ await move(source, destination)
+ } catch (err) {
+ logger.error('Cannot move HLS file %s to %s after privacy change', source, destination, { err })
+ }
+}
+
+function getHLSDirectories (moveType: MoveType) {
+ if (moveType === 'private-to-public') {
+ return { old: DIRECTORIES.HLS_STREAMING_PLAYLIST.PRIVATE, new: DIRECTORIES.HLS_STREAMING_PLAYLIST.PUBLIC }