#include "requesthandler.h"
+#include "mylist.h"
#include "database.h"
#include <AniDBUdpClient/Client>
if (!success)
return;
+ db->transaction();
// If entry exists we get to update fields we know.
// Entry might exist just with my values and aid from vote command
Anime next = db->getAnime(reply->command().aid());
db->addAnime(next);
else
db->setAnime(next);
+ db->commit();
// my values obtained with VoteCommand
if (!success)
return;
+ db->transaction();
Episode next = db->getEpisode(reply->command().eid());
bool isNew = !next.eid;
db->addEpisode(next);
else
db->setEpisode(next);
+ db->commit();
// Obtain my values
VoteReply *voteReply = Client::instance()->send(VoteCommand(VoteCommand::AnimeVote, next.aid, VoteCommand::Retrieve, reply->epnoAsInt()));
if (!success)
return;
+ db->transaction();
// Fid might not be known in command
File next = db->getFile(reply->fid());
db->addRequest(request);
}
}
+ db->commit();
// File is not in mylist
if (!reply->lid())
MyListAddCommand cmd(next.fid);
cmd.setEd2k(reply->ed2k());
cmd.setSize(reply->size());
+ cmd.setViewed(MyList::instance()->settings()->get("myListDefaultViewed").toBool());
+ cmd.setState(State(MyList::instance()->settings()->get("myListDefaultState").toInt()));
+ cmd.setSource(MyList::instance()->settings()->get("myListDefaultSource").toString());
+ cmd.setStorage(MyList::instance()->settings()->get("myListDefaultStorage").toString());
+ cmd.setOther(MyList::instance()->settings()->get("myListDefaultOther").toString());
MyListAddReply *addReply = Client::instance()->send(cmd);
connect(addReply, SIGNAL(replyReady(bool)), this, SLOT(myListAddReplyRecieved(bool)));
return;