File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ var flushExpired = function(){
79
79
80
80
var removeFiles = [ ] ;
81
81
_ . each ( fileList , function ( file ) {
82
- if ( Date . now ( ) - ( file . added + ( c . expireTime * 1000 ) ) > 0 ) {
82
+ if ( Date . now ( ) - ( file . added + ( file . expireTime * 1000 ) ) > 0 ) {
83
83
84
84
if ( c . debug )
85
85
Ti . API . info ( 'TIC - found expired file, removing' ) ;
@@ -105,7 +105,7 @@ var removeFile = function(filename){
105
105
return false ;
106
106
}
107
107
108
- var path = Ti . Filesystem . applicationDataDirectory + c . folder ;
108
+ var path = Ti . Filesystem . applicationDataDirectory + file . folder ;
109
109
var f = Ti . Filesystem . getFile ( path , file . filename ) ;
110
110
111
111
if ( ! f . exists ( ) ) {
@@ -159,7 +159,9 @@ var storeFile = function(filename, blob){
159
159
fileList . push ( {
160
160
filename : filename ,
161
161
added : Date . now ( ) ,
162
- fileSize : blob . length
162
+ fileSize : blob . length ,
163
+ expireTime : c . expireTime ,
164
+ folder : c . folder
163
165
} ) ;
164
166
165
167
// add file to collection
@@ -176,7 +178,9 @@ var readFile = function(filename){
176
178
if ( c . debug ) {
177
179
Ti . API . info ( 'TIC - reading file from system ' + filename ) ;
178
180
}
179
- var path = Ti . Filesystem . applicationDataDirectory + c . folder ;
181
+ var file = hasFile ( filename ) ;
182
+
183
+ var path = Ti . Filesystem . applicationDataDirectory + file . folder ;
180
184
var file = Ti . Filesystem . getFile ( path , filename ) ;
181
185
return file . read ( ) ;
182
186
} ;
You can’t perform that action at this time.
0 commit comments