Page 1 of 1

API responding too well to already uploaded sub

Posted: Wed Jun 15, 2016 9:11 pm
by vankasteelj
Hello,

If I upload a subtitle that is already in the database, by passing only an imdb id (no moviebytesize or hash), the API response status is 200 and it sends the link to that subtitle, as if I uploaded it myself.

I would expect it to send back "alreadyindb = 1" but in this case, it doesn't.

Subtitle I tried to upload: http://www.opensubtitles.org/pt/subtitl ... ite-son-pt

Re: API responding too well to already uploaded sub

Posted: Thu Jun 16, 2016 4:21 am
by oss
to repeat the steps:
1. you went to some URL, and download that subtitles
2. you upload it using API without moviehash and moviesize and it will send NEW URL, or OLD (1) ?

Re: API responding too well to already uploaded sub

Posted: Thu Jun 16, 2016 8:36 am
by vankasteelj
it sends old url, but without saying it was already uploaded, it behaves like if it was a successful new upload

Re: API responding too well to already uploaded sub

Posted: Thu Jun 16, 2016 9:05 am
by oss
if possible, write me here expected result. I didnt want to allow upload without moviehash, but well...

Re: API responding too well to already uploaded sub

Posted: Thu Jun 16, 2016 5:51 pm
by vankasteelj
I would have expected something like:

Code: Select all

{ data: 'http://opensubtitles.org/download/v/src/blah', alreadyindb: 1 seconds: 0.122 status: '200 OK' }
It currently doesn't return "alreadyindb", for some reason. It acts like if the subtitle was uploaded, but it wasnt.

Here's how I understand the response:
response.data = url to uploaded subtitle
response.seconds = time the server took to send response back
response.status = the request did hit the server and was well formed

It's missing response.alreadyindb = boolean to know if subtitle was already present or not.

Re: API responding too well to already uploaded sub

Posted: Fri Jun 17, 2016 7:50 am
by oss
ok, I added also in UploadSubtitles() response 'alreadyindb' - where is always 0 or 1...so now you can check.