Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public static function addData($id, MediaInfoContainer $xmlArray): void |
||
16 | { |
||
17 | $mediainfoArray = $xmlArray->getGeneral(); |
||
18 | if (! $mediainfoArray) { |
||
19 | return; |
||
20 | } |
||
21 | |||
22 | // Check if we have the same release in the database |
||
23 | if (self::where('releases_id', $id)->exists()) { |
||
24 | return; |
||
25 | } |
||
26 | |||
27 | self::insertOrIgnore([ |
||
28 | 'releases_id' => $id, |
||
29 | 'movie_name' => $mediainfoArray->get('movie_name') ?? null, |
||
30 | 'file_name' => $mediainfoArray->get('file_name') ?? null, |
||
31 | 'unique_id' => $mediainfoArray->get('unique_id') ?? null, |
||
32 | 'created_at' => now(), |
||
33 | 'updated_at' => now(), |
||
34 | ]); |
||
37 |