Skip to content

Commit

Permalink
Merge pull request #135 from ArabCoders/dev
Browse files Browse the repository at this point in the history
Fixed overriding updated column in webhook context.
  • Loading branch information
arabcoders committed Jun 1, 2022
2 parents c0efe37 + 32135fa commit 2d14a41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Libs/Servers/JellyfinServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,7 @@ protected function createEntity(array $item, string $type, array $opts = []): St
// -- Handle watched/updated column in a special way to support mark as unplayed.
if (null !== ($opts['override'][iFace::COLUMN_WATCHED] ?? null)) {
$isPlayed = (bool)$opts['override'][iFace::COLUMN_WATCHED];
$date = $opts['override'][iFace::COLUMN_WATCHED] ?? ag($item, 'DateCreated');
$date = $opts['override'][iFace::COLUMN_UPDATED] ?? ag($item, 'DateCreated');
} else {
$isPlayed = (bool)ag($item, 'UserData.Played', false);
$date = ag($item, true === $isPlayed ? ['UserData.LastPlayedDate', 'DateCreated'] : 'DateCreated');
Expand Down
2 changes: 1 addition & 1 deletion src/Libs/Servers/PlexServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,7 @@ protected function createEntity(array $item, string $type, array $opts = []): St
// -- Handle watched/updated column in a special way to support mark as unplayed.
if (null !== ($opts['override'][iFace::COLUMN_WATCHED] ?? null)) {
$isPlayed = (bool)$opts['override'][iFace::COLUMN_WATCHED];
$date = $opts['override'][iFace::COLUMN_WATCHED] ?? ag($item, 'addedAt');
$date = $opts['override'][iFace::COLUMN_UPDATED] ?? ag($item, 'addedAt');
} else {
$isPlayed = (bool)ag($item, 'viewCount', false);
$date = ag($item, true === $isPlayed ? 'lastViewedAt' : 'addedAt');
Expand Down

0 comments on commit 2d14a41

Please sign in to comment.