koel/app/Providers/EventServiceProvider.php

57 lines
1.4 KiB
PHP

<?php
namespace App\Providers;
use App\Events\LibraryChanged;
use App\Events\MediaScanCompleted;
use App\Events\PlaybackStarted;
use App\Events\SongLikeToggled;
use App\Events\SongsBatchLiked;
use App\Events\SongsBatchUnliked;
use App\Listeners\DeleteNonExistingRecordsPostSync;
use App\Listeners\LoveMultipleTracksOnLastfm;
use App\Listeners\LoveTrackOnLastfm;
use App\Listeners\PruneLibrary;
use App\Listeners\UnloveMultipleTracksOnLastfm;
use App\Listeners\UpdateLastfmNowPlaying;
use App\Listeners\WriteSyncLog;
use App\Models\Album;
use App\Observers\AlbumObserver;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as BaseServiceProvider;
class EventServiceProvider extends BaseServiceProvider
{
protected $listen = [
SongLikeToggled::class => [
LoveTrackOnLastfm::class,
],
SongsBatchLiked::class => [
LoveMultipleTracksOnLastfm::class,
],
SongsBatchUnliked::class => [
UnloveMultipleTracksOnLastfm::class,
],
PlaybackStarted::class => [
UpdateLastfmNowPlaying::class,
],
LibraryChanged::class => [
PruneLibrary::class,
],
MediaScanCompleted::class => [
DeleteNonExistingRecordsPostSync::class,
WriteSyncLog::class,
],
];
public function boot(): void
{
parent::boot();
Album::observe(AlbumObserver::class);
}
}