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) <noreply@anthropic.com>
This commit is contained in:
RXWatcher
2026-05-24 13:26:38 +02:00
co-authored by Claude Opus 4.7
parent 31704a2855
commit da3d3198c8
2 changed files with 24 additions and 0 deletions
+6
View File
@@ -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"
}
+18
View File
@@ -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)
}
}
}