From 5f1145a41fda0fda66c4660d2e354c49ee6b84c7 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Thu, 8 Feb 2018 14:30:36 +0000 Subject: [PATCH] workloads/exoplayer: Prepend file format to downloaded filepath Always prepend the format for the file into the downloaded filepath to ensure matching is correctly performed. Previously the ogg file did not specify this causing it to be re-downloaded for each run. --- wa/workloads/exoplayer/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wa/workloads/exoplayer/__init__.py b/wa/workloads/exoplayer/__init__.py index 9a35e9ba..eb5609e5 100644 --- a/wa/workloads/exoplayer/__init__.py +++ b/wa/workloads/exoplayer/__init__.py @@ -133,7 +133,8 @@ class ExoPlayer(ApkWorkload): if not files: # Download a file with the requested format url = DOWNLOAD_URLS[self.format] - filepath = os.path.join(self.video_directory, os.path.basename(url)) + filename = '{}_{}'.format(format_resolution, os.path.basename(url)) + filepath = os.path.join(self.video_directory, filename) self.logger.info('Downloading {} to {}...'.format(url, filepath)) urllib.urlretrieve(url, filepath) return filepath