Changeset 170 for smplayer/trunk/src/findsubtitles/osclient.cpp
- Timestamp:
- Oct 9, 2014, 2:54:21 PM (11 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/findsubtitles/osclient.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 168
- Property svn:mergeinfo changed
-
smplayer/trunk/src/findsubtitles/osclient.cpp
r165 r170 20 20 #include "version.h" 21 21 22 OSClient::OSClient(QObject* parent) : QObject(parent), logged_in(false), search_size(0) { 22 OSClient::OSClient(QObject* parent) : 23 QObject(parent) 24 , logged_in(false) 25 , search_size(0) 26 #ifdef OS_SEARCH_WORKAROUND 27 , best_search_count(0) 28 #endif 29 { 23 30 rpc = new MaiaXmlRpcClient(QUrl("http://api.opensubtitles.org/xml-rpc"), this); 24 31 } … … 66 73 } 67 74 75 68 76 void OSClient::doSearch() { 77 78 79 80 81 82 83 84 69 85 qDebug("OSClient::doSearch"); 70 86 … … 74 90 m["moviebytesize"] = QString::number(search_size); 75 91 76 // For some reason it seems opensubtitles fails77 // sometimes if there's only one item in the list.78 // So as workaround, the item is appended twice.79 80 // Update: and the opposite, sometimes it doesn't return any81 // result with 2 items but it does with 1.82 // Workaround: use 3 items... Seems to work in all cases.83 92 QVariantList list; 93 94 95 96 97 98 99 84 100 list.append(m); 85 list.append(m); 86 list.append(m); 87 list.append(m); 88 //list.append(m); 89 list.append(m); // Adding more, sometimes it keeps failing... 101 #endif 90 102 91 103 QVariantList args; … … 148 160 QVariantList data = m["data"].toList(); 149 161 qDebug("OSClient::responseSearch: data count: %d", data.count()); 162 163 164 165 166 167 168 169 150 170 151 171 for (int n = 0; n < data.count(); n++) {
Note:
See TracChangeset
for help on using the changeset viewer.
