philwc/subsonic-api-client

v0.0.4 2017-12-22 16:31 UTC

This package is not auto-updated.

Last update: 2024-09-19 05:08:26 UTC


README

Subsonic 的 PHP 客户端

用法

创建新的配置对象

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

将配置设置到 ClientFactory

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

或者在每个 ClientFactory::get() 调用时传入

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

进行调用,调用类

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

每个调用类可以接收不同的参数并返回不同的结果。

根据需要使用 getAvailableFields()getRequiredFields()getResponseClass()

目前,以下调用已实现

播放列表

  • 创建播放列表
  • 删除播放列表
  • 获取播放列表
  • 获取播放列表列表
  • 更新播放列表

搜索

  • 搜索2

系统

  • 获取许可证
  • ping