From 3adc2e0dd418f8b3940b62e50279e4386f23de96 Mon Sep 17 00:00:00 2001
From: Ben Sturmfels <ben@sturm.com.au>
Date: Fri, 7 Oct 2016 23:12:25 +1100
Subject: [PATCH] Add thumbnail image to Atom feed.
---
mediagoblin/listings/views.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/mediagoblin/listings/views.py b/mediagoblin/listings/views.py
index f640cc9..0b8006d 100644
a
|
b
|
|
17 | 17 | from mediagoblin import mg_globals |
18 | 18 | from mediagoblin.db.models import MediaEntry |
19 | 19 | from mediagoblin.db.util import media_entries_for_tag_slug |
| 20 | from mediagoblin.decorators import uses_pagination |
| 21 | from mediagoblin.plugins.api.tools import get_media_file_paths |
20 | 22 | from mediagoblin.tools.pagination import Pagination |
21 | 23 | from mediagoblin.tools.response import render_to_response |
22 | | from mediagoblin.decorators import uses_pagination |
23 | 24 | |
24 | 25 | from werkzeug.contrib.atom import AtomFeed |
25 | 26 | |
… |
… |
def atom_feed(request):
|
102 | 103 | links=atomlinks) |
103 | 104 | |
104 | 105 | for entry in cursor: |
| 106 | # Include a thumbnail image in content. |
| 107 | file_urls = get_media_file_paths(entry.media_files, request.urlgen) |
| 108 | content = '<img src="{thumb}" alt='' /> {desc}'.format( |
| 109 | thumb=file_urls['thumb'], desc=entry.description_html) |
| 110 | |
105 | 111 | feed.add(entry.get('title'), |
106 | | entry.description_html, |
| 112 | content, |
107 | 113 | id=entry.url_for_self(request.urlgen,qualified=True), |
108 | 114 | content_type='html', |
109 | 115 | author={'name': entry.get_actor.username, |