Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
|
Installation procedure and first application using this library.
This is a tutorial on how to use Jellyfin Qt library.
The library works as a QML plugin. Compile the library, install it in the QML plugin path and add a qmldir file like this:
You should then be able to import it in your QML files.
The first step for interacting with the library is setting up an Jellyfin::ApiClient. This object handles authentication.
Lets create an instance of ApiClient that is reachable from everywhere, by putting it in the ApplicationWindow:
If the user already has logged in and the credentials are stored, this is quite easy: the authenticated property will change to true and the corresponding signal will fire. You don't have to do anything else!
When the user never has logged in, the signal setupRequired() will be fired. When this happens, you should let the user enter a server URL and set it as the baseUrl property. You can get a list model of servers in the local network using the Jellyfin::ServerDiscoveryModel.
After the baseUrl property has been set, the slot authenticate should be called with an username and password. When authentication was successful, the property authenticated will be changed to true. Otherwise, the signal authenticationError will be fired.