From 00fc136df8d3bb6790253b72d3b72117bfee6c5f Mon Sep 17 00:00:00 2001 From: Chad Birch Date: Tue, 12 May 2015 15:11:17 -0600 Subject: [PATCH] new_media_embed: only send message with object Previously this amqp message was being sent whenever a thumbnail was attached as well, which added a lot more items to automoderator_q than was necessary, we only want to re-process things with an actual media object, not just a thumbnail. --- r2/r2/lib/media.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/r2/r2/lib/media.py b/r2/r2/lib/media.py index 73740b72f..3bbc8851f 100644 --- a/r2/r2/lib/media.py +++ b/r2/r2/lib/media.py @@ -346,7 +346,9 @@ def _set_media(link, force=False, **kwargs): link._commit() hooks.get_hook("scraper.set_media").call(link=link) - amqp.add_item("new_media_embed", link._fullname) + + if media.media_object or media.secure_media_object: + amqp.add_item("new_media_embed", link._fullname) def force_thumbnail(link, image_data, file_type=".jpg"):