first commit
This commit is contained in:
22
app/Services/ProductionScreenshotService.php
Normal file
22
app/Services/ProductionScreenshotService.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Contracts\ScreenshotService as ScreenshotServiceContract;
|
||||
use App\Models\TimeInterval;
|
||||
|
||||
class ProductionScreenshotService extends ScreenshotServiceContract
|
||||
{
|
||||
public function getScreenshotPath(TimeInterval|int $interval): string
|
||||
{
|
||||
return self::PARENT_FOLDER . hash('sha256', optional($interval)->id ?: $interval) . '.' . self::FILE_FORMAT;
|
||||
}
|
||||
|
||||
public function getThumbPath(TimeInterval|int $interval): string
|
||||
{
|
||||
return self::PARENT_FOLDER . self::THUMBS_FOLDER . hash(
|
||||
'sha256',
|
||||
optional($interval)->id ?: $interval
|
||||
) . '.' . self::FILE_FORMAT;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user