mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-11-24 17:24:43 +01:00
Add admin action to generate missing encodings for a particular Media (#883)
* Add admin action to generate missing encodings for a particular Media * Only regenerate the encodings that are missing
This commit is contained in:
parent
4829adf110
commit
e7ce9ef5c0
@ -40,6 +40,12 @@ class MediaAdmin(admin.ModelAdmin):
|
||||
def get_comments_count(self, obj):
|
||||
return obj.comments.count()
|
||||
|
||||
@admin.action(description="Generate missing encoding(s)", permissions=["change"])
|
||||
def generate_missing_encodings(modeladmin, request, queryset):
|
||||
for m in queryset:
|
||||
m.encode(force=False)
|
||||
|
||||
actions = [generate_missing_encodings]
|
||||
get_comments_count.short_description = "Comments count"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user