Download

SDK releases

Upgrade to SDK 5.0

SDK 5.0 took copy away from its classes and the book reader's own classes out of the SDK, so later SDK releases can add properties without breaking the extensions built before them. Katari no longer loads extensions built with SDK 4.x. Every extension needs a rebuild, and one that copies the SDK's values needs a code change.

Build against 5.0 #

Move the SDK to sdk-5.0.0 and start the release count over at 5.0.0, as Version numbers describes.

build.gradle.kts
defaultConfig {
    versionCode = 14
    versionName = "4.1.3"
    versionCode = 15
    versionName = "5.0.0"
}

dependencies {
    compileOnly("com.github.pa2x2.katari:entry-source-api:sdk-4.1.0")
    compileOnly("com.github.pa2x2.katari:entry-source-api:sdk-5.0.0")
}

In your store's index, set the extension's extensionLib to "5.0" along with its new version, as The index describes.

Fix what no longer compiles #

No copy on the SDK's classes

The SDK's value classes, such as VideoStream, PlaybackSelection, EntryMedia.Book, BookSourceResource and EntryFilter.Sort.Selection, are no longer data classes. They still compare by their properties and print them, but have no copy. Build a new one with the constructor instead, and pass every property you want to keep: one you leave out takes its default. More in Links found later.

Kotlin
return stream.copy(
    request = VideoRequest(playlist),
    type = VideoStreamType.HLS,
)
return VideoStream(
    request = VideoRequest(playlist),
    label = stream.label,
    type = VideoStreamType.HLS,
)

No destructuring

They have no component1() and so on either, so read the properties by name.

Kotlin
val (index, ascending) = filter.state ?: return
val selection = filter.state ?: return
val index = selection.index
val ascending = selection.ascending

The book reader's classes left the SDK

The packages app.katari.book.api.document and app.katari.book.api.model are gone, and so are BookLocator, BookPublication, BookFailure, BookContentResource and the classes that went with them. They were Katari's own book reader model, and no SDK call takes or returns them. A book source still hands Katari HTML or EPUB, and BookContentDescriptor, BookResourceAvailability and BookCatalogCoverage stay in app.katari.book.api. More in Books.

The SDK changelog lists every change in 5.0.