From a65ffb4b6901e26f0f472222e80c463d5a9d60f9 Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Fri, 13 Jul 2018 19:05:38 +0200 Subject: [PATCH] Fix saving original of the video Original of the video was not saved because info about it was not written to the database. Fixed that. Also removed original video from get_all_media listing. The method is weird, we should evaluate whether it is video-specific and how to generalize it. --- mediagoblin/db/mixin.py | 4 ++-- mediagoblin/media_types/video/processing.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py index 090f9699..a6965bf4 100644 --- a/mediagoblin/db/mixin.py +++ b/mediagoblin/db/mixin.py @@ -251,7 +251,7 @@ class MediaEntryMixin(GenerateSlugMixin, GeneratePublicIDMixin): def get_all_media(self): """ - Returns all available qualties of a media + Returns all available qualties of a media (except original) """ fetch_order = self.media_manager.media_fetch_order @@ -264,7 +264,7 @@ class MediaEntryMixin(GenerateSlugMixin, GeneratePublicIDMixin): all_media_path = [] for media_size in fetch_order: - if media_size in media_sizes: + if media_size in media_sizes and media_size != 'original': file_metadata = self.get_file_metadata(media_size) size = file_metadata['medium_size'] if media_size != 'webm_video': diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index 79d356cc..890ac688 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -267,6 +267,7 @@ class CommonVideoProcessor(MediaProcessor): copy_original( self.entry, self.process_filename, self.name_builder.fill('{basename}{ext}')) + self.entry.save() def keep_best(self): -- 2.25.1