mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
fix: remove unused splash_color
This commit is contained in:
@@ -15,9 +15,9 @@ class ChampionController extends Controller
|
||||
{
|
||||
$eightHoursInSeconds = 60 * 60 * 8;
|
||||
|
||||
$champions = Cache::remember('championsListAllCache', $eightHoursInSeconds, static fn () => Champion::orderBy('name')->get());
|
||||
$champions = Cache::remember('championsListAllCache', $eightHoursInSeconds, static fn() => Champion::orderBy('name')->get());
|
||||
|
||||
$roles = Cache::remember('championsRolesCache', $eightHoursInSeconds, static fn () => ChampionRoles::orderBy('champion_name')->get());
|
||||
$roles = Cache::remember('championsRolesCache', $eightHoursInSeconds, static fn() => ChampionRoles::orderBy('champion_name')->get());
|
||||
|
||||
return view('champions.index', ['champions' => $champions, 'roles' => $roles]);
|
||||
}
|
||||
@@ -28,20 +28,11 @@ class ChampionController extends Controller
|
||||
public function show(Champion $champion)
|
||||
{
|
||||
$threeDaysInSeconds = 60 * 60 * 24 * 3;
|
||||
$sixMonthsInSeconds = 60 * 60 * 24 * 30 * 6;
|
||||
|
||||
$champion = Cache::remember('championShowCache'.$champion->slug, $threeDaysInSeconds, static fn () => $champion->load('streamers', 'skins', 'lanes'));
|
||||
$champion = Cache::remember('championShowCache' . $champion->slug, $threeDaysInSeconds, static fn() => $champion->load('streamers', 'skins', 'lanes'));
|
||||
|
||||
$streamers = $champion->load('streamers')->streamers;
|
||||
|
||||
$splashColor = Cache::remember(
|
||||
'championSplashColorCache'.$champion->slug,
|
||||
$sixMonthsInSeconds,
|
||||
static fn () => getAverageColorFromImageUrl('https://wsrv.nl/?url='.$champion->getChampionImageAttribute(true))
|
||||
);
|
||||
|
||||
$champion->splash_color = $splashColor;
|
||||
|
||||
return view('champions.show', ['champion' => $champion, 'streamers' => $streamers]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,14 +63,6 @@ class ChampionSkinController extends Controller
|
||||
static fn () => $championSkin->load('champion', 'chromas')
|
||||
);
|
||||
|
||||
$splashColor = Cache::remember(
|
||||
'championSkinSplashColorCache'.$championSkin->slug,
|
||||
60 * 60 * 120,
|
||||
static fn () => getAverageColorFromImageUrl('https://wsrv.nl/?url='.$championSkin->getSkinImageAttribute(true))
|
||||
);
|
||||
|
||||
$skin->splash_color = $splashColor;
|
||||
|
||||
return view('skins.show', ['skin' => $skin]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user