Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

DistroKid publish: name a missing song in publishing terms; artist name without @

Claude141bbaaf5120
diff --git a/client/src/components/musicVideo/PublishPostingPanel.jsx b/client/src/components/musicVideo/PublishPostingPanel.jsx
index 4be5328b5d..71facc3a56 100644
--- a/client/src/components/musicVideo/PublishPostingPanel.jsx
+++ b/client/src/components/musicVideo/PublishPostingPanel.jsx
@@ -15,6 +15,7 @@ export const PUBLISH_TARGETS = [
{ target: 'reddit', label: 'Reddit', note: 'A native video post to r/aivideo (title and flair, no body)' },
{ target: 'stackerNews', label: 'Stacker News', note: 'A link post to the full video' },
{
+ // `accountPlaceholder` marks an account that is a name, not an @handle.
target: 'distrokid', label: 'Spotify (via DistroKid)', accountPlaceholder: 'Artist name',
note: 'The song as a single for Spotify and other stores, with a square cover and the AI disclosure. You tick the agreements and press Upload',
linkPlaceholder: 'Live on Spotify? Paste the Spotify link',
@@ -217,7 +218,7 @@ function TargetRow({ project, kit, entry, publishing }) {
<li className="rounded border border-port-border p-2 space-y-2">
<div className="flex flex-wrap items-start justify-between gap-2">
<div className="min-w-0">
- <div className="text-xs font-medium">{label}{account && <span className="font-normal text-port-text-muted"> as @{account}</span>}</div>
+ <div className="text-xs font-medium">{label}{account && <span className="font-normal text-port-text-muted"> as {entry.accountPlaceholder ? '' : '@'}{account}</span>}</div>
<div className="text-[11px] text-port-text-muted">{note}</div>
{posted?.url && (
<a href={posted.url} target="_blank" rel="noreferrer" className="text-[11px] text-port-accent flex items-center gap-1 break-all">
diff --git a/client/src/components/musicVideo/PublishPostingPanel.test.jsx b/client/src/components/musicVideo/PublishPostingPanel.test.jsx
index 2573de045a..e09411bdb4 100644
--- a/client/src/components/musicVideo/PublishPostingPanel.test.jsx
+++ b/client/src/components/musicVideo/PublishPostingPanel.test.jsx
@@ -54,6 +54,8 @@ describe('PublishPostingPanel (#9282)', () => {
const { unmount } = render(<PublishPostingPanel project={p} publishing={publishing} />);
const dk = row('Spotify (via DistroKid)');
expect(within(dk).getByLabelText('Artist name')).toHaveAttribute('placeholder', 'Example Artist');
+ expect(dk).toHaveTextContent('as Example Artist');
+ expect(dk).not.toHaveTextContent('@Example Artist');
expect(within(dk).getByLabelText('Instrumental')).toBeChecked(); // no lyric cues
fireEvent.change(within(dk).getByLabelText('Songwriter legal first name'), { target: { value: 'Alice' } });
fireEvent.change(within(dk).getByLabelText('Songwriter legal last name'), { target: { value: 'Example' } });
diff --git a/server/services/musicVideo/publish/index.js b/server/services/musicVideo/publish/index.js
index a1c6959e9c..d2ec000ffe 100644
--- a/server/services/musicVideo/publish/index.js
+++ b/server/services/musicVideo/publish/index.js
@@ -132,8 +132,13 @@ function withPlatformDefaults(target, options, platforms) {
async function withAudio(target, payload, project, deps) {
if (target !== 'distrokid') return payload;
const resolveAudio = deps.resolveAudio || (await import('../projectAudio.js')).resolveProjectAudioPath;
- const path = await resolveAudio(project);
- if (!existsSync(path)) throw new ServerError('The song file is missing on disk: set the project audio again', { status: 422, code: 'PUBLISH_ASSET_MISSING' });
+ const noSong = (message) => new ServerError(message, { status: 422, code: 'PUBLISH_ASSET_MISSING' });
+ // The resolver speaks in analysis terms (NO_AUDIO, a stale track link); say what publishing needs instead.
+ const path = await resolveAudio(project).catch((err) => {
+ throw err?.code === 'NO_AUDIO' ? noSong('Set the project\'s song (a track or an uploaded file) before sending it to DistroKid')
+ : noSong(`The project's song can't be found (${err?.message || 'unknown error'}): set the project audio again`);
+ });
+ if (!path || !existsSync(path)) throw noSong('The song file is missing on disk: set the project audio again');
return { ...payload, audio: { path } };
}
diff --git a/server/services/musicVideo/publish/index.test.js b/server/services/musicVideo/publish/index.test.js
index c5d5406928..9db1fee83e 100644
--- a/server/services/musicVideo/publish/index.test.js
+++ b/server/services/musicVideo/publish/index.test.js
@@ -211,4 +211,18 @@ describe('publish drafts (#9282)', () => {
expect(runFfmpegProcess.mock.calls[0][0].args.join(' ')).toContain('scale=3000:3000');
expect(resolveAudio.mock.calls[0][0]).toMatchObject({ id, uploadedAudioFilename: 'song.wav' });
});
+
+ it('refuses a DistroKid draft whose song is unset or gone, in publishing terms, before opening a tab', async () => {
+ const id = await readyProject();
+ await projects.mutateProjectRecord(id, (current) => ({ project: { ...current, publishKit: { ...current.publishKit, thumbnail: 'thumb.jpg' } } }));
+ await mkdir(PATHS.videoThumbnails, { recursive: true });
+ await writeFile(join(PATHS.videoThumbnails, 'thumb.jpg'), 'x');
+ const { connect } = fakeBrowser();
+ const deps = { connect, adapters: { distrokid: adapter({ label: 'DistroKid' }) }, platforms: { distrokid: { enabled: true, account: 'Example Artist' } } };
+ const options = { songwriterFirst: 'Alice', songwriterLast: 'Example' };
+ await expect(preparePublishDraft(id, 'distrokid', options, deps)).rejects.toMatchObject({ status: 422, code: 'PUBLISH_ASSET_MISSING', message: expect.stringMatching(/Set the project's song/) });
+ await projects.mutateProjectRecord(id, (current) => ({ project: { ...current, uploadedAudioFilename: 'gone.wav' } }));
+ await expect(preparePublishDraft(id, 'distrokid', options, deps)).rejects.toMatchObject({ status: 422, code: 'PUBLISH_ASSET_MISSING', message: expect.stringMatching(/missing on disk/) });
+ expect(connect).not.toHaveBeenCalled();
+ });
});