Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phlix-plugin-trakt

tests

Trakt scrobbler plugin for Phlix — scrobbles playback to Trakt.tv and syncs your watch history over the Trakt OAuth API.

Overview

Connects a Phlix server to your Trakt.tv account:

  • Scrobbles playback (start / pause / stop) so Trakt shows what you're watching in real time and marks items watched at the end.
  • Two-way history sync — pulls your Trakt watch history into Phlix and pushes Phlix completions back to Trakt on a configurable interval.
  • Authenticates via OAuth, refreshing tokens automatically.

It subscribes to phlix.playback.started, phlix.playback.paused, phlix.playback.resumed, and phlix.playback.stopped.

Install

From the Phlix admin Plugins section, paste this repo's URL:

https://github.com/detain/phlix-plugin-trakt

…or from the CLI:

php bin/phlix plugin:install https://github.com/detain/phlix-plugin-trakt

Settings

Setting Type Required Secret Tier Default Description
enabled boolean No No standard false Master on/off for Trakt scrobbling and sync. Optional; default off.
username string No No advanced "" Display-only: the Trakt account Phlix is linked to (set during authorization).
access_token string No Yes advanced null Obtained automatically when you authorize Phlix with Trakt — you do not enter this by hand. Create an API app only if you self-host credentials.
refresh_token string No Yes advanced null Set automatically during authorization; used to renew the access token. Not entered by hand.
expires_at integer No Yes advanced null Unix timestamp when the access token expires. Managed automatically.
sync_enabled boolean No No advanced true Sync watched state with Trakt. Optional; default on.
sync_interval_minutes integer No No advanced 30 How often to sync with Trakt. Optional; default 30.
scrobble_enabled boolean No No advanced true Report play/pause/stop to Trakt as you watch. Optional; default on.

access_token / refresh_token / expires_at are set automatically via the Trakt authorization (OAuth) flow — you never enter them by hand. Create an API application at https://app.trakt.tv/settings/apps/api/new only if you self-host your own Trakt credentials.

Development

composer install
vendor/bin/phpunit

The entry class is Phlix\Plugins\Scrobbler\Trakt\TraktPlugin (implements Phlix\Shared\Plugin\LifecycleInterface). It runs inside a Phlix server host, which provides the playback/library services at runtime. Host-supplied classes (Phlix\Auth\WatchHistory, Phlix\Common\Uuid, Workerman\MySQL\Connection) are stubbed from tests/bootstrap.php so the unit suite runs standalone.

License

MIT — see LICENSE.

About

Trakt scrobbler for Phlix — scrobbles playback to Trakt.tv and syncs watch history via OAuth.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages