#4781 HIGH Update.: Video and Audio files from Record don't show up on clipboard correctly

Zarro Boogs per Child bugtracker at laptop.org
Sat Jan 12 13:35:21 EST 2008


#4781: Video and Audio files from Record don't show up on clipboard correctly
------------------------------+---------------------------------------------
  Reporter:  AlexL            |       Owner:  tomeu   
      Type:  defect           |      Status:  new     
  Priority:  high             |   Milestone:  Update.1
 Component:  camera-activity  |     Version:          
Resolution:                   |    Keywords:  review? 
  Verified:  0                |    Blocking:          
 Blockedby:                   |  
------------------------------+---------------------------------------------

Comment(by tomeu):

 What is happening here is that gnomevfs and xdgmime are returning
 'audio-x-vorbis+ogg' for the audio clippings and 'video-x-theora+ogg' for
 the video clippings.

 We are not considering those types are Video nor Audio types, just the
 following:

 {{{
 { 'id'    : 'Audio',
   'name'  : _('Audio'),
   'icon'  : 'audio-x-generic',
   'types' : ['audio/ogg', 'audio/x-wav', 'audio/wav']
 },
 { 'id'    : 'Video',
   'name'  : _('Video'),
   'icon'  : 'video-x-generic',
   'types' : ['video/ogg', 'application/ogg']
 },
 }}}

 The following patch would allow us to categorize a clipping not only by
 its concrete mime type, but also by its parents:

 {{{
 diff --git a/src/sugar/mime.py b/src/sugar/mime.py
 index fd79ad8..636313d 100644
 --- a/src/sugar/mime.py
 +++ b/src/sugar/mime.py
 @@ -220,7 +220,11 @@ def _file_looks_like_text(file_name):
      return False

  def _get_generic_type_for_mime(mime_type):
 -    for generic_type in _generic_types:
 -        if mime_type in generic_type['types']:
 -            return generic_type
 +    mime_types = [mime_type]
 +    mime_types.extend(get_mime_parents(mime_type))
 +    for mime_type in mime_types:
 +        for generic_type in _generic_types:
 +            if mime_type in generic_type['types']:
 +                return generic_type
      return None
 }}}

 But this approach doesn't work in this case because the parent of
 'audio-x-vorbis+ogg' and 'video-x-theora+ogg' is 'application/ogg', which
 in our case would give a Video label and icon to both of these types.

 So, I think that for Update.1 we should add 'audio-x-vorbis+ogg' and
 'video-x-theora+ogg' to the mappings for Audio and Video respectively, and
 for update.2 add the above patch to _get_generic_type_for_mime().

-- 
Ticket URL: <http://dev.laptop.org/ticket/4781#comment:12>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list