feat: ship creator journey v2 and profile updates

This commit is contained in:
2026-04-12 21:42:07 +02:00
parent a2457f4e49
commit d5cff21ea2
335 changed files with 20147 additions and 1545 deletions

View File

@@ -6,6 +6,7 @@ namespace App\Http\Controllers;
use App\Models\Artwork;
use App\Models\ArtworkDownload;
use App\Services\ArtworkStatsService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Log;
@@ -34,6 +35,10 @@ final class ArtworkDownloadController extends Controller
'gz',
];
public function __construct(
private readonly ArtworkStatsService $stats,
) {}
public function __invoke(Request $request, int $id): BinaryFileResponse
{
$artwork = Artwork::query()->find($id);
@@ -51,6 +56,15 @@ final class ArtworkDownloadController extends Controller
$this->recordDownload($request, $artwork->id);
$this->incrementDownloadCountIfAvailable($artwork->id);
try {
$this->stats->incrementDownloads((int) $artwork->id, 1, defer: false);
} catch (\Throwable $exception) {
Log::warning('Failed to increment artwork_stats download counter.', [
'artwork_id' => $artwork->id,
'error' => $exception->getMessage(),
]);
}
if (! File::isFile($filePath)) {
Log::warning('Artwork original file missing for download.', [
'artwork_id' => $artwork->id,