This commit is contained in:
Abdulmhsen B. A. A
2024-02-18 15:07:17 +03:00
parent 27abe1df2d
commit 3f4ff5c94d

View File

@@ -234,29 +234,31 @@ class Progress
}
try {
// $url = $context->backendUrl
// ->withPath('/:/timeline/')
// ->withQuery(
// http_build_query([
// 'ratingKey' => $logContext['remote']['id'],
// 'key' => '/library/metadata/' . $logContext['remote']['id'],
// 'identifier' => 'com.plexapp.plugins.library',
// 'state' => 'stopped',
// 'time' => $entity->getPlayProgress(),
// // -- Without duration & client identifier plex ignore watch progress update.
// 'duration' => ag($remoteData, 'duration', 0),
// 'X-Plex-Client-Identifier' => md5('WatchState/' . getAppVersion())
// ])
// );
// -- it seems /:/timeline/ allow us to update external user progress, while /:/progress/ does not.
$url = $context->backendUrl
->withPath('/:/timeline/')
->withQuery(
http_build_query([
'ratingKey' => $logContext['remote']['id'],
'key' => '/library/metadata/' . $logContext['remote']['id'],
'identifier' => 'com.plexapp.plugins.library',
'state' => 'stopped',
'time' => $entity->getPlayProgress(),
// -- Without duration & client identifier plex ignore watch progress update.
'duration' => ag($remoteData, 'duration', 0),
'X-Plex-Client-Identifier' => md5('WatchState/' . getAppVersion())
])
);
// $url = $context->backendUrl->withPath('/:/progress/')->withQuery(
// http_build_query([
// 'key' => $logContext['remote']['id'],
// 'identifier' => 'com.plexapp.plugins.library',
// 'state' => 'stopped',
// 'time' => $entity->getPlayProgress(),
// ])
// );
$url = $context->backendUrl->withPath('/:/progress/')->withQuery(
http_build_query([
'key' => $logContext['remote']['id'],
'identifier' => 'com.plexapp.plugins.library',
'state' => 'stopped',
'time' => $entity->getPlayProgress(),
])
);
$logContext['remote']['url'] = (string)$url;
$this->logger->debug('Updating [{backend}] {item.type} [{item.title}] watch progress.', [