mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-11 07:17:53 +00:00
recheckusertorrent rpc
This commit is contained in:
parent
bd65447806
commit
36da093939
@ -258,6 +258,7 @@ static const CRPCCommand vRPCCommands[] =
|
|||||||
{ "getnumpieces", &getnumpieces, false, true },
|
{ "getnumpieces", &getnumpieces, false, true },
|
||||||
{ "listusernamespartial", &listusernamespartial, false, true },
|
{ "listusernamespartial", &listusernamespartial, false, true },
|
||||||
{ "rescandirectmsgs", &rescandirectmsgs, false, true },
|
{ "rescandirectmsgs", &rescandirectmsgs, false, true },
|
||||||
|
{ "recheckusertorrent", &recheckusertorrent, false, true },
|
||||||
};
|
};
|
||||||
|
|
||||||
CRPCTable::CRPCTable()
|
CRPCTable::CRPCTable()
|
||||||
|
@ -210,5 +210,6 @@ extern json_spirit::Value getlasthave(const json_spirit::Array& params, bool fHe
|
|||||||
extern json_spirit::Value getnumpieces(const json_spirit::Array& params, bool fHelp);
|
extern json_spirit::Value getnumpieces(const json_spirit::Array& params, bool fHelp);
|
||||||
extern json_spirit::Value listusernamespartial(const json_spirit::Array& params, bool fHelp);
|
extern json_spirit::Value listusernamespartial(const json_spirit::Array& params, bool fHelp);
|
||||||
extern json_spirit::Value rescandirectmsgs(const json_spirit::Array& params, bool fHelp);
|
extern json_spirit::Value rescandirectmsgs(const json_spirit::Array& params, bool fHelp);
|
||||||
|
extern json_spirit::Value recheckusertorrent(const json_spirit::Array& params, bool fHelp);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1766,3 +1766,23 @@ Value rescandirectmsgs(const Array& params, bool fHelp)
|
|||||||
|
|
||||||
return Value();
|
return Value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Value recheckusertorrent(const Array& params, bool fHelp)
|
||||||
|
{
|
||||||
|
if (fHelp || (params.size() != 1))
|
||||||
|
throw runtime_error(
|
||||||
|
"recheckusertorrent <username>\n"
|
||||||
|
"recheck all posts in a given torrent. this may be useful if\n"
|
||||||
|
"post validation rules became stricter");
|
||||||
|
|
||||||
|
string localUser = params[0].get_str();
|
||||||
|
|
||||||
|
torrent_handle h = getTorrentUser(localUser);
|
||||||
|
if( h.is_valid() ){
|
||||||
|
h.force_recheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user