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))
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))
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'] = {
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
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)
<h1>Editing attachments for {{ media.title }}</h1>
<div style="text-align: center;" >
<img src="{{ request.app.public_store.file_url(
- media['media_files']['thumb']) }}" />
+ media.media_files['thumb']) }}" />
</div>
{% if media.attachment_files|count %}
<h1>{% trans media_title=media.title %}Editing {{ media_title }}{% endtrans %}</h1>
<div style="text-align: center;" >
<img src="{{ request.app.public_store.file_url(
- media['media_files']['thumb']) }}" />
+ media.media_files['thumb']) }}" />
</div>
{{ wtforms_util.render_divs(form) }}
<div class="form_submit_buttons">
<pre>
{%- autoescape False -%}
{{- request.app.public_store.get_file(
- media['media_files']['unicode']).read()|string -}}
+ media.media_files['unicode']).read()|string -}}
{%- endautoescape -%}
</pre>
</div>
{% if 'original' in media.media_files %}
<p>
<a href="{{ request.app.public_store.file_url(
- media['media_files']['original']) }}">
+ media.media_files['original']) }}">
{%- trans -%}
Original
{%- endtrans -%}
preload="auto"
data-setup="">
<source src="{{ request.app.public_store.file_url(
- media['media_files']['webm_640']) }}"
+ media.media_files['webm_640']) }}"
type="video/webm; codecs="vp8, vorbis"" />
<div class="no_html5">
{%- trans -%}Sorry, this video will not work because
{% if 'original' in media.media_files %}
<p>
<a href="{{ request.app.public_store.file_url(
- media['media_files']['original']) }}">
+ media.media_files['original']) }}">
{%- trans -%}
Original
{%- endtrans -%}
{# 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') %}
<a href="{{ request.app.public_store.file_url(
- media['media_files']['original']) }}">
+ media.media_files['original']) }}">
<img class="media_image"
src="{{ display_media }}"
alt="Image for {{ media.title }}" />
<div style="text-align: center;" >
<img src="{{ request.app.public_store.file_url(
- media['media_files']['thumb']) }}" />
+ media.media_files['thumb']) }}" />
</div>
<br />
{%- elif loop.last %} thumb_entry_last{% endif %}">
<a href="{{ entry_url }}">
<img src="{{ request.app.public_store.file_url(
- entry['media_files']['thumb']) }}" />
+ entry.media_files['thumb']) }}" />
</a>
{% if entry.title %}
<br />
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)