2020-09-08 13:17:55 +02:00
|
|
|
|
2020-09-21 05:30:39 +02:00
|
|
|
const { ApiClient, Events } = require("jellyfin-apiclient");
|
|
|
|
const CONFIG = require("../config.json");
|
|
|
|
const os = require("os");
|
2020-09-08 13:17:55 +02:00
|
|
|
|
|
|
|
var jellyfinClient;
|
|
|
|
|
2020-09-21 05:30:39 +02:00
|
|
|
function init () {
|
|
|
|
jellyfinClient = new ApiClient(CONFIG["server-adress"], CONFIG["jellyfin-app-name"], "0.0.1", os.hostname(), os.hostname());
|
2020-09-08 13:17:55 +02:00
|
|
|
}
|
|
|
|
|
2020-09-21 05:30:39 +02:00
|
|
|
function getJellyfinClient () {
|
|
|
|
return jellyfinClient;
|
2020-09-08 13:17:55 +02:00
|
|
|
}
|
|
|
|
|
2020-09-21 05:30:39 +02:00
|
|
|
function getJellyfinEvents () {
|
|
|
|
return Events;
|
2020-09-19 09:01:09 +02:00
|
|
|
}
|
|
|
|
|
2020-09-08 13:17:55 +02:00
|
|
|
module.exports = {
|
2020-09-21 05:30:39 +02:00
|
|
|
getJellyfinClient,
|
|
|
|
getJellyfinEvents,
|
|
|
|
init
|
|
|
|
};
|