Download the PHP package detain/phlix-plugin-lastfm without Composer
On this page you can find all versions of the php package detain/phlix-plugin-lastfm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download detain/phlix-plugin-lastfm
More information about detain/phlix-plugin-lastfm
Files in detain/phlix-plugin-lastfm
Package phlix-plugin-lastfm
Short Description Last.fm scrobbler plugin for Phlix — scrobbles music playback to Last.fm.
License MIT
Homepage https://github.com/detain/phlix-plugin-lastfm
Informations about the package phlix-plugin-lastfm
phlix-plugin-lastfm
Last.fm scrobbler plugin for Phlix — scrobbles your music playback to Last.fm.
Overview
Connects a Phlix server to your Last.fm account:
- Now Playing — on playback start the plugin calls Last.fm
track.updateNowPlayingso your profile shows what you're listening to in real time. - Scrobbling — on playback stop the plugin submits a
track.scrobble, enforcing Last.fm's official rule (track longer than 30 seconds and more than 50% watched) measured from where playback started on this server, so resuming a half-finished track cannot credit its unwatched beginning. - Connects each Phlix user to Last.fm through the web auth flow served by
the host: the host performs the authorize + callback handshake and persists
one session key per user into
lastfm_sessions; the plugin signs authenticated calls with your shared secret and consumes those stored session keys when scrobbling.
It subscribes to phlix.playback.started and phlix.playback.stopped.
Install
From the Phlix admin Plugins section, paste this repo's URL:
…or from the CLI:
Settings
Configure these in the Phlix admin Plugins → Configure dialog.
| Setting | Type | Required | Default | Description |
|---|---|---|---|---|
enabled |
bool | no | false |
Master on/off for Last.fm scrobbling. Parsed strictly: a real bool, or a canonical boolean string ('true', '1', 'on', 'yes' — case-insensitive) enables it; anything else, including junk strings like 'false' and non-scalars, stays disabled. |
api_key |
string | yes | — | Your Last.fm API key. Create a free API account at last.fm/api/account/create. |
shared_secret |
string (secret) | yes | — | The "Shared secret" shown next to your API key on your Last.fm API accounts page. Used to sign authenticated requests. |
The OAuth "Connect Last.fm" handshake (authorize + callback) is served by the host at
GET /api/v1/oauth/lastfmandGET /api/v1/oauth/lastfm/callback; the callback URL is derived from the request host, so nocallback_urlsetting is needed. Per-user session keys are stored inlastfm_sessionsand consumed by the scrobbler.
Where to get your credentials
- Sign in to Last.fm and open Create an API account.
- Fill in the application name/description. For the Callback URL, register
the exact path the host derives at auth time —
https://<your-phlix-host>/api/v1/oauth/lastfm/callback(the host sends that URL ascb=on every auth request, and Last.fm validates the request against this registered URL, so a different or query-strewn value fails the handshake). - Copy the API key into
api_keyand the Shared secret intoshared_secret. - Enable the plugin and toggle
enabledon.
api_key is deliberately not marked secret while shared_secret is:
a Last.fm API key is a public client identifier — the web-auth flow embeds it
in the browser-facing authorization URL by design — whereas the shared secret
is signing material that never leaves the server and is masked in the admin UI.
Development
Static analysis is configured in phpstan.neon (level 9 over src).
scripts/security-audit-check.php audits the whole of composer.lock — runtime
and require-dev dependencies — via composer audit --locked, and runs in CI
as the blocking composer-audit job in .github/workflows/test.yml.
The entry class is Phlix\Plugins\Scrobbler\Lastfm\LastfmPlugin (implements
Phlix\Shared\Plugin\LifecycleInterface and
Phlix\Shared\Plugin\ConfigurableInterface). It runs inside a Phlix server host,
which provides the playback/library services at runtime. onEnable() is
boot-safe — it only wires collaborators and subscribes events — so the
lastfm_sessions schema is ensured lazily on the first playback event, when
LastfmScrobbler invokes the deferred LastfmMigrationRunner closure.
License
MIT — see LICENSE.
All versions of phlix-plugin-lastfm with dependencies
detain/phlix-shared Version ^0.21.0
psr/container Version ^1.1 || ^2.0
psr/log Version ^1.0 || ^2.0 || ^3.0
workerman/mysql Version ^1.0