diff --git a/mediagoblin/gmg_commands/import_export.py b/mediagoblin/gmg_commands/import_export.py index eda41f4c..7f699429 100644 --- a/mediagoblin/gmg_commands/import_export.py +++ b/mediagoblin/gmg_commands/import_export.py @@ -65,7 +65,7 @@ def _import_media(db, args): args._cache_path['queue']) for entry in db.MediaEntry.find(): - for name, path in entry['media_files'].items(): + for name, path in entry.media_files.items(): _log.info('Importing: {0} - {1}'.format( entry.title, name)) @@ -207,7 +207,7 @@ def _export_media(db, args): args._cache_path['queue']) for entry in db.MediaEntry.find(): - for name, path in entry['media_files'].items(): + for name, path in entry.media_files.items(): _log.info(u'Exporting {0} - {1}'.format( entry.title, name)) diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index 7d261226..c260cfd6 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -74,7 +74,7 @@ def process_video(entry): tmp_dst.read()) _log.debug('Saved medium') - entry['media_files']['webm_640'] = medium_filepath + entry.media_files['webm_640'] = medium_filepath # Save the width and height of the transcoded video entry.media_data['video'] = { @@ -94,7 +94,7 @@ def process_video(entry): tmp_thumb.read()) _log.debug('Saved thumbnail') - entry['media_files']['thumb'] = thumbnail_filepath + entry.media_files['thumb'] = thumbnail_filepath if video_config['keep_original']: # Push original file to public storage @@ -111,7 +111,7 @@ def process_video(entry): original_file.write(queued_file.read()) _log.debug('Saved original') - entry['media_files']['original'] = original_filepath + entry.media_files['original'] = original_filepath mgg.queue_store.delete_file(queued_filepath) diff --git a/mediagoblin/templates/mediagoblin/edit/attachments.html b/mediagoblin/templates/mediagoblin/edit/attachments.html index 124d0313..06062cd3 100644 --- a/mediagoblin/templates/mediagoblin/edit/attachments.html +++ b/mediagoblin/templates/mediagoblin/edit/attachments.html @@ -27,7 +27,7 @@
+ media.media_files['original']) }}">
{%- trans -%}
Original
{%- endtrans -%}
diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html
index fc08f963..6b5e7a0e 100644
--- a/mediagoblin/templates/mediagoblin/media_displays/video.html
+++ b/mediagoblin/templates/mediagoblin/media_displays/video.html
@@ -27,7 +27,7 @@
preload="auto"
data-setup="">
+ media.media_files['original']) }}">
{%- trans -%}
Original
{%- endtrans -%}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index ca650f63..d52f544f 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -36,9 +36,9 @@
{# if there's a medium file size, that means the medium size
# isn't the original... so link to the original!
#}
- {% if media['media_files'].has_key('medium') %}
+ {% if media.media_files.has_key('medium') %}
+ media.media_files['original']) }}">
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
index 6c483769..408bca05 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
@@ -34,7 +34,7 @@
+ media.media_files['thumb']) }}" />
diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html
index b8155f03..5f628dc7 100644
--- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html
+++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html
@@ -31,7 +31,7 @@
{%- elif loop.last %} thumb_entry_last{% endif %}">
+ entry.media_files['thumb']) }}" />
{% if entry.title %}
diff --git a/mediagoblin/tools/files.py b/mediagoblin/tools/files.py
index e0bf0569..10f1d994 100644
--- a/mediagoblin/tools/files.py
+++ b/mediagoblin/tools/files.py
@@ -23,7 +23,7 @@ def delete_media_files(media):
Arguments:
- media: A MediaEntry document
"""
- for listpath in media['media_files'].itervalues():
+ for listpath in media.media_files.itervalues():
mg_globals.public_store.delete_file(
listpath)