Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
Something went wrong. Try again.
1.2 kB · 38 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839import { childLogger, type Logger } from "@foxxmd/logging";import type { PlayObject } from "../../../core/Atomic.ts";import { capitalize } from "../../../core/StringUtils.ts";import type { AbstractApiOptions, FormatPlayObjectOptions } from "../infrastructure/Atomic.ts";
export default abstract class AbstractApiClient { name: string; type: string; initialized: boolean = false;
config: object; options: object; logger: Logger;
client: any; workingCredsPath?: string; redirectUri?: string;
constructor(type: any, name: any, config = {}, options: AbstractApiOptions) { this.type = type; this.name = name; const { logger: parentLogger, ...restOptions } = options; this.logger = childLogger(parentLogger, this.getIdentifier()); this.config = config; this.options = restOptions; }
protected getIdentifier() { return `API - ${capitalize(this.type)} - ${this.name}`; }
static formatPlayObj(obj: any, options: FormatPlayObjectOptions): PlayObject { throw new Error('should be overridden'); }}