Skip to content

Instantly share code, notes, and snippets.

@mrvdb
Last active December 28, 2015 21:09
Show Gist options
  • Save mrvdb/7562759 to your computer and use it in GitHub Desktop.
Save mrvdb/7562759 to your computer and use it in GitHub Desktop.
diff --git a/mediagoblin/plugins/api/views.py b/mediagoblin/plugins/api/views.py
index 69fae7b..e239f7e 100644
--- a/mediagoblin/plugins/api/views.py
+++ b/mediagoblin/plugins/api/views.py
@@ -111,6 +111,11 @@ def get_entries(request):
# TODO: Make it possible to fetch unprocessed media, or media in-processing
entries = entries.filter_by(state=u'processed')
+ # allow getting one entry
+ m_id = int(request.GET.get('id') or 0)
+ if m_id:
+ entries = entries.filter_by(id=m_id)
+
# TODO: Add sort order customization
entries = entries.order_by(request.db.MediaEntry.created.desc())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment