File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ const copyToDestination = torrents => Promise.resolve(torrents)
59
59
. then ( runAll )
60
60
;
61
61
62
- const report = files => files . forEach ( file => console . log ( `Successfully extracted ${ path . basename ( file . destination ) } ` ) ) ;
62
+ const report = files => files . forEach ( file => console . log ( `${ file . skipped ? 'Skipped' : ' Successfully extracted' } => ${ path . basename ( file . destination ) } ` ) ) ;
63
63
64
64
const getSourceAndDestination = torrent => ( {
65
65
source : path . join ( torrent . folder , torrent . fileStats [ 0 ] . name ) ,
@@ -72,6 +72,9 @@ const notNull = value => !!value;
72
72
73
73
const fullyDownloaded = torrent => torrent . fileStats [ 0 ] . size === torrent . files [ 0 ] . length ;
74
74
75
- const copyFile = file => copy ( file . source , file . destination , { replace : true } ) . thenReturn ( file ) ;
75
+ const copyFile = file => copy ( file . source , file . destination , { replace : false } )
76
+ . thenReturn ( file )
77
+ . catch ( ( ) => _ . assign ( { skipped : true } , file ) )
78
+ ;
76
79
77
80
extractFilesFromCache ( ) ;
You can’t perform that action at this time.
0 commit comments