mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
Apply fixes from StyleCI (#1194)
This commit is contained in:
parent
d487727fd5
commit
8f142eb03b
4 changed files with 11 additions and 6 deletions
|
@ -249,7 +249,8 @@ class FileSynchronizer
|
|||
{
|
||||
// As directory scanning can be expensive, we cache and reuse the result.
|
||||
return $this->cache->remember(md5($this->filePath.'_cover'), 24 * 60, function (): ?string {
|
||||
$matches = array_keys(iterator_to_array(
|
||||
$matches = array_keys(
|
||||
iterator_to_array(
|
||||
$this->finder->create()
|
||||
->depth(0)
|
||||
->ignoreUnreadableDirs()
|
||||
|
@ -257,7 +258,7 @@ class FileSynchronizer
|
|||
->followLinks()
|
||||
->name('/(cov|fold)er\.(jpe?g|png)$/i')
|
||||
->in(dirname($this->filePath))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$cover = $matches ? $matches[0] : null;
|
||||
|
|
|
@ -90,12 +90,13 @@ class InteractionService
|
|||
->whereIn('song_id', $songIds)
|
||||
->where('user_id', $user->id)
|
||||
->get()
|
||||
->each(static function (Interaction $interaction): void {
|
||||
->each(
|
||||
static function (Interaction $interaction): void {
|
||||
$interaction->liked = false;
|
||||
$interaction->save();
|
||||
|
||||
event(new SongLikeToggled($interaction));
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,8 @@ class YouTubeService extends AbstractApiClient implements ApiConsumerInterface
|
|||
return null;
|
||||
}
|
||||
|
||||
$uri = sprintf('search?part=snippet&type=video&maxResults=%s&pageToken=%s&q=%s',
|
||||
$uri = sprintf(
|
||||
'search?part=snippet&type=video&maxResults=%s&pageToken=%s&q=%s',
|
||||
$perPage,
|
||||
urlencode($pageToken),
|
||||
urlencode($q)
|
||||
|
|
|
@ -24,7 +24,9 @@ class iTunesService extends AbstractApiClient implements ApiConsumerInterface
|
|||
public function getTrackUrl(string $term, string $album = '', string $artist = ''): ?string
|
||||
{
|
||||
try {
|
||||
return $this->cache->remember(md5("itunes_track_url_{$term}{$album}{$artist}"), 24 * 60 * 7,
|
||||
return $this->cache->remember(
|
||||
md5("itunes_track_url_{$term}{$album}{$artist}"),
|
||||
24 * 60 * 7,
|
||||
function () use ($term, $album, $artist): ?string {
|
||||
$params = [
|
||||
'term' => $term.($album ? " $album" : '').($artist ? " $artist" : ''),
|
||||
|
|
Loading…
Reference in a new issue