get('path'); $pi = pathinfo($path); $nfo = "{$pi['dirname']}/{$pi['filename']}.nfo"; if (file_exists($nfo)) { $properties['epNfo'] = $nfo; return $this->getEpFromNfo($properties, $nfo); } return $properties; } protected function getEpFromNfo(Collection $properties, string $nfo): Collection { $xml = simplexml_load_file($nfo); if ($xml->season) { $properties['season'] = (int) $xml->season; } if ($xml->episode) { $properties['episode'] = (int) $xml->episode; } return $properties; } }