| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.0123 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 1 | public function getAlbumInformation(Album $album): ?array |
|
| 25 | { |
||
| 26 | 1 | if ($album->is_unknown) { |
|
| 27 | return null; |
||
| 28 | } |
||
| 29 | |||
| 30 | 1 | $info = $this->lastfmService->getAlbumInformation($album->name, $album->artist->name); |
|
| 31 | |||
| 32 | 1 | if ($info) { |
|
| 33 | 1 | event(new AlbumInformationFetched($album, $info)); |
|
| 34 | |||
| 35 | // The album may have been updated. |
||
| 36 | 1 | $album->refresh(); |
|
| 37 | 1 | $info['cover'] = $album->cover; |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | return $info; |
|
| 41 | } |
||
| 67 |