Skip to content

Commit e96ebdc

Browse files
committed
Added taint state/has progress to ProcessRequestEvent, and added taint state to Webhook event logging.
1 parent 3e34e6e commit e96ebdc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/API/Backend/Webhooks.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,14 @@ private function process(string $name, iRequest $request): iResponse
207207
$this->write(
208208
$request,
209209
Level::Info,
210-
"Queued '{backend}: {event}' {item.type} '{item.title}' - 'state: {state}'. request_id '{req}'.",
210+
"Queued {tainted} request '{backend}: {event}' {item.type} '{item.title}' - 'state: {state}'. request_id '{req}'.",
211211
[
212212
'backend' => $entity->via,
213213
'event' => ag($entity->getExtra($entity->via), iState::COLUMN_EXTRA_EVENT),
214214
'has_progress' => $entity->hasPlayProgress() ? 'Yes' : 'No',
215215
'req' => ag($request->getServerParams(), 'X_REQUEST_ID', '-'),
216216
'state' => $entity->isWatched() ? 'played' : 'unplayed',
217+
'tainted' => $entity->isTainted() ? 'tainted' : 'untainted',
217218
'item' => [
218219
'title' => $entity->getName(),
219220
'type' => $entity->type,

src/Listeners/ProcessRequestEvent.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ public function __invoke(DataEvent $e): DataEvent
4242
}
4343

4444
$message = r(
45-
"Processing {tainted} request '{backend}: {event}' {title} - 'state: {played}'. request_id: '{req}'.",
45+
"Processing {tainted} request '{backend}: {event}' {title} - 'state: {played}, progress: {has_progress}'. request_id: '{req}'.",
4646
[
4747
'backend' => $entity->via,
4848
'req' => ag($e->getOptions(), Options::REQUEST_ID, '-'),
4949
'played' => $entity->isWatched() ? 'played' : 'unplayed',
5050
'title' => $entity->getName(),
5151
'event' => ag($entity->getExtra($entity->via), iState::COLUMN_EXTRA_EVENT, '??'),
5252
'tainted' => $entity->isTainted() ? 'tainted' : 'untainted',
53+
'has_progress' => $entity->hasPlayProgress() ? 'Yes' : 'No',
5354
'lastSync' => $lastSync,
5455
]
5556
);

0 commit comments

Comments
 (0)