Skip to content

Commit

Permalink
fix: Passing wrong argument to tautulli payload formatter #77
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxMD committed May 24, 2023
1 parent a541727 commit c10d46b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ const configDir = process.env.CONFIG_DIR || path.resolve(projectDir, `./config`)
app.postAsync('/tautulli', async function(this: any, req, res) {
tauIngress.trackIngress(req, false);

const payload = TautulliSource.formatPlayObj(req.body, {newFromSource: true});
const payload = TautulliSource.formatPlayObj(req, {newFromSource: true});
// try to get config name from payload
if (req.body.scrobblerConfig !== undefined) {
const source = scrobbleSources.getByName(req.body.scrobblerConfig);
Expand Down
4 changes: 2 additions & 2 deletions src/sources/TautulliSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {TautulliSourceConfig} from "../common/infrastructure/config/source/tautu
import {FormatPlayObjectOptions, InternalConfig, PlayObject} from "../common/infrastructure/Atomic.js";
import {combinePartsToString, truncateStringToLength} from "../utils.js";
import EventEmitter from "events";
import {Request} from "express";

const shortDeviceId = truncateStringToLength(10, '');

Expand All @@ -13,8 +14,7 @@ export default class TautulliSource extends PlexSource {
constructor(name: any, config: TautulliSourceConfig, internal: InternalConfig, emitter: EventEmitter) {
super(name, config, internal, 'tautulli', emitter);
}

static formatPlayObj(obj: any, options: FormatPlayObjectOptions = {}): PlayObject {
static formatPlayObj(obj: Request, options: FormatPlayObjectOptions = {}): PlayObject {
const {newFromSource = false} = options;
const {
artist_name,
Expand Down

0 comments on commit c10d46b

Please sign in to comment.