Skip to content

philwc/subsonic-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

subsonic-api-client

PHP Client For Subsonic

Usage

Create a new configuration object:

// Assumes the config items are in the environment (via dotenv etc.)
$config = new \philwc\Configuration(getenv('SUBSONIC_URL'), getenv('SUBSONIC_USER'), getenv('SUBSONIC_PASSWORD'))

Either set the config into the ClientFactory:

\philwc\ClientFactory::setConfiguration($config);

Or pass into each ClientFactory::get() call:

$createPlaylist = \philwc\ClientFactory::get(\philwc\Call\Playlist\CreatePlaylist::class, $config);

To make the call, invoke the class:

$createPlaylist(['name' => 'Test Playlist', 'songId' => 1]);

Each call class can receive different parameters and will return a different result.

Use getAvailableFields(), getRequiredFields(), getResponseClass() as appropriate.

Currently, the following calls are implemented:

Playlist

  • CreatePlaylist
  • DeletePlaylist
  • GetPlaylist
  • GetPlaylists
  • UpdatePlaylist

Searching

  • Search2

System

  • GetLicense
  • Ping