fix(feed): fix check adding record on info table
This commit is contained in:
parent
fe33d2d400
commit
4dfd5cd15a
@ -51,10 +51,11 @@ const expand = (sphinx) => {
|
||||
continue;
|
||||
|
||||
if(typeof values[val] == 'object')
|
||||
values[val] = JSON.stringify(values[val])
|
||||
|
||||
valuesData += sphinx.escape(JSON.stringify(values[val])) + ',';
|
||||
else
|
||||
valuesData += sphinx.escape(values[val]) + ',';
|
||||
|
||||
names += '`' + val + '`,';
|
||||
valuesData += sphinx.escape(values[val]) + ',';
|
||||
}
|
||||
names = names.slice(0, -1)
|
||||
valuesData = valuesData.slice(0, -1)
|
||||
|
@ -414,6 +414,16 @@ module.exports = function (send, recive, dataDirectory, version, env)
|
||||
delete torrent.contenttype;
|
||||
}
|
||||
|
||||
if(torrent.info && typeof torrent.info == 'string')
|
||||
{
|
||||
try {
|
||||
torrent.info = JSON.parse(torrent.info)
|
||||
} catch(err) {
|
||||
logT('add', 'problem with info torrent parse for torrent', torrent.name, 'just ignore')
|
||||
delete torrent.info
|
||||
}
|
||||
}
|
||||
|
||||
// clean download info if added
|
||||
if(torrent.download)
|
||||
delete torrent.download
|
||||
@ -529,6 +539,7 @@ module.exports = function (send, recive, dataDirectory, version, env)
|
||||
piecelength: torrent.piecelength,
|
||||
contentType: torrent.contentType,
|
||||
contentCategory: torrent.contentCategory,
|
||||
info: torrent.info,
|
||||
});
|
||||
updateTorrentTrackers(torrent.hash);
|
||||
remoteTrackers.update(torrent)
|
||||
|
Loading…
Reference in New Issue
Block a user