Reset published date on publish
This commit is contained in:
parent
6454845e2f
commit
1b952dd426
|
@ -80,7 +80,7 @@ class WebtorrentInfoButton extends Button {
|
||||||
const totalUploaded = bytes(data.uploaded)
|
const totalUploaded = bytes(data.uploaded)
|
||||||
const numPeers = data.numPeers
|
const numPeers = data.numPeers
|
||||||
|
|
||||||
subDivWebtorrent.title = this.player_.localize('Total Downloaded: ') + totalDownloaded.join(' ') + '\n' +
|
subDivWebtorrent.title = this.player_.localize('Total downloaded: ') + totalDownloaded.join(' ') + '\n' +
|
||||||
this.player_.localize('Total uploaded: ' + totalUploaded.join(' '))
|
this.player_.localize('Total uploaded: ' + totalUploaded.join(' '))
|
||||||
|
|
||||||
downloadSpeedNumber.textContent = downloadSpeed[ 0 ]
|
downloadSpeedNumber.textContent = downloadSpeed[ 0 ]
|
||||||
|
|
|
@ -71,13 +71,18 @@ async function onVideoFileTranscoderOrImportSuccess (video: VideoModel) {
|
||||||
// Video does not exist anymore
|
// Video does not exist anymore
|
||||||
if (!videoDatabase) return undefined
|
if (!videoDatabase) return undefined
|
||||||
|
|
||||||
|
let isNewVideo = false
|
||||||
|
|
||||||
// We transcoded the video file in another format, now we can publish it
|
// We transcoded the video file in another format, now we can publish it
|
||||||
const oldState = videoDatabase.state
|
if (videoDatabase.state !== VideoState.PUBLISHED) {
|
||||||
videoDatabase.state = VideoState.PUBLISHED
|
isNewVideo = true
|
||||||
videoDatabase = await videoDatabase.save({ transaction: t })
|
|
||||||
|
videoDatabase.state = VideoState.PUBLISHED
|
||||||
|
videoDatabase.publishedAt = new Date()
|
||||||
|
videoDatabase = await videoDatabase.save({ transaction: t })
|
||||||
|
}
|
||||||
|
|
||||||
// If the video was not published, we consider it is a new one for other instances
|
// If the video was not published, we consider it is a new one for other instances
|
||||||
const isNewVideo = oldState !== VideoState.PUBLISHED
|
|
||||||
await federateVideoIfNeeded(videoDatabase, isNewVideo, t)
|
await federateVideoIfNeeded(videoDatabase, isNewVideo, t)
|
||||||
|
|
||||||
return undefined
|
return undefined
|
||||||
|
|
Loading…
Reference in New Issue