16
16
use App \Libs \Uri ;
17
17
use App \Listeners \ProcessRequestEvent ;
18
18
use App \Model \Events \EventsTable ;
19
- use DateInterval ;
20
19
use Monolog \Handler \StreamHandler ;
21
20
use Monolog \Level ;
22
21
use Monolog \Logger ;
@@ -199,23 +198,14 @@ private function process(string $name, iRequest $request): iResponse
199
198
'id ' => ag ($ entity ->getMetadata ($ entity ->via ), iState::COLUMN_ID , '?? ' ),
200
199
]);
201
200
202
- queueEvent (ProcessRequestEvent::NAME , [
203
- 'options ' => [
204
- Options::IMPORT_METADATA_ONLY => $ metadataOnly ,
205
- ],
206
- 'entity ' => $ entity ->getAll (),
207
- ], [
208
- EventsTable::COLUMN_REFERENCE => $ itemId ,
201
+ queueEvent (ProcessRequestEvent::NAME , $ entity ->getAll (), [
209
202
'unique ' => true ,
203
+ EventsTable::COLUMN_REFERENCE => $ itemId ,
204
+ EventsTable::COLUMN_OPTIONS => [
205
+ Options::IMPORT_METADATA_ONLY => $ metadataOnly ,
206
+ ]
210
207
]);
211
208
212
- $ pEnabled = (bool )env ('WS_CRON_PROGRESS ' , false );
213
- if ($ pEnabled && false === $ metadataOnly && true === $ entity ->hasPlayProgress () && !$ entity ->isWatched ()) {
214
- $ progress = $ this ->cache ->get ('progress ' , []);
215
- $ progress [str_replace ($ itemId , ':tainted@ ' , ':untainted@ ' )] = $ entity ;
216
- $ this ->cache ->set ('progress ' , $ progress , new DateInterval ('P3D ' ));
217
- }
218
-
219
209
$ this ->write ($ request , Level::Info, 'Queued [{backend}: {event}] {item.type} [{item.title}]. ' , [
220
210
'backend ' => $ entity ->via ,
221
211
'event ' => ag ($ entity ->getExtra ($ entity ->via ), iState::COLUMN_EXTRA_EVENT ),
@@ -225,7 +215,7 @@ private function process(string $name, iRequest $request): iResponse
225
215
'type ' => $ entity ->type ,
226
216
'played ' => $ entity ->isWatched () ? 'Yes ' : 'No ' ,
227
217
'queue_id ' => $ itemId ,
228
- 'progress ' => $ pEnabled && $ entity ->hasPlayProgress () ? $ entity ->getPlayProgress () : null ,
218
+ 'progress ' => $ entity ->hasPlayProgress () ? $ entity ->getPlayProgress () : null ,
229
219
]
230
220
]
231
221
);
0 commit comments