Improve usage of Jellyfin class in Java code (#268)

This commit is contained in:
Niels van Velzen 2021-06-05 17:28:07 +02:00 committed by GitHub
parent feb99b98e3
commit a7c163496b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -1,7 +1,13 @@
public final class org/jellyfin/sdk/Jellyfin {
public static final field Companion Lorg/jellyfin/sdk/Jellyfin$Companion;
public fun <init> (Lkotlin/jvm/functions/Function1;)V
public fun <init> (Lorg/jellyfin/sdk/JellyfinOptions$Builder;)V
public fun <init> (Lorg/jellyfin/sdk/JellyfinOptions;)V
public final fun createApi ()Lorg/jellyfin/sdk/api/client/KtorClient;
public final fun createApi (Ljava/lang/String;)Lorg/jellyfin/sdk/api/client/KtorClient;
public final fun createApi (Ljava/lang/String;Ljava/lang/String;)Lorg/jellyfin/sdk/api/client/KtorClient;
public final fun createApi (Ljava/lang/String;Ljava/lang/String;Lorg/jellyfin/sdk/model/ClientInfo;)Lorg/jellyfin/sdk/api/client/KtorClient;
public final fun createApi (Ljava/lang/String;Ljava/lang/String;Lorg/jellyfin/sdk/model/ClientInfo;Lorg/jellyfin/sdk/model/DeviceInfo;)Lorg/jellyfin/sdk/api/client/KtorClient;
public final fun createApi (Ljava/lang/String;Ljava/lang/String;Lorg/jellyfin/sdk/model/ClientInfo;Lorg/jellyfin/sdk/model/DeviceInfo;Lorg/jellyfin/sdk/api/client/HttpClientOptions;)Lorg/jellyfin/sdk/api/client/KtorClient;
public static synthetic fun createApi$default (Lorg/jellyfin/sdk/Jellyfin;Ljava/lang/String;Ljava/lang/String;Lorg/jellyfin/sdk/model/ClientInfo;Lorg/jellyfin/sdk/model/DeviceInfo;Lorg/jellyfin/sdk/api/client/HttpClientOptions;ILjava/lang/Object;)Lorg/jellyfin/sdk/api/client/KtorClient;
public final fun getClientInfo ()Lorg/jellyfin/sdk/model/ClientInfo;

View File

@ -12,6 +12,7 @@ public class Jellyfin(
private val options: JellyfinOptions,
) {
public constructor(initOptions: JellyfinOptions.Builder.() -> Unit) : this(JellyfinOptions.build(initOptions))
public constructor(optionsBuilder: JellyfinOptions.Builder) : this(optionsBuilder.build())
/**
* Get the device information set when creating the Jellyfin instance or null if not set.
@ -37,6 +38,7 @@ public class Jellyfin(
*
* Throws an [IllegalStateException] when the client or device information is missing.
*/
@JvmOverloads
public fun createApi(
baseUrl: String? = null,
accessToken: String? = null,