Filter out unprocessed media.

remotes/1726741609412457634/master
David Thompson 10 years ago
parent e3e1899c61
commit b1c32b8192
  1. 3
      mediagoblin_libreplanet/__init__.py
  2. 5
      mediagoblin_libreplanet/views.py

@ -41,7 +41,8 @@ def setup_plugin():
def lp_media_for_type(db, type):
return media_entries_for_tag_slug(db, LP_TAG).\
filter(MediaEntry.media_type == type).\
filter((MediaEntry.media_type == type)
& (MediaEntry.state == u'processed')).\
order_by(MediaEntry.created.desc()).\
limit(MAX_HOME_ITEMS)

@ -21,9 +21,10 @@ from mediagoblin.tools.pagination import Pagination
from mediagoblin.tools.response import render_to_response
from mediagoblin.decorators import uses_pagination
def type_listing(type, title, request, page):
def type_listing(media_type, title, request, page):
cursor = MediaEntry.query.\
filter(MediaEntry.media_type == type).\
filter((MediaEntry.media_type == media_type)
& (MediaEntry.state == u'processed')).\
order_by(MediaEntry.created.desc())
pagination = Pagination(page, cursor)

Loading…
Cancel
Save