Playlist shows the address of a website item instead of its name #320

Closed
opened 2026-11-18 09:17:44 +00:00 by vivy · 0 comments
Owner

Reported by the product owner on the live server (GRI-2051, 2026-11-18 09:16 UTC), with a screenshot: in Playlists → Am Playlist → Media, a website item shows its full address (https://snor.kobam.be/public/digitalsignage/index.php?hash=…) instead of the name it has in the media library.

Cause

  • A url playlist item is stored with url only. It has no media_id, so it has no link back to the library item it came from (since the #302 fix the panel also sends it that way).
  • itemFromWire in frontend-web/src/api/httpPlaylistsApi.ts resolves the name as library name by media_id || source_name || url. With no media_id and no source_name, the address is all that is left.

What is wanted

  1. The item shows the name of the website from the media library.
  2. The address in smaller text under the name.
  3. Optional: the name links to the item in the media library.

Proposed fix

  • Server: a url playlist item may keep the media_id of its library item. The server checks that the media item is kind = url and that the url matches it (or takes the url from it). Item without media_id stays valid for API clients.
  • Migration: fill media_id on existing url items where exactly one library url item has the same address. Leave the rest as they are.
  • Panel: send media_id for a url item added from the library; show name + small address line; name links to the library item. An item with no library link shows the address as now.
  • The name follows a rename in the library, because it is read from the library, not copied.
  • If the library item is deleted: decide whether the playlist item stays (shows the address) or goes. Proposal: it stays, media_id set to NULL (ON DELETE SET NULL).

Acceptance

  • Test: load a playlist with a url item added from the library → the row shows the library name and the address under it.
  • Test: rename the library item → the playlist shows the new name.
  • Test: reload, change, save twice (the #302 round trip) still works.
  • On the live server, "Am Playlist" shows the website's name after the upgrade.
Reported by the product owner on the live server (GRI-2051, 2026-11-18 09:16 UTC), with a screenshot: in **Playlists → Am Playlist → Media**, a website item shows its full address (`https://snor.kobam.be/public/digitalsignage/index.php?hash=…`) instead of the name it has in the media library. ## Cause - A `url` playlist item is stored with `url` only. It has no `media_id`, so it has no link back to the library item it came from (since the #302 fix the panel also sends it that way). - `itemFromWire` in `frontend-web/src/api/httpPlaylistsApi.ts` resolves the name as `library name by media_id || source_name || url`. With no `media_id` and no `source_name`, the address is all that is left. ## What is wanted 1. The item shows the **name** of the website from the media library. 2. The address in smaller text under the name. 3. Optional: the name links to the item in the media library. ## Proposed fix - **Server:** a `url` playlist item may keep the `media_id` of its library item. The server checks that the media item is `kind = url` and that the `url` matches it (or takes the `url` from it). Item without `media_id` stays valid for API clients. - **Migration:** fill `media_id` on existing `url` items where exactly one library url item has the same address. Leave the rest as they are. - **Panel:** send `media_id` for a url item added from the library; show name + small address line; name links to the library item. An item with no library link shows the address as now. - The name follows a rename in the library, because it is read from the library, not copied. - If the library item is deleted: decide whether the playlist item stays (shows the address) or goes. Proposal: it stays, `media_id` set to NULL (`ON DELETE SET NULL`). ## Acceptance - Test: load a playlist with a url item added from the library → the row shows the library name and the address under it. - Test: rename the library item → the playlist shows the new name. - Test: reload, change, save twice (the #302 round trip) still works. - On the live server, "Am Playlist" shows the website's name after the upgrade.
vivy closed this issue 2026-11-18 11:21:06 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage#320
No description provided.