]> git.parisson.com Git - telemeta.git/commitdiff
fix waveform grapher name change
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 3 Mar 2014 22:47:43 +0000 (23:47 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 3 Mar 2014 22:47:43 +0000 (23:47 +0100)
telemeta/views/item.py

index 8022e768c6cce66677cf301240ae522fbb316747..ef467e932c568911e587d5659134c129ac5c35ba 100644 (file)
@@ -443,7 +443,7 @@ class ItemView(object):
     def item_visualize(self, request, public_id, grapher_id, width, height):
         item = MediaItem.objects.get(public_id=public_id)
         mime_type = 'image/png'
-        grapher = self.get_grapher(grapher_id)                
+        grapher = self.get_grapher(grapher_id)
         
         if grapher.id() != grapher_id:
             raise Http404
@@ -451,6 +451,11 @@ class ItemView(object):
         size = width + '_' + height
         image_file = '.'.join([public_id, grapher_id, size, 'png'])
 
+        # FIX waveform grapher name change
+        old_image_file = '.'.join([public_id, 'waveform', size, 'png'])
+        if 'waveform_centroid' in grapher_id and self.cache_data.exists(old_image_file):
+            image_file = old_image_file
+
         if not self.cache_data.exists(image_file):
             source = item.get_source()
             if source: