mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-08 10:43:58 +02:00
feat(torrents): replace other pt site prefix when upload
This commit is contained in:
2
config/env/torrents.js
vendored
2
config/env/torrents.js
vendored
@@ -1160,7 +1160,7 @@ module.exports = {
|
||||
* @resourcesLanguage: settings for language of dropdown resource info
|
||||
*/
|
||||
tmdbConfig: {
|
||||
key: '7888f0042a366f63289ff571b68b7ce0',
|
||||
key: 'this is access key from tmdb',
|
||||
tmdbHome: 'https://www.themoviedb.org',
|
||||
tmdbMovieLinkUrl: 'https://www.themoviedb.org/movie/',
|
||||
tmdbTvserialLinkUrl: 'https://www.themoviedb.org/tv/',
|
||||
|
||||
@@ -58,6 +58,9 @@ module.exports.createUploadFilename = function (req, file, cb) {
|
||||
fs.unlinkSync(config.uploads.torrent.file.temp + filename);
|
||||
}
|
||||
|
||||
//replace other pt site prefix
|
||||
filename = filename.replace(/^\{([^}]+)\}[\.\s]|^\{([^}]+)\}/, '');
|
||||
|
||||
if (fs.existsSync(config.uploads.torrent.file.dest + filename)) {
|
||||
var err = new Error();
|
||||
err.code = 'FILE_ALREADY_EXISTS';
|
||||
@@ -94,6 +97,9 @@ module.exports.createUploadAttachFilename = function (req, file, cb) {
|
||||
fs.unlinkSync(config.uploads.attach.file.temp + filename);
|
||||
}
|
||||
|
||||
//replace other pt site prefix
|
||||
filename = filename.replace(/^\{([^}]+)\}[\.\s]|^\{([^}]+)\}/, '');
|
||||
|
||||
if (fs.existsSync(config.uploads.attach.file.dest + filename)) {
|
||||
var ext = file.originalname.replace(/^.+\./, '');
|
||||
var regex = new RegExp(ext, 'g');
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
"multer-s3": "^2.7.0",
|
||||
"node-sass": "^4.5.3",
|
||||
"nodemailer": "~4.0.1",
|
||||
"nt": "^0.5.3",
|
||||
"nt": "^0.5.4",
|
||||
"owasp-password-strength-test": "~1.3.0",
|
||||
"passport": "~0.3.2",
|
||||
"passport-facebook": "~2.1.1",
|
||||
|
||||
Reference in New Issue
Block a user