Skip to content

fix: resolve issues #20, #21, #22, #23, #24 - #25

Merged
calmcacil merged 1 commit into
mainfrom
fix/issues-20-21-22-23-24
May 27, 2026
Merged

fix: resolve issues #20, #21, #22, #23, #24#25
calmcacil merged 1 commit into
mainfrom
fix/issues-20-21-22-23-24

Conversation

@calmcacil

Copy link
Copy Markdown
Owner

Summary

Batch fix for 5 open issues and one follow-up (issue #8 closed as superseded).

Changes

Issue #20 — API tokens in query strings

  • Jellyfin: moved api_key from URL query param to X-API-Key header
  • Plex: documented as known API limitation (requires token in query string)

Issue #21 — Error messages to stdout

  • Replaced all fmt.Printf error/diagnostic calls in internal/requests/requests.go with fmt.Fprintf(os.Stderr, ...)

Issue #22 — HTTP response handling boilerplate

  • Added DoRequest, DoJSON, DoXML methods to internal/http/client.go
  • Refactored fetchers in internal/streams/, internal/calendar/, internal/feed/ to use shared helpers
  • Each fetcher went from ~15 lines of boilerplate to ~3

Issue #23 — Inconsistent CLI validation

  • Added -server enum validation to media-streams
  • Added -days/-days-past/-filter validation to media-calendar
  • Added -url non-empty check to media-requests
  • Added -events/ -poll validation to arr-feed
  • All tools now call config.Validate() at startup
  • Fixed arr-feed using println instead of stderr

Issue #24 — Missing godoc comments

  • Added doc comments to all exported types, constants, and functions across internal/http, internal/config, internal/streams, internal/calendar, internal/requests, internal/feed

Issue #8 — Closed as superseded by config overhaul (PRs #18, #19)

Files changed: 13

Verification

  • go build ./... — passes
  • go test ./... — all tests pass
  • go vet ./... — passes

Closes #20, #21, #22, #23, #24

- #20: Move Jellyfin API token from query string to X-API-Key header;
  document Plex token-in-URL as known limitation
- #21: Redirect error/diagnostic fmt.Printf calls to stderr in
  internal/requests/requests.go
- #22: Add shared DoRequest/DoJSON/DoXML helpers to internal/http/client.go;
  refactor all fetchers in streams, calendar, and feed packages to use them
- #23: Add consistent CLI flag validation across all 4 tools; call
  config.Validate() at startup; fix arr-feed println to stderr
- #24: Add godoc comments to all exported types, constants, and functions
  across all internal packages (http, config, streams, calendar, requests, feed)

Closes #20, #21, #22, #23, #24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API tokens passed in query strings (security concern)

1 participant