in atomresponder/vs_mixin.py [0:0]
def create_placeholder_for_atomid(atomid, filename, project_id, title="unknown video", user="unknown_user"):
"""
Creates a placeholder and returns a VSItem object for it
:param atomid: atom ID string
:param filename: path of the file to import
:param project_id: ID number of the project that the video is associated with
:param title: title of the new video
:return: VSItem object
"""
item = VSItem(url=settings.VIDISPINE_URL,user=settings.VIDISPINE_USERNAME,passwd=settings.VIDISPINE_PASSWORD)
basemeta = {
const.GNM_ASSET_CATEGORY: "Deliverable",
const.GNM_ASSET_ORIGINAL_FILENAME: filename,
const.GNM_ASSET_OWNER: user,
const.GNM_ASSET_FILE_CREATED: datetime.datetime.now().isoformat("T")
}
if project_id is not None:
basemeta[const.GNM_ASSET_CONTAINING_PROJECTS] = [project_id]
builder = item.get_metadata_builder()
builder.addMeta({'title': title})
builder.addGroup(const.GROUP_GNM_ASSET, basemeta)
# the 'deliverables' group requires deliverable bundle ID to be present in order to be valid,
# but we don't know what that is here (it's assigned in pluto-deliverables)
# Once pluto-deliverables has assigned these IDs, it adds them to the Vidispine record.
mdbytes:bytes = builder.as_xml("UTF-8")
item.createPlaceholder(mdbytes.decode("UTF-8"))
item.add_external_id(atomid)
return item