From da3d3198c837c8ddb93f09cf008cbd4edeba88ff Mon Sep 17 00:00:00 2001 From: RXWatcher <14085001+RXWatcher@users.noreply.github.com> Date: Sun, 24 May 2026 13:26:38 +0200 Subject: [PATCH] feat(audiobooks): add Author and Narrator PersonKind constants Discovery audit confirmed item_people.kind is unconstrained smallint with values 1-6 in use. Reserve 7 = Author, 8 = Narrator for audiobook people-links written by the upcoming scanner branches. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/models/media.go | 6 ++++++ internal/models/media_test.go | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 internal/models/media_test.go diff --git a/internal/models/media.go b/internal/models/media.go index 54c64a82..15609df3 100644 --- a/internal/models/media.go +++ b/internal/models/media.go @@ -212,6 +212,8 @@ const ( PersonKindProducer PersonKind = 4 PersonKindGuestStar PersonKind = 5 PersonKindComposer PersonKind = 6 + PersonKindAuthor PersonKind = 7 + PersonKindNarrator PersonKind = 8 ) // String returns the Jellyfin-compatible type string for this PersonKind. @@ -229,6 +231,10 @@ func (k PersonKind) String() string { return "GuestStar" case PersonKindComposer: return "Composer" + case PersonKindAuthor: + return "Author" + case PersonKindNarrator: + return "Narrator" default: return "Unknown" } diff --git a/internal/models/media_test.go b/internal/models/media_test.go new file mode 100644 index 00000000..e74c529c --- /dev/null +++ b/internal/models/media_test.go @@ -0,0 +1,18 @@ +package models + +import "testing" + +func TestPersonKindAudiobookRoles(t *testing.T) { + cases := []struct { + kind PersonKind + want string + }{ + {PersonKindAuthor, "Author"}, + {PersonKindNarrator, "Narrator"}, + } + for _, tc := range cases { + if got := tc.kind.String(); got != tc.want { + t.Errorf("%d.String() = %q, want %q", tc.kind, got, tc.want) + } + } +}