diff options
author | Tobias Kappé <[email protected]> | 2018-08-18 17:17:30 +0100 |
---|---|---|
committer | Tobias Kappé <[email protected]> | 2018-08-18 17:17:30 +0100 |
commit | ac8a0e7dc6020bf099488ae04a49681c7fc7d6ef (patch) | |
tree | ed88b9d5f8967937799a8a0fead863c1dfab1a2e | |
parent | 32c0c07cc1fb1019a61b83814bdd7c3830b621e6 (diff) |
Differentiate enclosures based on content type.
Some RSS feeds contain multiple enclosures with the same URL. When the first of
these is not recognized as an image, later entries are not added to the
database as rows in ttrss_enclosures. This change differentiates enclosures
based on their content type, so an entry can have multiple enclosure types with
the same URL (but possibly a different content type).
-rwxr-xr-x | classes/rssutils.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/rssutils.php b/classes/rssutils.php index b69bb25a0..b1c88ed9c 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -1074,7 +1074,7 @@ class RSSUtils { } $esth = $pdo->prepare("SELECT id FROM ttrss_enclosures - WHERE content_url = ? AND post_id = ?"); + WHERE content_url = ? AND content_type = ? AND post_id = ?"); $usth = $pdo->prepare("INSERT INTO ttrss_enclosures (content_url, content_type, title, duration, post_id, width, height) VALUES @@ -1088,7 +1088,7 @@ class RSSUtils { $enc_width = intval($enc[4]); $enc_height = intval($enc[5]); - $esth->execute([$enc_url, $entry_ref_id]); + $esth->execute([$enc_url, $enc_type, $entry_ref_id]); if (!$esth->fetch()) { $usth->execute([$enc_url, $enc_type, (string)$enc_title, $enc_dur, $entry_ref_id, $enc_width, $enc_height]); |