2015-12-13 04:42:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2018-08-19 09:05:33 +00:00
|
|
|
use App\Events\LibraryChanged;
|
2021-12-06 16:12:47 +00:00
|
|
|
use App\Events\MediaSyncCompleted;
|
2018-08-19 09:05:33 +00:00
|
|
|
use App\Events\SongLikeToggled;
|
2021-06-04 15:19:33 +00:00
|
|
|
use App\Events\SongsBatchLiked;
|
|
|
|
use App\Events\SongsBatchUnliked;
|
2018-08-19 09:05:33 +00:00
|
|
|
use App\Events\SongStartedPlaying;
|
|
|
|
use App\Listeners\ClearMediaCache;
|
2021-12-06 16:12:47 +00:00
|
|
|
use App\Listeners\DeleteNonExistingRecordsPostSync;
|
2021-06-04 15:19:33 +00:00
|
|
|
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;
|
2021-06-04 15:19:33 +00:00
|
|
|
use App\Listeners\UnloveMultipleTracksOnLastfm;
|
2018-08-19 09:05:33 +00:00
|
|
|
use App\Listeners\UpdateLastfmNowPlaying;
|
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
|
|
|
|
2021-06-04 15:19:33 +00:00
|
|
|
SongsBatchLiked::class => [
|
|
|
|
LoveMultipleTracksOnLastfm::class,
|
|
|
|
],
|
|
|
|
|
|
|
|
SongsBatchUnliked::class => [
|
|
|
|
UnloveMultipleTracksOnLastfm::class,
|
|
|
|
],
|
|
|
|
|
2018-08-19 09:05:33 +00:00
|
|
|
SongStartedPlaying::class => [
|
|
|
|
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
|
|
|
ClearMediaCache::class,
|
|
|
|
],
|
|
|
|
|
2021-12-06 16:12:47 +00:00
|
|
|
MediaSyncCompleted::class => [
|
|
|
|
DeleteNonExistingRecordsPostSync::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
|
|
|
}
|
|
|
|
}
|