Skip to content

Instantly share code, notes, and snippets.

View nielsvanvelzen's full-sized avatar
🟣
¯\_(ツ)_/¯

Niels van Velzen nielsvanvelzen

🟣
¯\_(ツ)_/¯
View GitHub Profile

Difference

Document info

Value Before After
API version 10.8.13 10.9.0
Jellyfin version 10.8.13 10.9.0

Operations

@nielsvanvelzen
nielsvanvelzen / plugintest.js
Created February 13, 2023 08:38
jellyfin-plugins-tester
// deno run --allow-net .\plugintest.js
const manifestUrl = 'https://repo.jellyfin.org/master/releases/plugin/manifest-stable.json';
console.log(`Reading from ${manifestUrl}`);
const res = await fetch(manifestUrl);
const json = await res.json();
for (const plugin of json) {
if (plugin.versions.length === 0) throw `Plugin ${plugin.name} doesn't have any versions!?`;
@nielsvanvelzen
nielsvanvelzen / jf-dev-auth.md
Last active April 18, 2024 14:00
Jellyfin API Authorization

Jellyfin API Authorization

To start using the Jellyfin API, authorization is probably the first thing you'll need to do. Jellyfin's authorization options can be a bit confusing because there are a lot of deprecated options.

Generally there are three ways to authenticate: no authorization, user authorization with an access token or authorization with an API key. The first way is easy, just do nothing. But most often you'll need to use either the access token or API key.

Sending authorization values

There are multiple methods for transmitting authorization values, however, some are outdated and scheduled to be removed. It's recommend to use the Authorization header. If header auth isn't an option, the token may be sent through the ApiKey query parameter. Sending secure data in a query parameter is unsafe as the changes of it leaking (via logs, copy-paste actions or by other means) are high. Only use this method as a last resort.

@nielsvanvelzen
nielsvanvelzen / DreamServiceCompat.kt
Last active March 24, 2024 16:24
Extension to DreamService to allow usage of Jetpack Compose inside
import android.service.dreams.DreamService
import androidx.annotation.CallSuper
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.ComposeView
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleRegistry
import androidx.lifecycle.ViewTreeLifecycleOwner
import androidx.savedstate.SavedStateRegistry
import androidx.savedstate.SavedStateRegistryController
import androidx.savedstate.SavedStateRegistryOwner
@nielsvanvelzen
nielsvanvelzen / search.md
Created July 9, 2021 14:08
GitHub search queries

GitHub search queries

This is a list of useful search queries that I regularely use on GitHub.

All merged pull requests with no assigned project

is:pr is:merged no:project
@nielsvanvelzen
nielsvanvelzen / JavaExample .java
Created June 5, 2021 13:25
Kotlin SDK - Java sample
package org.jellyfin.sdk.sample.java;
import org.jellyfin.sdk.api.client.HttpClientOptions;
import org.jellyfin.sdk.api.client.KtorClient;
import org.jellyfin.sdk.api.client.Response;
import org.jellyfin.sdk.api.client.compatibility.JavaCallback;
import org.jellyfin.sdk.api.operations.UserApi;
import org.jellyfin.sdk.model.ClientInfo;
import org.jellyfin.sdk.model.DeviceInfo;
import org.jellyfin.sdk.model.api.AuthenticateUserByName;
@nielsvanvelzen
nielsvanvelzen / vite.config.ts
Last active March 16, 2021 09:26
Vite default config
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config/
export default defineConfig({
root: 'src',
base: './',
publicDir: 'static',
build: {
outDir: '../dist',
@nielsvanvelzen
nielsvanvelzen / ServerInfo.java
Last active May 1, 2020 15:52
Model to Kotlin sample
package org.jellyfin.apiclient.model.apiclient;
import org.jellyfin.apiclient.model.system.PublicSystemInfo;
import java.util.Date;
public class ServerInfo {
private String Name;
private String Id;
private String Address;
@nielsvanvelzen
nielsvanvelzen / ExposedQueryOrderByDistance.kt
Created March 15, 2019 11:06
Order by distance function for JetBrains Exposed.
import org.jetbrains.exposed.sql.*
fun Query.orderByDistance(
columnX: Column<Double>,
columnY: Column<Double>,
compareX: Double,
compareY: Double,
order: SortOrder = SortOrder.ASC
@nielsvanvelzen
nielsvanvelzen / example.js
Created May 3, 2018 19:41
ES6 Async constructors
/*
* Ecmascript supports the `async` keyword to make functions async.
* Unfortunately it doesn't work on construcors.
*
* However: you can return in a constructor!
*/
(async() => { // for top level await
class Example {
// ES6 constructor