Opened 3 years ago

Last modified 3 days ago

#5564 review defect

Show unprocessed media in processing panel

Reported by: ayleph Owned by:
Priority: major Milestone: 0.13.0
Component: programming Keywords:
Cc: Parent Tickets:


Media with the state 'unprocessed' don't appear in the user or moderation processing panels. I'm splitting this off from #5491 as its own separate issue.


Change History (8)

comment:1 Changed 3 years ago by ayleph

Owner: set to ayleph
Status: newin_progress

comment:2 Changed 3 years ago by ayleph

I've done a quick implementation of showing unprocessed media on the moderation processing panel. Something similar could probably be done for the user processing panel. I'm considering trying to combine the 'unprocessed' media into the 'failed' media section, but I haven't decided if that makes sense.

--- a/mediagoblin/moderation/
+++ b/mediagoblin/moderation/
@@ -39,6 +39,10 @@ def moderation_media_processing_panel(request):
     failed_entries = MediaEntry.query.filter_by(state = u'failed').\
+    # Get media entries which are unprocessed
+    unprocessed_entries = MediaEntry.query.filter_by(state = u'unprocessed').\
+        order_by(MediaEntry.created.desc())
     processed_entries = MediaEntry.query.filter_by(state = u'processed').\
@@ -48,6 +52,7 @@ def moderation_media_processing_panel(request):
         {'processing_entries': processing_entries,
          'failed_entries': failed_entries,
+         'unprocessed_entries': unprocessed_entries,
          'processed_entries': processed_entries})
--- a/mediagoblin/templates/mediagoblin/moderation/media_panel.html
+++ b/mediagoblin/templates/mediagoblin/moderation/media_panel.html
@@ -101,9 +101,42 @@
 {% else %}
   <p><em>{% trans %}No failed entries!{% endtrans %}</em></p>
 {% endif %}
+<h2>{% trans %}These uploads are unprocessed:{% endtrans %}</h2>
+{% if unprocessed_entries.count() %}
+  <table class="media_panel failed">
+    <tr>
+      <th>{% trans %}ID{% endtrans %}</th>
+      <th>{% trans %}User{% endtrans %}</th>
+      <th>{% trans %}Title{% endtrans %}</th>
+      <th>{% trans %}When submitted{% endtrans %}</th>
+      <th>{% trans %}Reason for failure{% endtrans %}</th>
+      <th>{% trans %}Failure metadata{% endtrans %}</th>
+    </tr>
+    {% for media_entry in unprocessed_entries %}
+      <tr>
+        <td>{{ }}</td>
+        <td>{{ media_entry.get_actor.username }}</td>
+        <td>{{ media_entry.title }}</td>
+        <td>{{ media_entry.created.strftime("%F %R") }}</td>
+        {% if media_entry.get_fail_exception() %}
+        <td>{{ media_entry.get_fail_exception().general_message }}</td>
+        <td>{{ media_entry.fail_metadata }}</td>
+        {% else %}
+        <td>&nbsp;</td>
+        <td>&nbsp;</td>
+        {% endif %}
+      </tr>
+    {% endfor %}
+  </table>
+{% else %}
+  <p><em>{% trans %}No unprocessed entries!{% endtrans %}</em></p>
+{% endif %}
 <h2>{% trans %}Last 10 successful uploads{% endtrans %}</h2>
 {% if processed_entries.count() %}
   <table class="media_panel processed">

comment:3 Changed 3 years ago by ShawnRisk

Owner: ayleph deleted
Status: in_progressreview

This should really be in a patch, yet I am putting this in review.

comment:4 Changed 2 years ago by Ben Sturmfels

Hi Ayleph,

This makes a lot of sense to me. Any chance you could attach a patch file for this please? See eg. git format-patch --stdout <remote>/master > issue_<number>.patch


comment:5 Changed 17 months ago by Ben Sturmfels

When this is fixed, #644 can probably be closed too.

comment:6 Changed 17 months ago by Ben Sturmfels

Also when fixed, #176 and making uploads redirect to the processing panel would be a good next step.

comment:7 Changed 16 months ago by Ben Sturmfels

Should we also show the number of unprocessed in the top bar of all pages?

comment:8 Changed 3 days ago by Ben Sturmfels

Milestone: 0.13.0
Note: See TracTickets for help on using tickets.