How-To Unable to filter out audio/video from a FeedQuery

Treece

New Member
I'm trying to remove YouTube videos and podcasts from the "Latest" and "Unread" modules - they have their own modules for that - but every query I've tried either removes all feed items or none.

The presence of an enclosure seems to be the only way to tell what the feed item is, so I've focused on that.
- EnclosureLink IS NULL AND EnclosureType NOT LIKE '%video%'
- EnclosureType NOT IN ('video/mp4','audio/mpeg')
- EnclosureType NOT LIKE 'video%' AND EnclosureType NOT LIKE 'audio%'
- EnclosureType NOT LIKE '%video%' AND EnclosureType NOT LIKE '%audio%'
- EnclosureType IS NULL

These are some of the queries I've tried with no success. Either it includes all video and audio, or the module shows no results. Not new to SQL or coding, but I'm struggling here. The goal is just to keep articles, podcasts, and videos separated into their own modules. The video and podcast modules I've put together work as expected. I've looked over the database schema and see nothing else that would indicate the content is text, audio, or video than the enclosure.

Any ideas? Thanks for reading.
 

Treece

New Member
EnclosureLink IS NULL AND EnclosureType NOT LIKE '%video%'
I also tried checking for an EnclosureType of text/plain and application/xml and as expected, they didn't work. This first example from my original post seems like it should be it, but it's not working.

If I run just EnclosureLink IS NULL, I get all articles and the YouTube videos, but no podcasts. So, it's logical that checking the type against '%video%' would get the desired results. It doesn't. Returns "No item available..."

FYI articles, YT vids, and podcasts are each setup in their own Feed modules, with multiple source feeds loaded in each. If that matters.
 

Treece

New Member
SQL:
EnclosureLink IS NULL AND FeedId NOT IN (SELECT FeedId FROM Feed WHERE GUID = 'e04d4b3dffdd444285c217af33a271f2') AND IsDeleted = 0

That fixed it. Could probably also do it by getting all video and podcast GUIDs and putting in that array, but subqueries aren't the fastest and the NULL EnclosureLink check is removing the podcasts, so this is what I'll go with. In case anyone finds this useful.

This thread can be closed now.
 
Top