@@ -101,6 +101,42 @@ var ReleaseSchema = new Schema({
101101 url : {
102102 type : String ,
103103 default : ""
104+ } ,
105+
106+ /**
107+ * Size of the debug version compressed
108+ * @property {String } compressedSize
109+ */
110+ debugCompressedSize : {
111+ type : String ,
112+ default : "0"
113+ } ,
114+
115+ /**
116+ * Size of the debug version uncompressed
117+ * @property {String } compressedSize
118+ */
119+ debugUncompressedSize : {
120+ type : String ,
121+ default : "0"
122+ } ,
123+
124+ /**
125+ * Size of the game compressed
126+ * @property {String } compressedSize
127+ */
128+ releaseCompressedSize : {
129+ type : String ,
130+ default : "0"
131+ } ,
132+
133+ /**
134+ * Size of the game uncompressed
135+ * @property {String } compressedSize
136+ */
137+ releaseUncompressedSize : {
138+ type : String ,
139+ default : "0"
104140 } ,
105141
106142 /**
@@ -156,9 +192,9 @@ ReleaseSchema.statics.getByIdsAndStatus = function(ids, status, callback)
156192{
157193 return this . find (
158194 {
159- _id : { $in : ids } ,
195+ _id : { $in : ids } ,
160196 status : status
161- } ,
197+ } ,
162198 callback
163199 ) ;
164200} ;
@@ -173,7 +209,7 @@ ReleaseSchema.statics.getByIdsAndStatus = function(ids, status, callback)
173209 * @param {String } [options.token] The token for accessing non-prod releases
174210 * @param {String } [options.version] The current version
175211 * @param {String } [options.commitId] The git commit hash
176- * @param {Boolean } [options.multi=false] If we s
212+ * @param {Boolean } [options.multi=false] If we s
177213 * @param {function } callback
178214 * @return {Promise } Promise for async request
179215 */
@@ -188,7 +224,7 @@ ReleaseSchema.statics.getByGame = function(slug, options, callback)
188224 }
189225
190226 // Set the defaults
191- options = _ . extend ( {
227+ options = _ . extend ( {
192228 multi : false ,
193229 status : null ,
194230 token : null ,
@@ -200,12 +236,12 @@ ReleaseSchema.statics.getByGame = function(slug, options, callback)
200236
201237 function addUrl ( r )
202238 {
203- r . url = r . game . location + '/' +
239+ r . url = r . game . location + '/' +
204240 r . commitId + '/' +
205241 ( options . debug ? 'debug' : 'release' ) +
206242 ( options . archive ? '.zip' : '/index.html' ) ;
207243 }
208-
244+
209245 async . waterfall ( [
210246 function ( done )
211247 {
@@ -238,11 +274,11 @@ ReleaseSchema.statics.getByGame = function(slug, options, callback)
238274 done ( null , game , { status : { "$in" : statuses } } , requiresToken ) ;
239275 }
240276 // get all releases
241- else
277+ else
242278 {
243279 done ( null , game , null , true ) ;
244280 }
245- } ,
281+ } ,
246282 function ( game , query , requiresToken , done )
247283 {
248284 if ( requiresToken )
@@ -269,7 +305,7 @@ ReleaseSchema.statics.getByGame = function(slug, options, callback)
269305 select . sort ( '-created' ) ;
270306
271307 select
272- . select ( 'version url capabilities commitId game updated -_id' )
308+ . select ( 'version url capabilities commitId game updated debugCompressedSize debugUncompressedSize releaseCompressedSize releaseUncompressedSize -_id' )
273309 . populate ( 'game' , 'slug location title -_id' )
274310 . exec ( done ) ;
275311 } ] ,
@@ -308,8 +344,8 @@ ReleaseSchema.statics.removeById = function(id, callback)
308344 callback ( err ) ;
309345 }
310346 Game . update (
311- { releases : { $in : [ id ] } } ,
312- { $pull : { releases : id } } ,
347+ { releases : { $in : [ id ] } } ,
348+ { $pull : { releases : id } } ,
313349 callback
314350 ) ;
315351 } ) ;
0 commit comments