feat: remove publish to youtube
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Routes } from '../navigation/Routes'
|
||||
|
||||
export const CREATION_STAGE_KEYS = ['songwriter', 'beatmaker', 'director', 'publisher']
|
||||
export const CREATION_STAGE_KEYS = ['songwriter', 'beatmaker', 'director']
|
||||
|
||||
const getSectionLyrics = (section) => {
|
||||
if (typeof section === 'string') {
|
||||
@@ -36,13 +36,6 @@ const getStageMetadata = (project) => {
|
||||
const hasCoverUrl = !!project?.coverUrl
|
||||
const hasPlaybackAsset = !!project?.playbackUrl
|
||||
const hasPlayback = hasPlaybackAsset || hasSongUrl
|
||||
const youtubeUrl = project?.youtubeUrl ?? null
|
||||
const youtubeStatus = project?.youtubeStatus ?? null
|
||||
const youtubeError = project?.youtubeError ?? null
|
||||
const hasYoutubePublication = !!youtubeUrl
|
||||
const isYoutubePublishing = ['PUBLISHING', 'UPLOADING', 'PROCESSING', 'QUEUED'].includes(
|
||||
youtubeStatus
|
||||
)
|
||||
const musicUrls = Array.isArray(project?.musicUrls) ? project.musicUrls.filter(Boolean) : []
|
||||
const musicStatus = project?.musicStatus || null
|
||||
const coverStatus = project?.coverStatus || null
|
||||
@@ -65,13 +58,9 @@ const getStageMetadata = (project) => {
|
||||
coverStatus,
|
||||
playbackStatus,
|
||||
isPlaybackDraftReady,
|
||||
youtubeStatus,
|
||||
youtubeError,
|
||||
isMusicGenerating: musicStatus === 'GENERATING',
|
||||
isCoverGenerating: coverStatus === 'GENERATING',
|
||||
isPlaybackGenerating,
|
||||
hasYoutubePublication,
|
||||
isYoutubePublishing,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,8 +78,6 @@ const getStageLockState = (key, metadata) => {
|
||||
return true
|
||||
}
|
||||
return !metadata.hasCover
|
||||
case 'publisher':
|
||||
return !metadata.hasPlaybackAsset
|
||||
default:
|
||||
return true
|
||||
}
|
||||
@@ -151,20 +138,6 @@ const getStageDescription = (key, metadata) => {
|
||||
return 'Modifier le playback généré'
|
||||
}
|
||||
return 'Commencer la création de votre playback'
|
||||
case 'publisher':
|
||||
if (!hasPlaybackAsset) {
|
||||
return 'Créez un playback pour débloquer la publication'
|
||||
}
|
||||
if (metadata.isYoutubePublishing) {
|
||||
return 'Publication de votre vidéo en cours'
|
||||
}
|
||||
if (metadata.youtubeError) {
|
||||
return 'La publication a échoué, réessayez.'
|
||||
}
|
||||
if (metadata.hasYoutubePublication) {
|
||||
return 'Votre vidéo est en ligne et prête à être partagée'
|
||||
}
|
||||
return 'Publier votre vidéo sur la chaîne YouTube MusicLand'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
@@ -181,11 +154,6 @@ const getStageLockedDescription = (key, metadata) => {
|
||||
return metadata.lyricsCount > 0 ? undefined : 'Créez vos paroles pour débloquer le studio'
|
||||
case 'director':
|
||||
return metadata.hasPlaybackAsset ? 'Impossible de modifier le playback' : undefined
|
||||
case 'publisher':
|
||||
if (!metadata.hasPlaybackAsset) {
|
||||
return 'Générez un playback pour débloquer la publication'
|
||||
}
|
||||
return metadata.hasYoutubePublication ? 'La vidéo est déjà publiée' : undefined
|
||||
default:
|
||||
return undefined
|
||||
}
|
||||
@@ -199,8 +167,6 @@ const getStageCompletionState = (key, metadata) => {
|
||||
return metadata.hasSongUrl || metadata.musicStatus === 'GENERATED'
|
||||
case 'director':
|
||||
return metadata.hasPlaybackAsset
|
||||
case 'publisher':
|
||||
return metadata.hasYoutubePublication
|
||||
default:
|
||||
return false
|
||||
}
|
||||
@@ -268,15 +234,6 @@ export const getStageAction = (key, project) => {
|
||||
route: Routes.Playback,
|
||||
params: project ? { project } : undefined,
|
||||
}
|
||||
case 'publisher': {
|
||||
if (!project?.id) {
|
||||
return { route: Routes.PublishYoutube }
|
||||
}
|
||||
return {
|
||||
route: Routes.PublishYoutube,
|
||||
params: { projectId: project.id },
|
||||
}
|
||||
}
|
||||
default:
|
||||
return {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user