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
oss
Site Admin
Posts: 5890
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

API: Smarter cache updates

Thu Oct 15, 2015 6:22 pm

Hi guys,

today I work on smarter cache updates.

Scenario before:

1) xml-rpc SearchSubtitles with moviehash, moviesize and sublanguageid
2) some results found or no results found, cached for 24 hours be default
3) (Try)UploadSubtitles() with given moviehash, moviesize, and sublanguageid
4) xml-rpc SearchSubtitles with moviehash, moviesize and sublanguageid => come from cache

Fixed now:
1) xml-rpc SearchSubtitles with moviehash, moviesize and sublanguageid
2) some results found or no results found, cached for 24 hours be default
3) (Try)UploadSubtitles() with given moviehash, moviesize, and sublanguageid, cache is expired
4) xml-rpc SearchSubtitles with moviehash, moviesize and sublanguageid => come from database and cached for 24 hours.

watdafox
Posts: 27
Joined: Fri Aug 07, 2015 3:13 am

Re: Smarter cache updates

Fri Oct 16, 2015 1:01 am

If I understand well, the cache is refreshed whenever anyone uploads a subtitle? That would be awesome, results indeed take a really long time to appear for newly released episodes

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

Re: Smarter cache updates

Fri Oct 16, 2015 3:53 pm

watdafox, exactly.

Got already good feedback about this, but not here :) It took couple of hours to sort this out, it is not absolutely perfect, but it is 99% better then before.

You can try.

watdafox
Posts: 27
Joined: Fri Aug 07, 2015 3:13 am

Re: API: Smarter cache updates

Fri Oct 16, 2015 9:41 pm

either it's not working, or it's because I don't send sublanguageid, I left the detection to you.

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

Re: API: Smarter cache updates

Fri Oct 16, 2015 9:56 pm

should work, even without sublanguageid.

send me please what are you sending (or some more info). It is not working with query/tag searching, but with others (moviehash/moviebytesize/imdb) it should work.

send some more info so I can duplicate the problem. thx

watdafox
Posts: 27
Joined: Fri Aug 07, 2015 3:13 am

Re: API: Smarter cache updates

Sat Oct 17, 2015 12:51 am

Step 1) I search subs:

Code: Select all

Object {imdbid: "tt1405406", season: "7", episode: "2"}
Returns 0 subtitles.

Step 2) I upload a subtitle:

Code: Select all

Object {subpath: "D:\The Vampire Diaries - 07x02.srt", path: "D:\the.vampire.diaries.702.mkv", imdbid: "tt1405406"}
Note: subpath=gzip/b64 subtitle content // path=extracts moviehash & moviebytesize
Response: subtitle was added (and I can see it uploaded on my account & is available on website, instantly)

Step 3) I search subs again:

Code: Select all

Object {imdbid: "tt1405406", season: "7", episode: "2"}
Returns 0 subtitles.

******

that was a few hours ago, when the episode had aired not long ago. Right now (1am CET) the call still returns 0 subtitles.

MarcoTC
Subtitles Admin
Posts: 44
Joined: Sat Jun 13, 2015 5:15 am

Re: API: Smarter cache updates

Sat Oct 17, 2015 6:30 am

Strange.
Maybe you can submit request(TryUpload and Upload) and responses -xml to look at? Are you getting the URL back in the Upload response?
For me, it works instantly.
It used to take 24 hrs depending if I was the first doing the search. Now it's instant.
I must say that I'm passing all the fields. Including language.

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

Re: API: Smarter cache updates

Sat Oct 17, 2015 2:46 pm

watdafox, yes with your example it is not working (yet). To be more technical, so you guys understand whats going on.

- all searches are parsed, and then I calculate md5 of input fields. So when something like "imdb => 123456" coming, I serialize it, then calculate md5, then I check nosql db for value, if it doesnt exist, I script searches, and store it.

So for correct uncaching, I need to actually uncache all possible searches, how one can find the subtitles. Now working 100% uncaching moviehashes, also imdbis (but not with seasons and episode).

I will try to fix this, but not sure when

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 27 guests