Add the profile page, and publish it as an embeddable panel
Developed in a separate session; committed here alongside the calendar work
that shares this repository's migration journal.
A person can now see their own Plex link, their Watch Now slots and their watch
history at /profile. The same panel is published in two further forms so that
accounts.sticknife.com on charon can carry it as one section of a wider
sticknife profile, next to the other services' sections.
- watch_history (0024) records what has been played, keyed on the Plex
history id so a re-sync cannot duplicate a row. Partial unique index,
because that id is null for anything entered by hand.
- plex_accounts.is_server_owner (0025) marks the one account whose viewing
the server files under local account 1 rather than under its plex.tv id.
- The embed carries its own layout, origin allowlist and a frame-height
reporter, so the host page can size it without guessing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -153,6 +153,21 @@ function imageUrl(path?: string | null) {
|
||||
return path ? `${TMDB_IMAGE_BASE_URL}${path}` : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* A usable poster URL from whatever media_items.poster_path happens to hold.
|
||||
*
|
||||
* Two writers disagree about that column. The metadata refresh stores TMDB's
|
||||
* bare path (`/abc.jpg`, 2,802 rows) and the catalog board stores the absolute
|
||||
* URL it had already built (1 row). Both forms are in the table right now, so
|
||||
* anything rendering a stored poster has to cope with both -- and anything
|
||||
* handing one to ANOTHER SERVICE has to resolve it, because a bare TMDB path
|
||||
* means nothing on accounts.sticknife.com.
|
||||
*/
|
||||
export function posterUrlFromStored(path?: string | null) {
|
||||
if (!path) return null;
|
||||
return /^https?:\/\//.test(path) ? path : imageUrl(path);
|
||||
}
|
||||
|
||||
function backdropUrl(path?: string | null) {
|
||||
return path ? `${TMDB_BACKDROP_BASE_URL}${path}` : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user