Skip to content

Commit

Permalink
Merge pull request #368 from VeliovGroup/dev
Browse files Browse the repository at this point in the history
v1.7.12
  • Loading branch information
dr-dimitru authored Mar 1, 2017
2 parents 25c7123 + 3002eeb commit c51c186
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 47 deletions.
78 changes: 39 additions & 39 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
[email protected]
babel-compiler@6.9.0
[email protected].10
[email protected].9
[email protected].9
babel-compiler@6.14.1
babel-runtime@1.0.1
[email protected].10
[email protected].10
[email protected]
[email protected]
[email protected].9
[email protected].6
[email protected].9
[email protected].3
coffeescript@1.2.3
[email protected].11
[email protected].9
[email protected].10
[email protected].4
coffeescript@1.11.1_3
[email protected]
ddp-client@1.2.9
[email protected].6
ddp-server@1.2.10
ddp-client@1.3.3
[email protected].8
ddp-server@1.3.13
[email protected]
[email protected].6
ecmascript@0.5.7
[email protected].12
[email protected].12
[email protected].9
[email protected].7
ecmascript@0.6.3
[email protected].15
[email protected].13
[email protected].10
[email protected]
[email protected]
[email protected].8
[email protected].8
[email protected].9
[email protected].14
meteor@1.2.16
[email protected].17
[email protected].5
[email protected].5
[email protected].10
[email protected].5
npm-mongo@1.5.45
[email protected].12
[email protected].8
[email protected].11
[email protected].9
[email protected].10
[email protected].17
meteor@1.6.1
[email protected].20
[email protected].9
[email protected].9
[email protected].15
[email protected].6
npm-mongo@2.2.16_1
[email protected].15
[email protected].9
ostrio:[email protected]
ostrio:[email protected].11
[email protected].3
ostrio:[email protected].12
[email protected].8
[email protected]
[email protected].10
[email protected].8
[email protected].11
[email protected].11
[email protected].9
[email protected].12
[email protected]
[email protected]
[email protected].0
[email protected].2
[email protected]
[email protected].9
url@1.0.10
[email protected].10
[email protected].10
url@1.1.0
[email protected].13
[email protected]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ All PRs is always welcome on [`dev` branch](https://github.com/VeliovGroup/Meteo

Awards:
========
<a href="https://themeteorchef.com/blog/giant-cotton-apron-awards-show"><img src="https://s3.amazonaws.com/tmc-post-content/gcaa-2016-winner-badge.svg"></a>
<a href="https://themeteorchef.com/blog/giant-cotton-apron-awards-show"><img src="https://raw.githubusercontent.com/VeliovGroup/Meteor-Files-Demos/master/GCAA.png"></a>


Demo application:
Expand Down
27 changes: 21 additions & 6 deletions files.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@ class FilesCollection
return

if Accounts?
Meteor.startup ->
setTokenCookie()
return
Accounts.onLogin ->
setTokenCookie()
return
Expand Down Expand Up @@ -1090,6 +1093,7 @@ class FilesCollection
self = @
result.type = @_getMimeType opts.file
result.public = @public
@_updateFileTypes result

@collection.insert _.clone(result), (error, _id) ->
if error
Expand Down Expand Up @@ -1216,6 +1220,22 @@ class FilesCollection
else
return { ext: '', extension: '', extensionWithDot: '' }

###
@locus Anywhere
@memberOf FilesCollection
@name _updateFileTypes
@param {Object} data - File data
@summary Internal method. Classify file based on 'type' field
###
_updateFileTypes: (data) ->
data.isVideo = /^video\//i.test data.type
data.isAudio = /^audio\//i.test data.type
data.isImage = /^image\//i.test data.type
data.isText = /^text\//i.test data.type
data.isJSON = /^application\/json$/i.test data.type
data.isPDF = /^application\/(x-)?pdf$/i.test data.type
return

###
@locus Anywhere
@memberOf FilesCollection
Expand All @@ -1239,14 +1259,9 @@ class FilesCollection
size: data.size
type: data.type
extension: data.extension
isVideo: /^video\//i.test data.type
isAudio: /^audio\//i.test data.type
isImage: /^image\//i.test data.type
isText: /^text\//i.test data.type
isJSON: /application\/json/i.test data.type
isPDF: /application\/pdf|application\/x-pdf/i.test data.type
_downloadRoute: data._downloadRoute or @downloadRoute
_collectionName: data._collectionName or @collectionName
@_updateFileTypes ds
ds._storagePath = data._storagePath or @storagePath(_.extend(data, ds))
return ds

Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'ostrio:files',
version: '1.7.11',
version: '1.7.12',
summary: 'Upload files via DDP, HTTP and WebRTC/DC. To server FS, AWS, GridFS, DropBox or Google Drive.',
git: 'https://github.com/VeliovGroup/Meteor-Files',
documentation: 'README.md'
Expand Down

0 comments on commit c51c186

Please sign in to comment.