feat: menric
This commit is contained in:
@@ -168,7 +168,9 @@ class DeviceController extends Controller
|
||||
abort_unless(Storage::disk('local')->exists($row->path), 404);
|
||||
$abs = Storage::disk('local')->path($row->path);
|
||||
$out = $preview->payload($abs, (string) $device->device_id, (string) ($row->sha256 ?: ''));
|
||||
$this->markPhotoRead($row);
|
||||
if ((string) request()->query('seen', '') === '1') {
|
||||
$this->markPhotoRead($row);
|
||||
}
|
||||
|
||||
return response($out['bytes'], 200)
|
||||
->header('Content-Type', $out['mime']);
|
||||
@@ -550,7 +552,7 @@ class DeviceController extends Controller
|
||||
$data = collect($paginator->items())->map(function (Photo $photo) use ($device, $portal, $readIds) {
|
||||
return [
|
||||
'id' => $photo->id,
|
||||
'url' => route($portal.'.devices.photo', [$device, $photo->id]),
|
||||
'url' => route($portal.'.devices.photo', [$device, $photo->id, 'seen' => 1]),
|
||||
'sha256' => $photo->sha256 ?: '',
|
||||
'size' => $photo->size,
|
||||
'x_hit' => $photo->x_hit,
|
||||
|
||||
Reference in New Issue
Block a user