refactor: optimize query usage in SyncSpotifyMusicProductions and SyncYoutubeReleases commands, enhance MusicProductionController by removing unused header logic, and update view structure for improved maintainability
This commit is contained in:
@@ -168,12 +168,17 @@ class SyncSpotifyMusicProductions extends Command
|
||||
|
||||
$slug = Str::slug($title);
|
||||
|
||||
$bySlug = MusicProduction::where('slug', '=', $slug, 'and')->first();
|
||||
$bySlug = MusicProduction::query()
|
||||
->where('slug', $slug)
|
||||
->first();
|
||||
|
||||
if ($bySlug) {
|
||||
return $bySlug;
|
||||
}
|
||||
|
||||
return MusicProduction::whereRaw('LOWER(title) = ?', [Str::lower($title)], 'and')->first();
|
||||
return MusicProduction::query()
|
||||
->whereRaw('LOWER(title) = ?', [Str::lower($title)], 'and')
|
||||
->first();
|
||||
}
|
||||
|
||||
protected function parseReleaseDate(?string $date, string $precision = 'day'): ?Carbon
|
||||
|
||||
Reference in New Issue
Block a user