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:
odin
2026-08-17 15:42:17 +02:00
parent 3ccae54259
commit 1dfa2c0a04
30 changed files with 8119 additions and 233 deletions
+9
View File
@@ -38,8 +38,17 @@ export const plexAccounts = pgTable("plex_accounts", {
plexUuid: text("plex_uuid"),
plexUsername: text("plex_username").notNull(),
plexEmail: text("plex_email"),
// Does this account own the Plex server?
//
// The owner cannot be invited to their own libraries -- Plex refuses with
// "You cannot send an invitation to yourself." Without this column that
// refusal is indistinguishable from a share that genuinely failed, and the
// owner is told forever that their libraries did not share and to try again.
// They already have every library; there is nothing to grant.
isServerOwner: boolean("is_server_owner").notNull().default(false),
// When the libraries were shared, and which ones. Recorded so a failed or
// partial share is visible rather than being assumed to have worked.
// Both stay null for the owner, who was never invited to anything.
librariesSharedAt: timestamp("libraries_shared_at"),
sharedSectionIds: text("shared_section_ids").array(),
linkedAt: timestamp("linked_at").notNull().defaultNow(),