Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nb557 committed Feb 27, 2024
1 parent 58fe3ce commit f9e4e06
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 5 additions & 1 deletion kp_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@
return str.replace(/[\s.,:;'`!?]+/g, ' ').trim();
}

function kpCleanTitle(str) {
return cleanTitle(str).replace(/^[ \/\\]+/, '').replace(/[ \/\\]+$/, '').replace(/\+( *[+\/\\])+/g, '+').replace(/([+\/\\] *)+\+/g, '+').replace(/( *[\/\\]+ *)+/g, '+');
}

function normalizeTitle(str) {
return cleanTitle(str.toLowerCase().replace(/[\-\u2010-\u2015\u2E3A\u2E3B\uFE58\uFE63\uFF0D]+/g, '-').replace(/ё/g, 'е'));
}
Expand All @@ -303,7 +307,7 @@
var url = method;

if (params.query) {
var clean_title = params.query && cleanTitle(decodeURIComponent(params.query));
var clean_title = params.query && kpCleanTitle(decodeURIComponent(params.query));

if (!clean_title) {
onerror();
Expand Down
10 changes: 7 additions & 3 deletions online_mod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//24.02.2024 - Fix
//27.02.2024 - Fix

(function () {
'use strict';
Expand Down Expand Up @@ -14428,6 +14428,10 @@
return str.replace(/[\s.,:;’'`!?]+/g, ' ').trim();
};

this.kpCleanTitle = function (str) {
return this.cleanTitle(str).replace(/^[ \/\\]+/, '').replace(/[ \/\\]+$/, '').replace(/\+( *[+\/\\])+/g, '+').replace(/([+\/\\] *)+\+/g, '+').replace(/( *[\/\\]+ *)+/g, '+');
};

this.normalizeTitle = function (str) {
return this.cleanTitle(str.toLowerCase().replace(/[\-\u2010-\u2015\u2E3A\u2E3B\uFE58\uFE63\uFF0D]+/g, '-').replace(/ё/g, 'е'));
};
Expand Down Expand Up @@ -14652,7 +14656,7 @@
};

var kp_search_by_title = function kp_search_by_title(callback, error) {
var url = 'api/v2.1/films/search-by-keyword?keyword=' + encodeURIComponent(_this2.cleanTitle(query));
var url = 'api/v2.1/films/search-by-keyword?keyword=' + encodeURIComponent(_this2.kpCleanTitle(query));

_this2.kp_api_search(url, callback, error);
};
Expand Down Expand Up @@ -15364,7 +15368,7 @@
};
}

var mod_version = '24.02.2024';
var mod_version = '27.02.2024';
var isMSX = !!(window.TVXHost || window.TVXManager);
var isTizen = navigator.userAgent.toLowerCase().indexOf('tizen') !== -1;
var isIFrame = window.parent !== window;
Expand Down
6 changes: 5 additions & 1 deletion rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

function rating_kp_imdb(card) {
var network = new Lampa.Reguest();
var clean_title = cleanTitle(card.title);
var clean_title = kpCleanTitle(card.title);
var search_date = card.release_date || card.first_air_date || card.last_air_date || '0000';
var search_year = parseInt((search_date + '').slice(0, 4));
var orig = card.original_title || card.original_name;
Expand Down Expand Up @@ -191,6 +191,10 @@
return str.replace(/[\s.,:;'`!?]+/g, ' ').trim();
}

function kpCleanTitle(str){
return cleanTitle(str).replace(/^[ \/\\]+/, '').replace(/[ \/\\]+$/, '').replace(/\+( *[+\/\\])+/g, '+').replace(/([+\/\\] *)+\+/g, '+').replace(/( *[\/\\]+ *)+/g, '+');
}

function normalizeTitle(str){
return cleanTitle(str.toLowerCase().replace(/[\-\u2010-\u2015\u2E3A\u2E3B\uFE58\uFE63\uFF0D]+/g, '-').replace(/ё/g, 'е'));
}
Expand Down

0 comments on commit f9e4e06

Please sign in to comment.