Skip to content

Commit

Permalink
Update to 1.1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephellon committed May 22, 2018
1 parent b08a0bb commit 93a79bd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
Binary file modified hhkmjeeccipbolailpomhjhmccnnjhkj.crx
Binary file not shown.
Binary file modified hhkmjeeccipbolailpomhjhmccnnjhkj.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage_url": "https://github.com/Ephellon/web-to-plex/",

"manifest_version": 2,
"version": "1.1.0.0",
"version": "1.1.0.1",
// Firefox Support =>
// "applications": {
// "gecko": {
Expand Down
19 changes: 12 additions & 7 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ async function getIDs({ title, year, type, IMDbID, TMDbID, TVDbID, APIType, APII
c = (s = "") => t(s).replace(/\&/g, 'and').replace(/\W+/g, '');

// Find an exact match: Title (Year) | #IMDbID
for(var index = 0, found = false, $data; index < json.length && !found; index++) {
for(var index = 0, found = false, $data, lastscore = 0; index < json.length && !found; index++) {
$data = json[index];

//api.tvmaze.com/
Expand Down Expand Up @@ -223,14 +223,19 @@ async function getIDs({ title, year, type, IMDbID, TMDbID, TVDbID, APIType, APII
}

// Find a close match: Title
for(index = 0; index < json.length && !found; index++) {
for(index = 0; index < json.length && (!found || lastscore > 0); index++) {
$data = json[index];

//api.tvmaze.com/
if('show' in $data)
found = (c($data.show.name) == c(title))?
$data:
found;
found =
// ignore language barriers
(c($data.show.name) == c(title))?
$data:
// trust the api matching
($data.score >= lastscore)?
(lastscore = $data.score, $data):
found;
//api.themoviedb.org/ \local
else if('movie_results' in $data || 'tv_results' in $data)
found = (DATA => {
Expand All @@ -248,7 +253,7 @@ async function getIDs({ title, year, type, IMDbID, TMDbID, TVDbID, APIType, APII
$data:
found;
//theimdbapi.org/
else
else if(/english/i.test($data.language))
found = (c($data.title) == c(title))?
$data:
found;
Expand Down Expand Up @@ -301,7 +306,7 @@ async function getIDs({ title, year, type, IMDbID, TMDbID, TVDbID, APIType, APII
year = (data.year + '').slice(0, 4);
year = data.year = +year | 0;

// console.log('Best match', { title, year, data, type, rqut });
// console.log('Best match', { title, year, data, type, rqut, score: json.score | 0 });

return data;
}
Expand Down

0 comments on commit 93a79bd

Please sign in to comment.