client/js/upload-data.js
function(spec) {
            var status = spec.status || qq.status.SUBMITTING,
                id = data.push({
                    name: spec.name,
                    originalName: spec.name,
                    uuid: spec.uuid,
                    size: spec.size == null ? -1 : spec.size,
                    status: status,
                    file: spec.file
                }) - 1;

            if (spec.batchId) {
                data[id].batchId = spec.batchId;

                if (byBatchId[spec.batchId] === undefined) {
                    byBatchId[spec.batchId] = [];
                }
                byBatchId[spec.batchId].push(id);
            }

            if (spec.proxyGroupId) {
                data[id].proxyGroupId = spec.proxyGroupId;

                if (byProxyGroupId[spec.proxyGroupId] === undefined) {
                    byProxyGroupId[spec.proxyGroupId] = [];
                }
                byProxyGroupId[spec.proxyGroupId].push(id);
            }

            data[id].id = id;
            byUuid[spec.uuid] = id;

            if (byStatus[status] === undefined) {
                byStatus[status] = [];
            }
            byStatus[status].push(id);

            spec.onBeforeStatusChange && spec.onBeforeStatusChange(id);
            uploaderProxy.onStatusChange(id, null, status);

            return id;
        }
function(spec) {
            var status = spec.status || qq.status.SUBMITTING,
                id = data.push({
                    name: spec.name,
                    originalName: spec.name,
                    uuid: spec.uuid,
                    size: spec.size == null ? -1 : spec.size,
                    status: status,
                    file: spec.file
                }) - 1;

            if (spec.batchId) {
                data[id].batchId = spec.batchId;

                if (byBatchId[spec.batchId] === undefined) {
                    byBatchId[spec.batchId] = [];
                }
                byBatchId[spec.batchId].push(id);
            }

            if (spec.proxyGroupId) {
                data[id].proxyGroupId = spec.proxyGroupId;

                if (byProxyGroupId[spec.proxyGroupId] === undefined) {
                    byProxyGroupId[spec.proxyGroupId] = [];
                }
                byProxyGroupId[spec.proxyGroupId].push(id);
            }

            data[id].id = id;
            byUuid[spec.uuid] = id;

            if (byStatus[status] === undefined) {
                byStatus[status] = [];
            }
            byStatus[status].push(id);

            spec.onBeforeStatusChange && spec.onBeforeStatusChange(id);
            uploaderProxy.onStatusChange(id, null, status);

            return id;
        }
function ( spec ) { var status = spec . status || qq . status . SUBMITTING , id = data . push ( { name : spec . name , originalName : spec . name , uuid : spec . uuid , size : spec . size == null ? - 1 : spec . size , status : status , file : spec . file } ) - 1 ; if ( spec . batchId ) { data [ id ] . batchId = spec . batchId ; if ( byBatchId [ spec . batchId ] === undefined ) { byBatchId [ spec . batchId ] = [ ] ; } byBatchId [ spec . batchId ] . push ( id ) ; } if ( spec . proxyGroupId ) { data [ id ] . proxyGroupId = spec . proxyGroupId ; if ( byProxyGroupId [ spec . proxyGroupId ] === undefined ) { byProxyGroupId [ spec . proxyGroupId ] = [ ] ; } byProxyGroupId [ spec . proxyGroupId ] . push ( id ) ; } data [ id ] . id = id ; byUuid [ spec . uuid ] = id ; if ( byStatus [ status ] === undefined ) { byStatus [ status ] = [ ] ; } byStatus [ status ] . push ( id ) ; spec . onBeforeStatusChange && spec . onBeforeStatusChange ( id ) ; uploaderProxy . onStatusChange ( id , null , status ) ; return id ; }
Adds a new file to the data cache for tracking purposes.

@param spec Data that describes this file.  Possible properties are:

- uuid: Initial UUID for this file.
- name: Initial name of this file.
- size: Size of this file, omit if this cannot be determined
- status: Initial `qq.status` for this file.  Omit for `qq.status.SUBMITTING`.
- batchId: ID of the batch this file belongs to
- proxyGroupId: ID of the proxy group associated with this file
- onBeforeStatusChange(fileId): callback that is executed before the status change is broadcast

@returns {number} Internal ID for this file.
Adds a new file to the data cache for tracking purposes .