perf(architecture): Big performance improvements over big databases and files highlight in search. (#63)

Reduction database space over 50%. Change database version to v7.

BREAKING CHANGE: databases v6 and v7 are incompatible and need a lot of time for updating (may be even some days/a lot of hours on very big databases)
This commit is contained in:
Alexey Kasyanchuk
2018-11-11 23:44:10 +03:00
committed by GitHub
parent 13ca63b954
commit 6afe85798a
11 changed files with 271 additions and 111 deletions

View File

@ -320,7 +320,17 @@ export default class Torrent extends Component {
torrent.path && torrent.path.length > 0
?
torrent.path.map((path, index) => {
return <div key={index} className='break-word fs0-75' style={{paddingTop: '0.3em', marginLeft: '0.6em'}}>{path}</div>
const boldRe = /\<b\>(.+?)\<\/b\>/g;
let boldText;
let newPath = [];
let idx = 0;
while ((boldText = boldRe.exec(path)) !== null) {
newPath.push(<span>{path.substring(idx, boldText.index)}</span>);
newPath.push(<b>{boldText[1]}</b>);
idx = boldRe.lastIndex;
}
newPath.push(<span>{path.substring(idx, path.length)}</span>);
return <div key={index} className='break-word fs0-75' style={{paddingTop: '0.3em', marginLeft: '0.6em'}}>{newPath}</div>
})
:
null