fix: replace fmt.Sprintf URL building with url.JoinPath, log home section failures#46
Conversation
|
Claude finished @koinsaari's task in 1m 30s —— View job Code Review: PR #46
No blocking issues. The PR correctly replaces all What's good:
🟡 Nit: |
3a3194e to
62efb1e
Compare
|
Claude finished @koinsaari's task in 1m 47s —— View job Code Review: PR #46
No blocking issues. The PR correctly replaces all What's good:
🟡 Nit: |
…e URLs at startup fmt.Sprintf and string concatenation for URL construction doesn't encode special characters in path segments. url.JoinPath handles this correctly and also tolerates trailing slashes on the base URL. - Replace fmt.Sprintf/concat with url.JoinPath in jellyfin client (GetItem, GetItems, AuthenticateByName, QuickConnectInitiate, QuickConnectAuthenticate) and media mapper (image URLs, stream URLs) - Validate JELLYFIN_URL and PROXY_BASE_URL as absolute URLs at startup so a misconfigured base URL fails fast rather than producing empty URL fields - Add logger to media.Service and log slog.Warn per failed home section instead of silently dropping it, so degraded home responses are observable Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
62efb1e to
83e37d8
Compare
|
Claude finished @koinsaari's task in 1m 50s —— View job Code Review: PR #46
No blocking issues. The PR correctly replaces all What's good:
🟡 Nit: |
URL construction in the Jellyfin client and media mapper used
fmt.Sprintfand string concatenation, which doesn't encode special characters in path segments and breaks if the base URL has a trailing slash. Home section failures were silently swallowed with no log signal. A misconfigured base URL would also produce emptyStreamURLfields with no indication of why.Summary
fmt.Sprintf/string concatenation withurl.JoinPathin all Jellyfin client methods (GetItem,GetItems,AuthenticateByName,QuickConnectInitiate,QuickConnectAuthenticate) and media mapper (image URLs, stream URLs)JELLYFIN_URLandPROXY_BASE_URLas absolute URLs at startup — misconfigured base URL now fails fast instead of producing empty URL fields silently*slog.Loggertomedia.Serviceand emitslog.Warnper failed home section instead of silently discarding errorsImplementation notes
QuickConnectAuthenticateappends a query param (secret), so it goes throughurl.JoinPath→url.Parse→q.Set→q.Encoderather than a bareurl.JoinPathcall.Mapper functions are pure (no error return), so URL joins use a local
joinURLhelper that returns""on error. Startup validation inconfig.gois the real guard — a bad base URL exits before the server starts.🤖 Generated with Claude Code