def onupload(self, upl):
session_id = upl['path']
# Start a session, if it seems to be a valid media file
# XXX: this list is arbitrary; use MIME or smth
if not session_id.split('.')[-1] in ['mp3', 'mp4', 'm4v', 'wav', 'aac', 'm4a', 'mkv', 'ogg', 'ogv', 'flac']:
return
self.db.onchange(None, {"type": "change",
"id": session_id,
"doc": {
"_id": session_id,
"type": "session",
"peer": upl['filename'],
"filename": upl['filename'],
"s_time": time.time(),
}})
reactor.callInThread(self._process_upload, upl, session_id)
评论列表
文章目录