Ignore:
Timestamp:
24/06/2011 11:47:35 (3 years ago)
Author:
yomguy <yomguy@…>
Branches:
master, crem, crem2, dev, dev2, diadems, feature/breadcrumbs, feature/ts-0.5, feature/ts-0.5.4, feature/writecache, forma, generic, instru_search, lam, lam2, mapsv3, merge, nlivemulti, production, release/1.4.4, sabiod, security, server, social, storage, telecaster, test, video
Children:
a4d12ba
Parents:
305c6d0
git-author:
yomguy <yomguy@…> (24/06/2011 11:47:35)
git-committer:
yomguy <yomguy@…> (24/06/2011 11:47:35)
Message:

fix item public_access

File:
1 edited

Legend:

Unmodified
Added
Removed
  • telemeta/models/dublincore.py

    r305c6d0 r66bbeee  
    3434 
    3535from telemeta.models.core import Duration 
    36 from telemeta.models.media import MediaItem, MediaCollection 
     36from telemeta.models.media import MediaItem, MediaCollection, MediaItemAnalysis 
    3737from django.contrib.sites.models import Site 
    3838from django.conf import settings 
     
    178178        Element('format',           duration, 'extent'), 
    179179        Element('format',           collection.physical_format, 'medium'), 
    180         #FIXME: audio mime types are missing, 
    181180        parts 
    182181    ) 
     
    207206        if item.track: 
    208207            title += u' - ' + item.track 
     208     
     209    try: 
     210        analysis = MediaItemAnalysis(item=item, analyzer_id='mime_type') 
     211        mime_type = analysis.value 
     212    except: 
     213        mime_type = 'unknown' 
    209214 
    210215    resource = Resource( 
     
    226231        Element('rights',           item.collection.legal_rights, 'license'), 
    227232        Element('rights',           media_access_rights(item.collection), 'accessRights'), 
    228      
    229233        Element('format',           max(item.approx_duration, item.computed_duration()), 'extent'), 
    230234        Element('format',           item.collection.physical_format, 'medium'), 
    231         #FIXME: audio mime types are missing, 
     235        Element('format',           mime_type, 'MIME type'), 
    232236        Element('relation',         media_identifier(item.collection), 'isPartOf', item.collection) 
    233237    ) 
Note: See TracChangeset for help on using the changeset viewer.