prepare for REST public API: one args format for recive()
This commit is contained in:
parent
9d17fd28d1
commit
56746cb9d7
@ -214,7 +214,7 @@ class App extends Component {
|
|||||||
reader.readAsArrayBuffer(file);
|
reader.readAsArrayBuffer(file);
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
torrentSocket.emit('dropTorrents', files);
|
torrentSocket.emit('dropTorrents', {pathTorrents: files});
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('dragover', (event) => {
|
document.addEventListener('dragover', (event) => {
|
||||||
|
@ -30,7 +30,7 @@ export default class ConfigPage extends Page {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
saveSettings() {
|
saveSettings() {
|
||||||
window.torrentSocket.emit('setConfig', this.options)
|
window.torrentSocket.emit('setConfig', {options: this.options})
|
||||||
this.settingsSavedMessage = true
|
this.settingsSavedMessage = true
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -12,7 +12,7 @@ export default (props) => {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}} menu={[
|
}} menu={[
|
||||||
{name: __('Download'), click: () => {
|
{name: __('Download'), click: () => {
|
||||||
window.torrentSocket.emit('download', props.torrent, null, (added) => {
|
window.torrentSocket.emit('download', {torrent: props.torrent, savePath: null}, (added) => {
|
||||||
if(props.onAdded)
|
if(props.onAdded)
|
||||||
props.onAdded(added)
|
props.onAdded(added)
|
||||||
})
|
})
|
||||||
@ -65,7 +65,7 @@ export default (props) => {
|
|||||||
{
|
{
|
||||||
path = testPath;
|
path = testPath;
|
||||||
}
|
}
|
||||||
window.torrentSocket.emit('download', props.torrent, path[0], (added) => {
|
window.torrentSocket.emit('download', {torrent: props.torrent, savePath: path[0]}, (added) => {
|
||||||
if(props.onAdded)
|
if(props.onAdded)
|
||||||
props.onAdded(added)
|
props.onAdded(added)
|
||||||
})
|
})
|
||||||
|
@ -28,7 +28,7 @@ export default class RecentTorrents extends AutoScrollable {
|
|||||||
this.loadMoreFeed();
|
this.loadMoreFeed();
|
||||||
}
|
}
|
||||||
loadMoreFeed() {
|
loadMoreFeed() {
|
||||||
window.torrentSocket.emit('feed', this.torrents.length, window.customLoader((data) => {
|
window.torrentSocket.emit('feed', {index: this.torrents.length}, window.customLoader((data) => {
|
||||||
if(data) {
|
if(data) {
|
||||||
this.torrents = this.torrents.concat(data);
|
this.torrents = this.torrents.concat(data);
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
|
@ -73,7 +73,7 @@ export default class ConfigPage extends Page {
|
|||||||
else
|
else
|
||||||
this.options.filters.contentType = this.contentType
|
this.options.filters.contentType = this.contentType
|
||||||
|
|
||||||
window.torrentSocket.emit('setConfig', this.options)
|
window.torrentSocket.emit('setConfig', {options: this.options})
|
||||||
this.settingsSavedMessage = true
|
this.settingsSavedMessage = true
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -266,7 +266,7 @@ export default class ConfigPage extends Page {
|
|||||||
<RaisedButton label={__('Check torrents')} primary={true} onClick={() => {
|
<RaisedButton label={__('Check torrents')} primary={true} onClick={() => {
|
||||||
this.toRemoveProbably = null
|
this.toRemoveProbably = null
|
||||||
this.toRemove = null
|
this.toRemove = null
|
||||||
window.torrentSocket.emit('removeTorrents', true, window.customLoader((toRemove) => {
|
window.torrentSocket.emit('removeTorrents', {checkOnly: true}, window.customLoader((toRemove) => {
|
||||||
this.toRemoveProbably = toRemove
|
this.toRemoveProbably = toRemove
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}));
|
}));
|
||||||
@ -274,7 +274,7 @@ export default class ConfigPage extends Page {
|
|||||||
<RaisedButton label={__('Clean torrents')} secondary={true} onClick={() => {
|
<RaisedButton label={__('Clean torrents')} secondary={true} onClick={() => {
|
||||||
this.toRemoveProbably = null
|
this.toRemoveProbably = null
|
||||||
this.toRemove = null
|
this.toRemove = null
|
||||||
window.torrentSocket.emit('removeTorrents', false, window.customLoader((toRemove) => {
|
window.torrentSocket.emit('removeTorrents', {checkOnly: false}, window.customLoader((toRemove) => {
|
||||||
this.toRemove = toRemove
|
this.toRemove = toRemove
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}));
|
}));
|
||||||
|
@ -71,7 +71,7 @@ class Header extends React.Component {
|
|||||||
if(savePath) {
|
if(savePath) {
|
||||||
fs.writeFileSync(savePath, torrent)
|
fs.writeFileSync(savePath, torrent)
|
||||||
console.log('saved', torrent.length, 'to', savePath)
|
console.log('saved', torrent.length, 'to', savePath)
|
||||||
torrentSocket.emit('dropTorrents', [{path: savePath}]);
|
torrentSocket.emit('dropTorrents', {pathTorrents: [{path: savePath}]});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -60,7 +60,7 @@ class Search extends Component {
|
|||||||
if(this.state.advancedSearch && this.advanced)
|
if(this.state.advancedSearch && this.advanced)
|
||||||
searchTorrentsParams = Object.assign(searchTorrentsParams, this.advanced);
|
searchTorrentsParams = Object.assign(searchTorrentsParams, this.advanced);
|
||||||
|
|
||||||
this.searchTorrentId = window.torrentSocket.emit('searchTorrent', oldSearch ? this.currentSearch : this.searchValue, searchTorrentsParams, window.customLoader((torrents) => {
|
this.searchTorrentId = window.torrentSocket.emit('searchTorrent', {text: oldSearch ? this.currentSearch : this.searchValue, navigation: searchTorrentsParams}, window.customLoader((torrents) => {
|
||||||
if(torrents) {
|
if(torrents) {
|
||||||
this.searchTorrents = torrents;
|
this.searchTorrents = torrents;
|
||||||
if(torrents.length != this.searchLimit)
|
if(torrents.length != this.searchLimit)
|
||||||
@ -86,7 +86,7 @@ class Search extends Component {
|
|||||||
if(this.state.advancedSearch && this.advanced)
|
if(this.state.advancedSearch && this.advanced)
|
||||||
searchFilesParams = Object.assign(searchFilesParams, this.advanced);
|
searchFilesParams = Object.assign(searchFilesParams, this.advanced);
|
||||||
|
|
||||||
this.searchFilesId = window.torrentSocket.emit('searchFiles', oldSearch ? this.currentSearch : this.searchValue, searchFilesParams, window.customLoader((torrents) => {
|
this.searchFilesId = window.torrentSocket.emit('searchFiles', {text: oldSearch ? this.currentSearch : this.searchValue, navigation: searchFilesParams}, window.customLoader((torrents) => {
|
||||||
if(torrents) {
|
if(torrents) {
|
||||||
this.searchFiles = torrents;
|
this.searchFiles = torrents;
|
||||||
let files = 0;
|
let files = 0;
|
||||||
@ -113,13 +113,13 @@ class Search extends Component {
|
|||||||
this.setState({moreTorrentsIndicator: true});
|
this.setState({moreTorrentsIndicator: true});
|
||||||
this.onSearchUpdate('indicator')
|
this.onSearchUpdate('indicator')
|
||||||
|
|
||||||
this.searchTorrentId = window.torrentSocket.emit('searchTorrent', this.currentSearch, {
|
this.searchTorrentId = window.torrentSocket.emit('searchTorrent', {text: this.currentSearch, navigation: {
|
||||||
index: this.searchTorrents.length,
|
index: this.searchTorrents.length,
|
||||||
limit: this.searchLimit,
|
limit: this.searchLimit,
|
||||||
safeSearch: !this.notSafeSearch,
|
safeSearch: !this.notSafeSearch,
|
||||||
orderBy: this.state.orderBy,
|
orderBy: this.state.orderBy,
|
||||||
orderDesc: this.state.orderDesc,
|
orderDesc: this.state.orderDesc,
|
||||||
}, window.customLoader((torrents) => {
|
}}, window.customLoader((torrents) => {
|
||||||
if(torrents) {
|
if(torrents) {
|
||||||
this.searchTorrents = this.searchTorrents.concat(torrents);
|
this.searchTorrents = this.searchTorrents.concat(torrents);
|
||||||
if(torrents.length != this.searchLimit)
|
if(torrents.length != this.searchLimit)
|
||||||
@ -149,13 +149,13 @@ class Search extends Component {
|
|||||||
this.setState({moreFilesIndicator: true});
|
this.setState({moreFilesIndicator: true});
|
||||||
this.onSearchUpdate('indicator')
|
this.onSearchUpdate('indicator')
|
||||||
|
|
||||||
this.searchFilesId = window.torrentSocket.emit('searchFiles', this.currentSearch, {
|
this.searchFilesId = window.torrentSocket.emit('searchFiles', {text: this.currentSearch, navigation: {
|
||||||
index: index,
|
index: index,
|
||||||
limit: this.searchLimit,
|
limit: this.searchLimit,
|
||||||
safeSearch: !this.notSafeSearch,
|
safeSearch: !this.notSafeSearch,
|
||||||
orderBy: this.state.orderBy,
|
orderBy: this.state.orderBy,
|
||||||
orderDesc: this.state.orderDesc,
|
orderDesc: this.state.orderDesc,
|
||||||
}, window.customLoader((torrents) => {
|
}}, window.customLoader((torrents) => {
|
||||||
if(torrents) {
|
if(torrents) {
|
||||||
this.searchFiles = this.searchFiles.concat(torrents);
|
this.searchFiles = this.searchFiles.concat(torrents);
|
||||||
|
|
||||||
|
@ -39,9 +39,10 @@ export default class TopPage extends Page {
|
|||||||
this.firstUpdate = false
|
this.firstUpdate = false
|
||||||
time = time ? time : this.state.time
|
time = time ? time : this.state.time
|
||||||
const page = (this.topTorrents[type] && this.topTorrents[type][time] && this.topTorrents[type][time].page) || 0
|
const page = (this.topTorrents[type] && this.topTorrents[type][time] && this.topTorrents[type][time].page) || 0
|
||||||
window.torrentSocket.emit('topTorrents',
|
window.torrentSocket.emit('topTorrents', {
|
||||||
type == 'main' ? null : type,
|
type: (type == 'main' ? null : type),
|
||||||
{index: page * 20, limit: 20, time},
|
navigation: {index: page * 20, limit: 20, time}
|
||||||
|
},
|
||||||
window.customLoader((torrents) => {
|
window.customLoader((torrents) => {
|
||||||
this.mergeTorrents(torrents, type, time)
|
this.mergeTorrents(torrents, type, time)
|
||||||
this.topTorrents[type][time].page = page + 1
|
this.topTorrents[type][time].page = page + 1
|
||||||
|
@ -114,7 +114,7 @@ const treeToTorrentFiles = (tree, torrent, toggles) => {
|
|||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
let toggleValues = {}
|
let toggleValues = {}
|
||||||
newToggles.forEach(({downloadIndex}) => toggleValues[downloadIndex] = checked)
|
newToggles.forEach(({downloadIndex}) => toggleValues[downloadIndex] = checked)
|
||||||
window.torrentSocket.emit('downloadSelectFiles', torrent, toggleValues)
|
window.torrentSocket.emit('downloadSelectFiles', {hash: torrent.hash, files: toggleValues})
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
:
|
:
|
||||||
@ -258,7 +258,7 @@ export default class TorrentPage extends Page {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
getTorrentInfo() {
|
getTorrentInfo() {
|
||||||
window.torrentSocket.emit('torrent', this.props.hash, {files: true, peer: this.props.peer}, window.customLoader((data) => {
|
window.torrentSocket.emit('torrent', {hash: this.props.hash, options: {files: true, peer: this.props.peer}}, window.customLoader((data) => {
|
||||||
if(data) {
|
if(data) {
|
||||||
this.torrent = data
|
this.torrent = data
|
||||||
this.setTitle(this.torrent.name + ' - Rats On The Boat');
|
this.setTitle(this.torrent.name + ' - Rats On The Boat');
|
||||||
@ -270,7 +270,7 @@ export default class TorrentPage extends Page {
|
|||||||
|
|
||||||
// Получаем более новую статистику пира
|
// Получаем более новую статистику пира
|
||||||
if((Date.now() / 1000) - this.torrent.trackersChecked > 10 * 60) {
|
if((Date.now() / 1000) - this.torrent.trackersChecked > 10 * 60) {
|
||||||
window.torrentSocket.emit('checkTrackers', this.torrent.hash);
|
window.torrentSocket.emit('checkTrackers', {hash: this.torrent.hash});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, () => {
|
}, () => {
|
||||||
@ -391,7 +391,7 @@ export default class TorrentPage extends Page {
|
|||||||
this.setState({
|
this.setState({
|
||||||
voting: true
|
voting: true
|
||||||
});
|
});
|
||||||
window.torrentSocket.emit('vote', this.torrent.hash, !!good, window.customLoader((success) => {
|
window.torrentSocket.emit('vote', {hash: this.torrent.hash, isGood: !!good}, window.customLoader((success) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
voted: true,
|
voted: true,
|
||||||
voting: false
|
voting: false
|
||||||
@ -531,7 +531,7 @@ export default class TorrentPage extends Page {
|
|||||||
/>
|
/>
|
||||||
<FlatButton
|
<FlatButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
window.torrentSocket.emit('downloadCancel', this.torrent.hash)
|
window.torrentSocket.emit('downloadCancel', {hash: this.torrent.hash})
|
||||||
}}
|
}}
|
||||||
label={__('Cancel download')}
|
label={__('Cancel download')}
|
||||||
secondary={true}
|
secondary={true}
|
||||||
|
@ -416,7 +416,7 @@ export default class Torrent extends Component {
|
|||||||
}} onClick={(e) => {
|
}} onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
window.torrentSocket.emit('downloadUpdate', torrent.hash, {pause: 'switch'})
|
window.torrentSocket.emit('downloadUpdate', {hash: torrent.hash, options: {pause: 'switch'}})
|
||||||
}} viewBox="0 0 438.536 438.536">
|
}} viewBox="0 0 438.536 438.536">
|
||||||
<g>
|
<g>
|
||||||
<path d="M164.453,0H18.276C13.324,0,9.041,1.807,5.425,5.424C1.808,9.04,0.001,13.322,0.001,18.271v401.991
|
<path d="M164.453,0H18.276C13.324,0,9.041,1.807,5.425,5.424C1.808,9.04,0.001,13.322,0.001,18.271v401.991
|
||||||
@ -443,7 +443,7 @@ export default class Torrent extends Component {
|
|||||||
}} onClick={(e) => {
|
}} onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
window.torrentSocket.emit('downloadUpdate', torrent.hash, {removeOnDone: 'switch'})
|
window.torrentSocket.emit('downloadUpdate', {hash: torrent.hash, options: {removeOnDone: 'switch'}})
|
||||||
}} viewBox="0 0 512 512">
|
}} viewBox="0 0 512 512">
|
||||||
<g>
|
<g>
|
||||||
<path d="M456.313,85.333h-55.527C386.809,36.16,341.594,0,288,0s-98.809,36.16-112.785,85.333h-69.441l-3.482-11.938
|
<path d="M456.313,85.333h-55.527C386.809,36.16,341.594,0,288,0s-98.809,36.16-112.785,85.333h-69.441l-3.482-11.938
|
||||||
@ -515,7 +515,7 @@ export default class Torrent extends Component {
|
|||||||
<div className="overlay-loader" onClick={(e) => {
|
<div className="overlay-loader" onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
window.torrentSocket.emit('downloadCancel', torrent.hash)
|
window.torrentSocket.emit('downloadCancel', {hash: torrent.hash})
|
||||||
}}>
|
}}>
|
||||||
<div className="loader">
|
<div className="loader">
|
||||||
<div></div>
|
<div></div>
|
||||||
@ -541,7 +541,7 @@ export default class Torrent extends Component {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
window.torrentSocket.emit('downloadCancel', torrent.hash)
|
window.torrentSocket.emit('downloadCancel', {hash: torrent.hash})
|
||||||
}} viewBox="0 0 18 18"><path d="M9 1C4.58 1 1 4.58 1 9s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm4 10.87L11.87 13 9 10.13 6.13 13 5 11.87 7.87 9 5 6.13 6.13 5 9 7.87 11.87 5 13 6.13 10.13 9 13 11.87z"/></svg>
|
}} viewBox="0 0 18 18"><path d="M9 1C4.58 1 1 4.58 1 9s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm4 10.87L11.87 13 9 10.13 6.13 13 5 11.87 7.87 9 5 6.13 6.13 5 9 7.87 11.87 5 13 6.13 10.13 9 13 11.87z"/></svg>
|
||||||
</a>
|
</a>
|
||||||
</ToolTip>
|
</ToolTip>
|
||||||
@ -558,7 +558,7 @@ export default class Torrent extends Component {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
window.torrentSocket.emit('downloadCancel', torrent.hash)
|
window.torrentSocket.emit('downloadCancel', {hash: torrent.hash})
|
||||||
}} viewBox="0 0 18 18"><path d="M9 1C4.58 1 1 4.58 1 9s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm4 10.87L11.87 13 9 10.13 6.13 13 5 11.87 7.87 9 5 6.13 6.13 5 9 7.87 11.87 5 13 6.13 10.13 9 13 11.87z"/></svg>
|
}} viewBox="0 0 18 18"><path d="M9 1C4.58 1 1 4.58 1 9s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm4 10.87L11.87 13 9 10.13 6.13 13 5 11.87 7.87 9 5 6.13 6.13 5 9 7.87 11.87 5 13 6.13 10.13 9 13 11.87z"/></svg>
|
||||||
</a>
|
</a>
|
||||||
</ToolTip>
|
</ToolTip>
|
||||||
|
@ -125,7 +125,7 @@ module.exports = async ({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
const onTorrent = (hash, options, callback) => {
|
const onTorrent = ({hash, options}, callback) => {
|
||||||
if(hash.length != 40)
|
if(hash.length != 40)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ module.exports = async ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
recive('searchTorrent', mergeTorrentsWithDownloadsFn((text, navigation, callback, id) => {
|
recive('searchTorrent', mergeTorrentsWithDownloadsFn(({text, navigation}, callback, id) => {
|
||||||
searchTorrentCall(text, navigation, callback)
|
searchTorrentCall(text, navigation, callback)
|
||||||
p2p.emit('searchTorrent', {text, navigation}, (remote, socketObject) => {
|
p2p.emit('searchTorrent', {text, navigation}, (remote, socketObject) => {
|
||||||
logT('search', 'remote search results', remote && remote.length)
|
logT('search', 'remote search results', remote && remote.length)
|
||||||
@ -473,7 +473,7 @@ module.exports = async ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
recive('searchFiles', mergeTorrentsWithDownloadsFn((text, navigation, callback, id) => {
|
recive('searchFiles', mergeTorrentsWithDownloadsFn(({text, navigation}, callback, id) => {
|
||||||
searchFilesCall(text, navigation, callback)
|
searchFilesCall(text, navigation, callback)
|
||||||
p2p.emit('searchFiles', {text, navigation}, (remote, socketObject) => {
|
p2p.emit('searchFiles', {text, navigation}, (remote, socketObject) => {
|
||||||
logT('search', 'remote search files results', remote && remote.length)
|
logT('search', 'remote search files results', remote && remote.length)
|
||||||
@ -494,7 +494,7 @@ module.exports = async ({
|
|||||||
searchFilesCall(text, navigation, (data) => callback(data))
|
searchFilesCall(text, navigation, (data) => callback(data))
|
||||||
})
|
})
|
||||||
|
|
||||||
recive('checkTrackers', function(hash)
|
recive('checkTrackers', function({hash})
|
||||||
{
|
{
|
||||||
if(hash.length != 40)
|
if(hash.length != 40)
|
||||||
return;
|
return;
|
||||||
@ -550,7 +550,7 @@ module.exports = async ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
recive('topTorrents', mergeTorrentsWithDownloadsFn((type, navigation, callback) =>
|
recive('topTorrents', mergeTorrentsWithDownloadsFn(({type, navigation}, callback) =>
|
||||||
{
|
{
|
||||||
topTorrentsCall(type, navigation, callback)
|
topTorrentsCall(type, navigation, callback)
|
||||||
p2p.emit('topTorrents', {type, navigation}, (remote, socketObject) => {
|
p2p.emit('topTorrents', {type, navigation}, (remote, socketObject) => {
|
||||||
@ -596,7 +596,7 @@ module.exports = async ({
|
|||||||
callback(config)
|
callback(config)
|
||||||
});
|
});
|
||||||
|
|
||||||
recive('setConfig', (options, callback) =>
|
recive('setConfig', ({options}, callback) =>
|
||||||
{
|
{
|
||||||
if(typeof options !== 'object')
|
if(typeof options !== 'object')
|
||||||
return;
|
return;
|
||||||
@ -815,9 +815,9 @@ module.exports = async ({
|
|||||||
return torrent
|
return torrent
|
||||||
}
|
}
|
||||||
|
|
||||||
recive('download', torrentClient._add);
|
recive('download', ({torrent, savePath}, callback) => torrentClient._add(torrent, savePath, callback));
|
||||||
|
|
||||||
recive('downloadUpdate', (hash, options) =>
|
recive('downloadUpdate', ({hash, options}) =>
|
||||||
{
|
{
|
||||||
const id = torrentClientHashMap[hash]
|
const id = torrentClientHashMap[hash]
|
||||||
if(!id)
|
if(!id)
|
||||||
@ -852,7 +852,7 @@ module.exports = async ({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
recive('downloadCancel', (hash, callback) =>
|
recive('downloadCancel', ({hash}, callback) =>
|
||||||
{
|
{
|
||||||
const id = torrentClientHashMap[hash]
|
const id = torrentClientHashMap[hash]
|
||||||
if(!id)
|
if(!id)
|
||||||
@ -880,7 +880,7 @@ module.exports = async ({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
recive('downloadSelectFiles', ({hash}, files, callback) =>
|
recive('downloadSelectFiles', ({hash, files}, callback) =>
|
||||||
{
|
{
|
||||||
logT('downloader', 'call update selection', hash, files.length)
|
logT('downloader', 'call update selection', hash, files.length)
|
||||||
const id = torrentClientHashMap[hash]
|
const id = torrentClientHashMap[hash]
|
||||||
@ -920,7 +920,7 @@ module.exports = async ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
let removeProtect = false
|
let removeProtect = false
|
||||||
recive('removeTorrents', (checkOnly = true, callback) =>
|
recive('removeTorrents', ({checkOnly}, callback) =>
|
||||||
{
|
{
|
||||||
if(removeProtect)
|
if(removeProtect)
|
||||||
return
|
return
|
||||||
@ -981,7 +981,7 @@ module.exports = async ({
|
|||||||
return {good, bad, selfVote}
|
return {good, bad, selfVote}
|
||||||
}
|
}
|
||||||
|
|
||||||
recive('vote', async (hash, isGood, callback) =>
|
recive('vote', async ({hash, isGood}, callback) =>
|
||||||
{
|
{
|
||||||
if(hash.length != 40)
|
if(hash.length != 40)
|
||||||
return;
|
return;
|
||||||
@ -1060,7 +1060,7 @@ module.exports = async ({
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
const feedCall = (index, callback) =>
|
const feedCall = ({index}, callback) =>
|
||||||
{
|
{
|
||||||
callback(feed.feed.slice(index || 0, (index || 0) + 20));
|
callback(feed.feed.slice(index || 0, (index || 0) + 20));
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ let config = {
|
|||||||
peerId: undefined,
|
peerId: undefined,
|
||||||
language: 'en',
|
language: 'en',
|
||||||
trackers: true,
|
trackers: true,
|
||||||
|
restApi: false,
|
||||||
|
|
||||||
p2p: true,
|
p2p: true,
|
||||||
p2pConnections: 10,
|
p2pConnections: 10,
|
||||||
|
@ -803,7 +803,7 @@ module.exports = function (send, recive, dataDirectory, version, env, {version:
|
|||||||
client._download(peer, infoHash)
|
client._download(peer, infoHash)
|
||||||
}
|
}
|
||||||
|
|
||||||
recive('dropTorrents', (pathTorrents) => {
|
recive('dropTorrents', ({pathTorrents}) => {
|
||||||
logT('drop', 'drop torrents and replicate from original torrent files')
|
logT('drop', 'drop torrents and replicate from original torrent files')
|
||||||
const addTorrents = (torrents) => {
|
const addTorrents = (torrents) => {
|
||||||
torrents.map(({data, path}) => {
|
torrents.map(({data, path}) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user