vankasteelj / opensubtitles-api

nodejs opensubtitles.org api wrapper for downloading and uploading subtitles in multiple langs
110 stars 33 forks source link

Refactoring Search #27

Closed NoGRo closed 5 years ago

NoGRo commented 7 years ago

the original version of the code given a score according to the method use by server to find the subtitle (Imdb, hash, tag) using one or the other. this version takes advantage of the different subtitles found by the optimization query and compare all properties to build the score

I know it's a big change in the search module, so let me know if you need changes

vankasteelj commented 7 years ago

I'll have to get back on the scoring thing later, i'm too tired to think straight, but the goal of the original version was to make sure a combination of "hints" (like fps, imdb, etc.) wouldn't take over a "hash match", which is what we're basically looking for, and if it exists, it's that one we want.

vankasteelj commented 7 years ago

Ok so apart from the fileTags and input.tags being mixed up (I'm not sure your way is any better than the old one tbh), it doesnt break anything, the results are the same regarding the total sub output. I'll check the "match algorithm" now

NoGRo commented 7 years ago

Hey, I'm going to make the changes that you asked me, with respect the string or integer in comparison, fps, and others, it is solved in the section "parse" there I make sure to convert all the properties that I will use to the corresponding data types in input and subtitle. Before these conversions were scattered and sometimes duplicated in each if With respect to the score ok. I'm going to prioritize hash over others

vankasteelj commented 6 years ago

ok sorry i still have to test it