X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/aab3653045a8d628ed3c5979e70d0c62e9477b22..5f3db867cdab89e934f4946c58568039b780defe:/src/youtube/models.py diff --git a/src/youtube/models.py b/src/youtube/models.py index 32d5f04..35899b6 100644 --- a/src/youtube/models.py +++ b/src/youtube/models.py @@ -1,6 +1,5 @@ import io from os import unlink -from tempfile import NamedTemporaryFile from django.db import models from django.utils.translation import gettext_lazy as _ from django.template import Template, Context @@ -244,7 +243,7 @@ class ThumbnailTemplate(models.Model): { "author": ', '.join((a['name'] for a in audiobook.book['authors'])), "title": title, - "part": (audiobook.youtube_volume or audiobook.part_name).strip(), + "part": (audiobook.youtube_volume or audiobook.part_name).strip() if audiobook.youtube_volume_count > 1 else '', }, lambda name: Font.objects.get(name=name).truetype.path )