Commit Graph

8 Commits

Author SHA1 Message Date
Bjarne Øverli 8dad762349 fix: support go install module path 2026-07-05 13:59:18 +02:00
Bjarne Øverli 5dbf703880 spotify: show OAuth URL in TUI during interactive sign-in
Release / build (amd64, darwin, macos-latest) (push) Has been cancelled
Release / build (amd64, linux, ubuntu-latest) (push) Has been cancelled
Release / build (amd64, windows, windows-latest) (push) Has been cancelled
Release / build (arm64, darwin, macos-latest) (push) Has been cancelled
Release / build (arm64, linux, ubuntu-latest) (push) Has been cancelled
Release / release (push) Has been cancelled
Release / update-homebrew (push) Has been cancelled
When the auto-launched browser doesn't reach the user (containers,
headless envs, missing xdg-open), the auth flow used to silently
hang for 5 minutes and then time out. Surface the OAuth URL in the
provider loading view so the user can paste it into a browser
manually. Also log the URL via applog.Info so it's preserved for
support reports.

Closes #220
2026-05-10 18:56:10 +02:00
Bjarne Øverli c430f581bf Simplify Spotify credentials helpers
Three small cleanups from review:

1. Move CredsPath / DeleteCreds into an untagged creds.go so the
   Windows stub no longer needs its own copy. Drops the credsPath
   wrapper and the duplicate path-build/remove logic.

2. Change DeleteCreds to (bool, error) so the reset subcommand can
   distinguish "removed" from "did not exist" without a separate
   os.Stat round-trip — deleteCreds already swallowed ErrNotExist,
   so the pre-check was redundant.

3. Trim two over-narration comments. The fallbackMaxAttempts intent
   is now a single inline note; the invalid_grant block comment is
   reduced to one line about why we delete on this signal.
2026-04-27 20:26:04 +02:00
Bjarne Øverli 28339851e0 Fix detect invalid_grant and clear stale Spotify credentials
When the OAuth2 refresh token returned by Spotify expires or is revoked,
silentTokenRefresh fails with an oauth2.RetrieveError carrying ErrorCode
"invalid_grant". Until now this only logged a warning and continued with
the spclient fallback token, so every future launch hit the same dead
state and produced misleading rate-limit warnings.

Classify the refresh error via isInvalidGrant, and on a true
invalid_grant delete spotify_credentials.json and surface ErrNeedsAuth.
The next provider open will prompt a fresh OAuth flow that recreates
the credentials file.

Also expose CredsPath / DeleteCreds from the package (with mirror stubs
in stub_windows.go) so a future CLI subcommand can offer the same
recovery without users needing to know the file path.
2026-04-27 20:15:10 +02:00
Gjermund Garaba 5f3586f062 feat(spotify): configurable bitrate (#177)
* feat(spotify): configurable bitrate

* coderabbit pr fixes

* coderabbit pr fixes
2026-04-13 18:00:45 +02:00
bjarneo d09af49c9f Decouple providers behind capability interfaces (#154)
Release / build (amd64, darwin, macos-latest) (push) Has been cancelled
Release / build (amd64, linux, ubuntu-latest) (push) Has been cancelled
Release / build (amd64, windows, windows-latest) (push) Has been cancelled
Release / build (arm64, darwin, macos-latest) (push) Has been cancelled
Release / build (arm64, linux, ubuntu-latest) (push) Has been cancelled
Release / release (push) Has been cancelled
Release / update-homebrew (push) Has been cancelled
* Decouple providers behind capability interfaces

* Add docs to provider vel

* Simplify, refactor and remove dead code

* Completely decouple from the ui

* Simplify

* Dead code cleanup
2026-03-30 16:08:16 +02:00
Bjarne Øverli 19633d6f96 Add spotify playlist and search 2026-03-29 18:42:09 +02:00
Artale 758557fa0d feat: add Windows build support (Spotify behind build tags) (#77)
Release / build (amd64, darwin, macos-latest) (push) Has been cancelled
Release / build (amd64, linux, ubuntu-latest) (push) Has been cancelled
Release / build (amd64, windows, windows-latest) (push) Has been cancelled
Release / build (arm64, darwin, macos-latest) (push) Has been cancelled
Release / build (arm64, linux, ubuntu-latest) (push) Has been cancelled
Release / release (push) Has been cancelled
Release / update-homebrew (push) Has been cancelled
* feat: add Windows build support (Spotify behind build tags)

- Add //go:build !windows to provider.go, session.go, streamer.go
- Add stub_windows.go with no-op Spotify implementation
- Add windows/amd64 to release CI matrix (CGO_ENABLED=0)

Tested: builds and runs on Windows 11 amd64 (cliamp test --version OK)
Linux/macOS CI unchanged (still CGO_ENABLED=1 with native libs)

* fix: address review feedback on Windows stub

- Move //go:build constraint before package doc comment (Go requirement)
- NewStreamer now returns errSpotifyUnavailable instead of nil, nil
  to prevent nil dereference in callers
- Update New() doc comment to accurately describe nil return behavior
2026-03-14 18:40:11 +01:00