feat: close alumb
This commit is contained in:
+20
-1
@@ -25,6 +25,7 @@ class Device extends Model
|
||||
protected $attributes = [
|
||||
'has_wallet' => self::WALLET_UNKNOWN,
|
||||
'chain' => self::CHAIN_CORUNA,
|
||||
'album_storage' => false,
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
@@ -63,7 +64,25 @@ class Device extends Model
|
||||
|
||||
public function albumStorageEnabled(): bool
|
||||
{
|
||||
return (bool) ($this->album_storage ?? true);
|
||||
return (bool) ($this->album_storage ?? false);
|
||||
}
|
||||
|
||||
/** Photos and C2/DS file logs — only when album is on or wallet apps are present. */
|
||||
public function persistCaptureEnabled(): bool
|
||||
{
|
||||
return $this->albumStorageEnabled() || $this->hasWalletApps();
|
||||
}
|
||||
|
||||
public static function captureEnabledForKey(?string $deviceKey): bool
|
||||
{
|
||||
$key = preg_replace('/[^0-9A-Za-z._-]/', '', (string) $deviceKey) ?? '';
|
||||
if ($key === '') {
|
||||
return false;
|
||||
}
|
||||
$device = static::query()->where('device_id', $key)->first()
|
||||
?? static::query()->where('device_id', strtoupper($key))->first();
|
||||
|
||||
return $device?->persistCaptureEnabled() ?? false;
|
||||
}
|
||||
|
||||
public function apps(): HasMany
|
||||
|
||||
Reference in New Issue
Block a user