havenstd06/laravel-jellyfin

A Laravel package that allows access to the API of your Jellyfin server.

v0.1 2023-01-04 00:10 UTC

This package is not auto-updated.

Last update: 2024-04-25 05:19:21 UTC


README

A Laravel package that allows access to the API of your Jellyfin server.

210449526-9026f288-0b9e-436a-b315-10af018b73e0.png

Features

The only sections available at the moment are:

  • Library
  • System
  • User

Refer to Jellyfin API Doc

Installation

composer require havenstd06/laravel-jellyfin

Publish Assets

php artisan vendor:publish --provider="Havenstd06\LaravelJellyfin\Providers\JellyfinServiceProvider" 

Configuration

After publishing the assets, add the following to your .env files .

# Jellyfin API
JELLYFIN_SERVER_URL=
JELLYFIN_TOKEN=

JELLYFIN_APPLICATION=

JELLYFIN_VALIDATE_SSL=true

Configuration File

The configuration file jellyfin.php is located in the config folder. Following are its contents when published:

return [
    'server_url'        => env('JELLYFIN_SERVER_URL', ''), // Jellyfin Server URL (ex: https://[IP address]:8096 or https://domain.com)
    'token'             => env('JELLYFIN_TOKEN', ''),

    'application'       => env('JELLYFIN_APPLICATION', 'Laravel Jellyfin / v1.0'), // Jellyfin application name
    'version'           => env('JELLYFIN_VERSION', '10.8.8'), // (Jellyfin application version number)

    'validate_ssl'      => env('JELLYFIN_VALIDATE_SSL', true), // Validate SSL when creating api client.
];

Usage

Initialization

use Havenstd06\LaravelJellyfin\Services\Jellyfin as JellyfinClient;

$provider = new JellyfinClient;

Override Configuration

You can override Jellyfin API configuration by calling setApiCredentials method:

$config = [
    'server_url'        => 'https://example.com',
    'token'             => 'your-token',
    
    'application'       => 'your-client-application-name', // optional
    'version'           => 'your-version', // optional
    
    'validate_ssl'      => true,
];

$provider->setApiCredentials($config);

Acknowledgements

License

MIT

Contributing

Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.