Added support for "Tumblr Neue Post Format"

This commit is contained in:
Michael 2023-03-27 06:40:22 +00:00
parent 08d1e484e3
commit aca4b2eaae
2 changed files with 476 additions and 0 deletions

View file

@ -757,6 +757,17 @@ class Media
return DBA::selectToArray('post-media', [], $condition, ['order' => ['id']]);
}
public static function getByURL(int $uri_id, string $url, array $types = [])
{
$condition = ["`uri-id` = ? AND `url` = ? AND `type` != ?", $uri_id, $url, self::UNKNOWN];
if (!empty($types)) {
$condition = DBA::mergeConditions($condition, ['type' => $types]);
}
return DBA::selectFirst('post-media', [], $condition);
}
/**
* Retrieves the media attachment with the provided media id.
*