diff --git a/lib/Enclosure/Enclosure.php b/lib/Enclosure/Enclosure.php index 9976832..c100513 100644 --- a/lib/Enclosure/Enclosure.php +++ b/lib/Enclosure/Enclosure.php @@ -8,8 +8,8 @@ namespace MensBeam\Lax\Enclosure; /** * @property \MensBeam\Lax\Url $url + * @property \MensBeam\Lax\Text $title * @property string $type - * @property string $title * @property int $height * @property int $width * @property int $duration diff --git a/lib/Parser/JSON/Entry.php b/lib/Parser/JSON/Entry.php index 9421c77..57492c1 100644 --- a/lib/Parser/JSON/Entry.php +++ b/lib/Parser/JSON/Entry.php @@ -163,17 +163,18 @@ class Entry implements \MensBeam\Lax\Parser\Entry { $m = new Enclosure; $m->url = $url; $m->type = $this->fetchType("mime_type", $url, $attachment); - $m->title = $this->fetchMember("title", "str", $attachment); + $m->title = $this->fetchText("title", $attachment); $m->size = $this->fetchMember("size_in_bytes", "int", $attachment); $m->duration = $this->fetchMember("duration_in_seconds", "int", $attachment); if (isset($m->title)) { // if the enclosure has a title, it should be part of a set // the set may need to be created - if (isset($titled[$m->title])) { - $titled[$m->title][] = $m; + $title = $m->title ? $m->title->plain : null; + if (isset($titled[$title])) { + $titled[$title][] = $m; } else { - $titled[$m->title] = new Enclosure($m); - $out[] = $titled[$m->title]; + $titled[$title] = new Enclosure($m); + $out[] = $titled[$title]; } } else { $out[] = $m;