mirror of
https://github.com/koel/koel
synced 2024-11-28 06:50:27 +00:00
60 lines
1.5 KiB
PHP
60 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Events\LibraryChanged;
|
|
use App\Events\MediaSyncCompleted;
|
|
use App\Events\SongLikeToggled;
|
|
use App\Events\SongsBatchLiked;
|
|
use App\Events\SongsBatchUnliked;
|
|
use App\Events\SongStartedPlaying;
|
|
use App\Listeners\ClearMediaCache;
|
|
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\Models\Album;
|
|
use App\Models\Song;
|
|
use App\Observers\AlbumObserver;
|
|
use App\Observers\SongObserver;
|
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
|
|
|
class EventServiceProvider extends ServiceProvider
|
|
{
|
|
protected $listen = [
|
|
SongLikeToggled::class => [
|
|
LoveTrackOnLastfm::class,
|
|
],
|
|
|
|
SongsBatchLiked::class => [
|
|
LoveMultipleTracksOnLastfm::class,
|
|
],
|
|
|
|
SongsBatchUnliked::class => [
|
|
UnloveMultipleTracksOnLastfm::class,
|
|
],
|
|
|
|
SongStartedPlaying::class => [
|
|
UpdateLastfmNowPlaying::class,
|
|
],
|
|
|
|
LibraryChanged::class => [
|
|
PruneLibrary::class,
|
|
ClearMediaCache::class,
|
|
],
|
|
|
|
MediaSyncCompleted::class => [
|
|
DeleteNonExistingRecordsPostSync::class,
|
|
],
|
|
];
|
|
|
|
public function boot(): void
|
|
{
|
|
parent::boot();
|
|
|
|
Song::observe(SongObserver::class);
|
|
Album::observe(AlbumObserver::class);
|
|
}
|
|
}
|