upload form now actually uses some of the inputs other than 'title' and

'file'


git-svn-id: http://yolanda.mister-muffin.de/svn@401 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
erlehmann 2008-12-02 04:53:39 +00:00
parent 38b6352b84
commit 9fed815064

View file

@ -18,10 +18,13 @@ import logging
from yolanda.lib.base import * from yolanda.lib.base import *
from yolanda.lib.gstreamer import info, snapshot, encode from yolanda.lib.gstreamer import info, snapshot, encode
import os import os
import hashlib import hashlib
import threading import threading
from datetime import datetime, timedelta
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class UploadController(BaseController): class UploadController(BaseController):
@ -52,8 +55,48 @@ class UploadController(BaseController):
# } # }
# return render('/xhtml/upload.mako') # return render('/xhtml/upload.mako')
# TODO: set up safeguards against omitted / wrong data
# set up database entry # set up database entry
video = model.Video(title=request.params['title'],sha256=sha256) video = model.Video(
# Dublin Core terms
dc_title = request.params['title'],
dc_creator = request.params['creator'],
dc_subject = request.params['subject'],
dc_abstract = request.params['abstract'],
# TODO: enable several contributors
dc_contributor = '',
dc_created = '',
dc_valid = '',
dc_available = '',
dc_issued = '',
dc_modified = '',
dc_dateAccepted = '',
dc_dateCopyrighted = '',
dc_dateSubmitted = datetime.today().isoformat(),
dc_identifier = '',
dc_source = '',
dc_language = request.params['language'],
dc_extent = timedelta(0), # TODO: insert videolength
dc_spatial = request.params['spatial'],
dc_temporal = request.params['temporal'],
dc_rightsHolder = '',
# Creative Commons properties
cc_commercial = (request.params['commercial'] == 'commercial'),
cc_sharealike = (request.params['modification'] == 'sharealike'),
cc_derivatives = (request.params['modification'] != 'noderivatives'),
sha256=sha256
)
model.session.commit() model.session.commit()
# copy file to temporary destination # copy file to temporary destination