koel/app/Providers/EventServiceProvider.php

64 lines
1.6 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;
2024-01-10 21:37:24 +00:00
use App\Events\MultipleSongsLiked;
use App\Events\MultipleSongsUnliked;
use App\Events\NewPlaylistCollaboratorJoined;
use App\Events\PlaybackStarted;
2018-08-19 09:05:33 +00:00
use App\Events\SongLikeToggled;
use App\Listeners\DeleteNonExistingRecordsPostSync;
use App\Listeners\LoveMultipleTracksOnLastfm;
2018-08-19 09:05:33 +00:00
use App\Listeners\LoveTrackOnLastfm;
use App\Listeners\MakePlaylistSongsPublic;
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
2024-01-10 21:37:24 +00:00
MultipleSongsLiked::class => [
LoveMultipleTracksOnLastfm::class,
],
2024-01-10 21:37:24 +00:00
MultipleSongsUnliked::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,
],
NewPlaylistCollaboratorJoined::class => [
MakePlaylistSongsPublic::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
}
}