]> git.parisson.com Git - telemeta.git/commitdiff
add update_marker json-rpc method
authoryomguy <yomguy@parisson.com>
Wed, 9 Feb 2011 12:58:38 +0000 (13:58 +0100)
committeryomguy <yomguy@parisson.com>
Wed, 9 Feb 2011 12:58:38 +0000 (13:58 +0100)
telemeta/web/base.py

index 62cfbf59b1a97c0e34a1b569b4b255596e4fd6d0..da1ee8dced393f06a349e8f721e3e5142a083889 100644 (file)
@@ -614,4 +614,13 @@ class WebView(object):
             list.append(dict)
         return list
 
-    
+    @jsonrpc_method('telemeta.update_marker')
+    def update_marker(request, marker):
+        if isinstance(marker, dict):
+            m = MediaItemMarker.objects.get(public_id=marker['public_id'])
+            m.time = float(marker['time'])
+            m.description = marker['description']
+            m.save()
+        else:
+            raise 'Error : Bad marker dictionnary'
+