Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
User avatar
rednoah
Posts: 84
Joined: Tue Mar 11, 2008 10:02 pm

QueryParameters and QueryNumber are broken

Wed Apr 30, 2014 6:21 am

Hi OSS,

The QueryParameter and QueryNumber in the result XML seem to be broken. If you submit multiple queries in one go, they will always reference the last query, not the actual query for that result.

Request:
http://pastebin.com/6axtk507

Response:
http://pastebin.com/eiRLCMXR

It took me quite a while to see this. But if you look closely you'll notice that some of the results don't make sense.

For example this is the result for Query[1] but the QueryParameters and QueryNumber are from Query[2]. Notice how the moviefilesize and moviehash don't match.

Code: Select all

<struct> <member> <name>MatchedBy</name> <value> <string>moviehash</string> </value> </member> <member> <name>MovieHash</name> <value> <string>ff95d0d3b507ee3a</string> </value> </member> <member> <name>MovieByteSize</name> <value> <string>253632126</string> </value> </member> <member> <name>QueryParameters</name> <value> <struct> <member> <name>moviebytesize</name> <value> <string>455039528</string> </value> </member> <member> <name>sublanguageid</name> <value> <string>eng</string> </value> </member> <member> <name>moviehash</name> <value> <string>0670a5383400f366</string> </value> </member> </struct> </value> </member> <member> <name>QueryNumber</name> <value> <string>2</string> </value> </member> </struct>
This issue won't affect clients that only send 1 query per 1 request. But it'll give everybody else headaches and really weird results that don't make sense. ;)

PS: btw how many queries per request do you recommend? 1? 10? 100?

User avatar
oss
Site Admin
Posts: 5900
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: QueryParameters and QueryNumber are broken

Sat May 17, 2014 3:38 pm

Hi,

I check this issue, and you are right. Basically this function was meaned for fulltext search, not for hash search, so maybe I will just not put those information for matched by hash, because thats obvious. You might ask why it is - it is simple, checking by hash is done in 1 select...where moviehash in (...) so...

It is hard to recommend how many queries per request, depends, if you are using hashes, and if you specify the language. Important here is to mention output is limited for 200 results, so if you are in this limit, you should be OK, lets say 10 queries per request is ok (searching by moviehash, sublanguageid is specified)

User avatar
eduo
Posts: 716
Joined: Sat Feb 10, 2007 1:40 am
Location: Information Technology
Contact: ICQ Website Yahoo Messenger

Re: QueryParameters and QueryNumber are broken

Tue May 20, 2014 11:48 am

Hi,

I check this issue, and you are right. Basically this function was meaned for fulltext search, not for hash search, so maybe I will just not put those information for matched by hash, because thats obvious. You might ask why it is - it is simple, checking by hash is done in 1 select...where moviehash in (...) so...

It is hard to recommend how many queries per request, depends, if you are using hashes, and if you specify the language. Important here is to mention output is limited for 200 results, so if you are in this limit, you should be OK, lets say 10 queries per request is ok (searching by moviehash, sublanguageid is specified)
I noticed this "bug" a long time ago. I believe I might have posted about it here. I believe it exists since the search terms were expanded. At this stage in SolEol I have decided to do single queries by method and language, because of this.

And enhancement for a SearchSubtitles2 query would be do allow fallback searches, in order:

Try searching by moviehash, if not then by IMDB linked to moviehash (the same one you'd get in CheckMovieHash2), if not then name by movie name, with season/episode obtained from name, if not then fulltext.

This is what I'm doing anyway in SolEol. It would save me four searches in some cases. Also being able to limit results to "top" IMDBs when searching by moviehash, since in some cases I'm getting a dozen different movie results, all wrong.

Moving the new API to JSON would save also at least half of the traffic (and would be welcome by a lot of developers). But I understand this is probably a major undertaking.
http://eduo.info/
[url=http://eduo.info/soleol/]OpenSubtitles from your desktop: SolEol for Mac/Windows/Linux[/url]
[url=http://forums.plexapp.com/index.php?showtopic=325&st=0&p=2480&#entry2480]My current episode processing work flow[/url].

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 4 guests