class AudiobookAdmin(admin.ModelAdmin):
- list_filter = ['license']
+ list_display = ["title", "slug", "index", "part_name", "license", "youtube_volume"]
+ list_filter = ["license"]
+ list_search = ["title", "slug", "part_name", "youtube_volume"]
+ list_editable = ["youtube_volume"]
admin.site.register(Audiobook, AudiobookAdmin)
parser.add_argument("--limit", type=int, default=6)
def handle(self, *args, **options):
- for audiobook in Audiobook.objects.exclude(youtube_queued=None).order_by(
- "youtube_queued"
- )[: options["limit"]]:
+ for audiobook in (
+ Audiobook.objects.filter(status=status.QUEUED)
+ .exclude(youtube_queued=None)
+ .order_by("youtube_queued")[: options["limit"]]
+ ):
audiobook.youtube_task = tasks.YouTubeTask.delay(
None, audiobook.id, True
).task_id