summaryrefslogtreecommitdiffstats
path: root/lib/Db
diff options
context:
space:
mode:
authorSean Molenaar <sean@seanmolenaar.eu>2020-10-02 19:41:40 +0200
committerBenjamin Brahmer <info@b-brahmer.de>2020-10-03 14:01:36 +0200
commit167dc70238cc4c82e46714fe55a516d48c0d6c76 (patch)
treec1222956d8bab43aa79bfc6fc018ad1891215dd5 /lib/Db
parent11ed50074dd64e5d532cf310a150a77f519a4a0e (diff)
Fix various 15.0 bugs
Issue #821,#820,#819 Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Db')
-rw-r--r--lib/Db/Item.php4
-rw-r--r--lib/Db/ItemMapperV2.php12
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/Db/Item.php b/lib/Db/Item.php
index d7efdd14b..37497049c 100644
--- a/lib/Db/Item.php
+++ b/lib/Db/Item.php
@@ -591,9 +591,11 @@ class Item extends Entity implements IAPI, \JsonSerializable
*
* @return boolean
*/
- public function isSupportedMime(string $mime): bool
+ public function isSupportedMime(?string $mime): bool
{
+
return (
+ $mime !== null ||
stripos($mime, 'audio/') !== false ||
stripos($mime, 'image/') !== false ||
stripos($mime, 'video/') !== false);
diff --git a/lib/Db/ItemMapperV2.php b/lib/Db/ItemMapperV2.php
index edb8ba55f..222340744 100644
--- a/lib/Db/ItemMapperV2.php
+++ b/lib/Db/ItemMapperV2.php
@@ -95,12 +95,18 @@ class ItemMapperV2 extends NewsMapperV2
return $this->findEntity($builder);
}
- public function findByGuidHash(string $getGuidHash): Item
+ public function findByGuidHash(string $guidHash): Item
{
- throw new DoesNotExistException('fasi');
+ $builder = $this->db->getQueryBuilder();
+ $builder->addSelect('*')
+ ->from($this->tableName)
+ ->andWhere('guid_hash = :guid_hash')
+ ->setParameter(':guid_hash', $guidHash, IQueryBuilder::PARAM_STR);
+
+ return $this->findEntity($builder);
}
- public function findAllForFeed(int $feedId)
+ public function findAllForFeed(int $feedId): array
{
$builder = $this->db->getQueryBuilder();
$builder->addSelect('*')