mirror of
https://github.com/friendica/friendica
synced 2025-05-05 15:04:09 +02:00
Reworked media handling
This commit is contained in:
parent
5a8f202158
commit
8685e5ca32
14 changed files with 457 additions and 206 deletions
|
@ -76,6 +76,27 @@ class ItemURI
|
|||
return self::insert(['uri' => $uri]);
|
||||
}
|
||||
|
||||
return $itemuri['id'];
|
||||
}
|
||||
/**
|
||||
* Searched for an id of a given guid.
|
||||
*
|
||||
* @param string $guid
|
||||
*
|
||||
* @return integer item-uri id
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getIdByGUID($guid)
|
||||
{
|
||||
// If the GUID gets too long we only take the first parts and hope for best
|
||||
$guid = substr($guid, 0, 255);
|
||||
|
||||
$itemuri = DBA::selectFirst('item-uri', ['id'], ['guid' => $guid]);
|
||||
|
||||
if (!DBA::isResult($itemuri)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return $itemuri['id'];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue