}
foreach ($attachments as $attachment) {
+ if (Post\Link::exists($uriid, $attachment['preview'] ?? $attachment['url'])) {
+ continue;
+ }
+
// Only store attachments that are part of the unshared body
if (Item::containsLink($unshared_body, $attachment['preview'] ?? $attachment['url'], $attachment['type'])) {
self::insert($attachment);
* Get preview link for given media id
*
* @param integer $id media id
- * @param string $size One of the ProxyUtils::SIZE_* constants
+ * @param string $size One of the Proxy::SIZE_* constants
* @return string preview link
*/
public static function getPreviewUrlForId(int $id, string $size = ''):string
* Get media link for given media id
*
* @param integer $id media id
- * @param string $size One of the ProxyUtils::SIZE_* constants
+ * @param string $size One of the Proxy::SIZE_* constants
* @return string media link
*/
public static function getUrlForId(int $id, string $size = ''):string