2015-12-13 04:42:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2018-08-19 09:05:33 +00:00
|
|
|
use App\Events\AlbumInformationFetched;
|
|
|
|
use App\Events\ArtistInformationFetched;
|
|
|
|
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;
|
2018-08-19 09:05:33 +00:00
|
|
|
use App\Listeners\DownloadAlbumCover;
|
|
|
|
use App\Listeners\DownloadArtistImage;
|
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;
|
2016-03-23 13:23:13 +00:00
|
|
|
use App\Models\Song;
|
2018-08-29 07:58:46 +00:00
|
|
|
use App\Observers\AlbumObserver;
|
|
|
|
use App\Observers\SongObserver;
|
2015-12-13 04:42:28 +00:00
|
|
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
|
|
|
|
|
|
|
class EventServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
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,
|
|
|
|
],
|
|
|
|
|
|
|
|
AlbumInformationFetched::class => [
|
|
|
|
DownloadAlbumCover::class,
|
|
|
|
],
|
|
|
|
|
|
|
|
ArtistInformationFetched::class => [
|
|
|
|
DownloadArtistImage::class,
|
2016-02-02 07:47:00 +00:00
|
|
|
],
|
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
|
|
|
Song::observe(SongObserver::class);
|
|
|
|
Album::observe(AlbumObserver::class);
|
2015-12-13 04:42:28 +00:00
|
|
|
}
|
|
|
|
}
|