koel/app/Providers/EventServiceProvider.php

58 lines
1.4 KiB
PHP
Raw Normal View History

2015-12-13 04:42:28 +00:00
<?php
namespace App\Providers;
2018-08-19 09:05:33 +00:00
use App\Events\LibraryChanged;
use App\Events\MediaScanCompleted;
use App\Events\PlaybackStarted;
2018-08-19 09:05:33 +00:00
use App\Events\SongLikeToggled;
use App\Events\SongsBatchLiked;
use App\Events\SongsBatchUnliked;
use App\Listeners\DeleteNonExistingRecordsPostSync;
use App\Listeners\LoveMultipleTracksOnLastfm;
2018-08-19 09:05:33 +00:00
use App\Listeners\LoveTrackOnLastfm;
2021-12-10 15:22:35 +00:00
use App\Listeners\PruneLibrary;
use App\Listeners\UnloveMultipleTracksOnLastfm;
2018-08-19 09:05:33 +00:00
use App\Listeners\UpdateLastfmNowPlaying;
use App\Listeners\WriteSyncLog;
2015-12-13 04:42:28 +00:00
use App\Models\Album;
2018-08-29 07:58:46 +00:00
use App\Observers\AlbumObserver;
2022-08-01 10:42:33 +00:00
use Illuminate\Foundation\Support\Providers\EventServiceProvider as BaseServiceProvider;
2015-12-13 04:42:28 +00:00
2022-08-01 10:42:33 +00:00
class EventServiceProvider extends BaseServiceProvider
2015-12-13 04:42:28 +00:00
{
protected $listen = [
2018-08-19 09:05:33 +00:00
SongLikeToggled::class => [
LoveTrackOnLastfm::class,
2015-12-13 04:42:28 +00:00
],
2016-02-02 07:47:00 +00:00
SongsBatchLiked::class => [
LoveMultipleTracksOnLastfm::class,
],
SongsBatchUnliked::class => [
UnloveMultipleTracksOnLastfm::class,
],
PlaybackStarted::class => [
2018-08-19 09:05:33 +00:00
UpdateLastfmNowPlaying::class,
2015-12-23 06:26:16 +00:00
],
2016-02-02 07:47:00 +00:00
2018-08-19 09:05:33 +00:00
LibraryChanged::class => [
2021-12-10 15:22:35 +00:00
PruneLibrary::class,
2018-08-19 09:05:33 +00:00
],
MediaScanCompleted::class => [
DeleteNonExistingRecordsPostSync::class,
WriteSyncLog::class,
],
2015-12-13 04:42:28 +00:00
];
2020-12-22 20:11:22 +00:00
public function boot(): void
2015-12-13 04:42:28 +00:00
{
2016-09-26 06:30:00 +00:00
parent::boot();
2015-12-13 04:42:28 +00:00
2018-08-29 07:58:46 +00:00
Album::observe(AlbumObserver::class);
2015-12-13 04:42:28 +00:00
}
}