Skip to content

fix: show mediaId instead of displayIconId in icon commands - #10

Open
nate-kelley-buster wants to merge 5 commits into
TheBestMoshe:mainfrom
nate-kelley-buster:fix/icon-commands-show-mediaid
Open

nate-kelley-buster wants to merge 5 commits into
TheBestMoshe:mainfrom
nate-kelley-buster:fix/icon-commands-show-mediaid

Conversation

@nate-kelley-buster

Copy link
Copy Markdown

Problem

yoto icon list, yoto icon list --mine, and yoto icon upload all print displayIconId in their "ID" column / success message. But entry|chapter|track update --icon (per its own --help: "file path, mediaId, or yoto:#mediaId") requires the mediaId — a different, longer (43-char) token, not the displayIconId.

Copying the ID these commands show you into --icon builds an invalid yoto:#{displayIconId} reference under the hood (see resolveIcon in src/commands/entry.ts), which the API rejects:

✗ body.content.chapters.0.display.icon16x16: icon16x16 must be in format "yoto:#{mediaId}" where mediaId is 43 characters

This is a real footgun — it's the natural, documented workflow (icon list → copy ID → entry update --icon <id>) and it silently fails.

Fix

Print mediaId instead of displayIconId everywhere an icon reference is surfaced to the user (column renamed "ID" → "Media ID" for clarity), since that's the value --icon actually consumes.

Verification

Reproduced end-to-end against the live API: copying a displayIconId from icon list into entry update --icon fails with the error above. After this fix, icon list / icon upload print the mediaId, and passing that value to entry update --icon succeeds — verified by setting icons on all 25 chapters of a real playlist and confirming via a direct API read that display.icon16x16 was set correctly on every chapter.

nate-kelley-buster and others added 5 commits September 14, 2026 18:13
Requesting "profile offline_access openid" during device-code login
causes Yoto's auth server to reject the authorization with
access_denied as soon as the user confirms the code (see TheBestMoshe#6).

The CLI only needs an access/refresh token to call the Yoto API, so
trim the request to the minimal "offline_access" scope. Verified
end-to-end: device flow now reaches the consent screen and completes
successfully.

Fixes TheBestMoshe#6

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182auKxRRCcLdZrBotvbJ6K
The Yoto API returns display.icon16x16 as null for chapters/tracks
that don't have a custom icon set, but DisplaySchema only allowed
string|undefined for that field. This made `playlist show` (and any
other command that parses card content) throw a Zod validation error
on any playlist with unset icons instead of rendering.

Verified against a real 25-chapter playlist that previously failed
to display.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182auKxRRCcLdZrBotvbJ6K
\`icon list\`, \`icon list --mine\`, and \`icon upload\` all displayed
\`displayIconId\` in their "ID" column / success message. But
\`entry|chapter|track --icon\` (per its own --help text: "file path,
mediaId, or yoto:#mediaId") requires the \`mediaId\`, a different,
longer token — not the displayIconId.

Copy-pasting the ID shown by these commands into --icon silently
builds an invalid \`yoto:#{displayIconId}\` reference, which the API
rejects with:

  icon16x16 must be in format "yoto:#{mediaId}" where mediaId is 43
  characters

Fix: print \`mediaId\` (renamed column to "Media ID") everywhere an
icon reference is surfaced to the user, since that's the value
--icon actually consumes.

## Verification

Reproduced end-to-end against the live API: copying a displayIconId
from \`icon list\` into \`entry update --icon\` failed with the error
above. After this fix, \`icon list\`/\`icon upload\` print the mediaId,
and passing that value to \`entry update --icon\` succeeds.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182auKxRRCcLdZrBotvbJ6K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant