From 6e25960bb5bc592f59b4bdcf3fcaec435a367182 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 22 May 2020 11:09:56 +0200 Subject: [PATCH 1/1] Remove BUILD_PATH, that's what TMPDIR is for. --- src/archive/settings.py | 7 ------- src/archive/tasks.py | 7 ++----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/archive/settings.py b/src/archive/settings.py index 3e6f96f..91921a8 100644 --- a/src/archive/settings.py +++ b/src/archive/settings.py @@ -36,13 +36,6 @@ except AttributeError: "archive/final")) -# here the app keeps temporary build files -try: - BUILD_PATH = settings.ARCHIVE_BUILD_PATH -except AttributeError: - BUILD_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT, - "archive/build")) - UPLOAD_URL = getattr( settings, 'ARCHIVE_UPLOAD_URL', diff --git a/src/archive/tasks.py b/src/archive/tasks.py index 45ae9c1..4b8f5fe 100644 --- a/src/archive/tasks.py +++ b/src/archive/tasks.py @@ -18,7 +18,7 @@ from mutagen import id3 from apiclient import api_call from archive.constants import status from archive.models import Audiobook -from archive.settings import BUILD_PATH, COVER_IMAGE, UPLOAD_URL +from archive.settings import COVER_IMAGE, UPLOAD_URL from archive.utils import ExistingFile @@ -93,10 +93,7 @@ class AudioFormatTask(Task): user = User.objects.get(id=uid) - if not os.path.exists(BUILD_PATH): - os.makedirs(BUILD_PATH) - - out_file = NamedTemporaryFile(delete=False, prefix='%d-' % aid, suffix='.%s' % self.ext, dir=BUILD_PATH) + out_file = NamedTemporaryFile(delete=False, prefix='%d-' % aid, suffix='.%s' % self.ext) out_file.close() self.encode(audiobook.source_file.path, out_file.name) self.set_status(aid, status.TAGGING) -- 2.20.1