forked from xotab30/CinemaPress-ACMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d60135
commit 77595af
Showing
2 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
|
||
var CP_save = require('../../lib/CP_save.min'); | ||
var CP_get = require('../../lib/CP_get.min'); | ||
|
||
/** | ||
* Node dependencies. | ||
*/ | ||
|
||
var async = require('async'); | ||
|
||
(function upd(i) { | ||
|
||
i = i || 1; | ||
var ii = i+1; | ||
|
||
if (i >= 300) { | ||
return; | ||
} | ||
|
||
CP_get.movies( | ||
{"certainly": true}, | ||
10000, | ||
'', | ||
i, | ||
false, | ||
function (err, movies) { | ||
if (err) { | ||
console.log(err); | ||
return; | ||
} | ||
|
||
if (movies && movies.length) { | ||
async.eachOfLimit(movies, 1, function (movie, key, callback) { | ||
delete movie.year; | ||
delete movie.premiere; | ||
delete movie.kp_rating; | ||
delete movie.kp_vote; | ||
delete movie.imdb_rating; | ||
delete movie.imdb_vote; | ||
movie.id = movie.kp_id; | ||
CP_save.save( | ||
movie, | ||
'rt', | ||
function (err, result) { | ||
return callback(err); | ||
}); | ||
}, function (err) { | ||
console.log(err); | ||
upd(ii); | ||
}); | ||
} | ||
}); | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters