From 362c70774f35bdac242fb26c2c5e3594293e1d0c Mon Sep 17 00:00:00 2001 From: APTX Date: Thu, 12 Jan 2012 20:41:41 +0100 Subject: [PATCH] Obtain lid from FILE_ALREADY_IN_MYLIST. --- mylistaddcommand.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mylistaddcommand.cpp b/mylistaddcommand.cpp index 34ef9bd..cd15b63 100644 --- a/mylistaddcommand.cpp +++ b/mylistaddcommand.cpp @@ -212,9 +212,16 @@ void MyListAddReply::setRawReply(ReplyCode replyCode, const QString &reply) } break; case MYLIST_ENTRY_EDITED: - case FILE_ALREADY_IN_MYLIST: signalReplyReady(true); break; + case FILE_ALREADY_IN_MYLIST: + { + // Apparently the lid is sent back with some other data, but it is not mentioned in the docs. + QStringList data = reply.mid(reply.indexOf('\n')).trimmed().split(QChar('|')); + if (data.count() > 1) + m_lid = data[0].toInt(); + signalReplyReady(true); + } case NO_SUCH_MYLIST_ENTRY: case NO_SUCH_FILE: case NO_SUCH_ANIME: -- 2.52.0