- rimosso supporto a TVDB (l'accesso alle API diventerà a pagamento)
- aggiunto canale Discovery+
- aggiunta possibilità di scegliere numerazioni alternative per le serie tv
- migliorie interne di vario tipo (tra cui un migliore riconoscimento dei contenuti nel caso siano scritti male)
This commit is contained in:
mac12m99
2021-02-13 16:37:02 +01:00
parent 0ebc744115
commit 748fad7431
64 changed files with 2203 additions and 712 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ rm tests/home/userdata/addon_data/plugin.video.kod/settings_channels/*.json
rm tests/home/userdata/addon_data/plugin.video.kod/settings_servers/*.json
rm tests/home/userdata/addon_data/plugin.video.kod/cookies.dat
rm tests/home/userdata/addon_data/plugin.video.kod/kod_db.sqlite
python -m pip install --upgrade pip
python3 -m pip install --upgrade pip
pip install sakee
pip install html-testRunner
pip install parameterized
+18 -22
View File
@@ -5,9 +5,16 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<style>
textarea {
font-family: monospace;
box-sizing: border-box;
width: 100%;
}
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<h2 class="text-capitalize">{{ title }}</h2>
@@ -55,7 +62,9 @@
{%- if (test_case.stdout or test_case.err or test_case.err) and test_case.outcome != test_case.SKIP %}
<tr style="display:none;">
<td class="col-xs-9" colspan="3">
{%- if test_case.stdout %}<p style="white-space: pre-line;">{{ test_case.stdout|e }}</p>{% endif %}
<textarea rows="40" readonly>
{%- if test_case.stdout %}{{ test_case.stdout|e }}{% endif %}
</textarea>
{%- if test_case.err %}<p style="color:maroon;">{{ test_case.err[0].__name__ }}: {{ test_case.err[1] }}</p>{% endif %}
</td>
</tr>
@@ -63,7 +72,9 @@
{%- if (test_case.stdout or test_case.err or test_case.err) and test_case.outcome == test_case.SKIP %}
<tr style="display:none;">
<td class="col-xs-9" colspan="3">
{%- if test_case.stdout %}<p style="white-space: pre-line;">{{ test_case.stdout|e }}</p>{% endif %}
<textarea rows="40" readonly>
{%- if test_case.stdout %}{{ test_case.stdout|e }}{% endif %}
</textarea>
{%- if test_case.err %}<p style="color:maroon;">{{ test_case.err }}</p>{% endif %}
</td>
</tr>
@@ -113,8 +124,10 @@
{%- if subtest.err or subtest.err %}
<tr style="display:none;">
<td class="col-xs-9" colspan="3">
{%- if subtest.err %}<p style="color:maroon;">{{ subtest.err[0].__name__ }}: {{ subtest.err[1] }}</p>{% endif %}
{%- if subtest.err %}<p style="color:maroon;">{{ subtest.test_exception_info }}</p>{% endif %}
<textarea rows="40" readonly>
{%- if subtest.err %}{{ subtest.err[0].__name__ }}: {{ subtest.err[1] }}{% endif %}
</textarea>
{%- if subtest.err %}<p style="color:maroon;">{{ subtest.test_exception_info }}</p>{% endif %}
</td>
</tr>
{%- endif %}
@@ -126,11 +139,6 @@
{%- endif %}
{%- endif %}
{%- endfor %}
<tr>
<td colspan="3">
Total: {{ summaries[test_case_name].total }}, Pass: {{ summaries[test_case_name].success }}{% if summaries[test_case_name].failure %}, Fail: {{ summaries[test_case_name].failure }}{% endif %}{% if summaries[test_case_name].error %}, Error: {{ summaries[test_case_name].error }}{% endif %}{% if summaries[test_case_name].skip %}, Skip: {{ summaries[test_case_name].skip }}{% endif %} -- Duration: {{ summaries[test_case_name].duration }}
</td>
</tr>
</tbody>
</table>
</div>
@@ -171,30 +179,18 @@
}
$('#showPassed').on('click', function(){
$(".success").toggle(this.checked);
if (this.checked == false) {
$(".success").next('tr').toggle(this.checked);
}
hideOrShow()
});
$('#showFailed').on('click', function(){
$(".danger").toggle(this.checked);
if (this.checked == false) {
$(".danger").next('tr').toggle(this.checked);
}
hideOrShow()
});
$('#showErrors').on('click', function(){
$(".warning").toggle(this.checked);
if (this.checked == false) {
$(".warning").next('tr').toggle(this.checked);
}
hideOrShow()
});
$('#showSkipped').on('click', function(){
$(".info").toggle(this.checked);
if (this.checked == false) {
$(".info").next('tr').toggle(this.checked);
}
hideOrShow()
});
});
+22 -12
View File
@@ -14,19 +14,18 @@ import unittest
import xbmc
if 'KOD_TST_CH' not in os.environ:
from sakee import addoninfo
# custom paths
def add_on_info(*args, **kwargs):
return xbmc.AddonData(
return addoninfo.AddonData(
kodi_home_path=os.path.join(os.getcwd(), 'tests', 'home'),
add_on_id='plugin.video.kod',
add_on_path=os.getcwd(),
kodi_profile_path=os.path.join(os.getcwd(), 'tests', 'home', 'userdata')
)
# override
xbmc.get_add_on_info_from_calling_script = add_on_info
addoninfo.get_add_on_info_from_calling_script = add_on_info
# functions that on kodi 19 moved to xbmcvfs
try:
@@ -49,10 +48,14 @@ sys.path.insert(0, librerias)
from core.support import typo
from core.item import Item
from core.httptools import downloadpage
from core import servertools
from core import servertools, httptools
import channelselector
import re
httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = 60
outDir = os.path.join(os.getcwd(), 'reports')
validUrlRegex = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' # domain...
@@ -144,7 +147,7 @@ channels = []
channel_list = channelselector.filterchannels("all") if 'KOD_TST_CH' not in os.environ else [Item(channel=os.environ['KOD_TST_CH'], action="mainlist")]
logger.info([c.channel for c in channel_list])
ret = []
results = []
logger.record = True
for chItem in channel_list:
@@ -179,8 +182,6 @@ for chItem in channel_list:
itemlist = getattr(module, it.action)(it)
menuItemlist[it.title] = itemlist
logMenu[it.title] = logger.recordedLog
logger.recordedLog = ''
# some sites might have no link inside, but if all results are without servers, there's something wrong
for resIt in itemlist:
@@ -206,9 +207,15 @@ for chItem in channel_list:
except:
import traceback
logger.error(traceback.format_exc())
logMenu[it.title] = logger.recordedLog
logger.recordedLog = ''
logMenu[it.title] = logger.recordedLog
logger.recordedLog = ''
# results.append(
# {'ch': ch, 'hasChannelConfig': hasChannelConfig, 'mainlist': [it.title for it in mainlist],
# 'menuItemlist': {k: [it.tojson() if type(it) == Item else it for it in menuItemlist[k]] for k in menuItemlist.keys()},
# 'serversFound': {k: [it.tojson() if type(it) == Item else it for it in menuItemlist[k]] for k in menuItemlist.keys()},
# 'module': str(module), 'logMenu': logMenu, 'error': error})
channels.append(
{'ch': ch, 'hasChannelConfig': hasChannelConfig, 'mainlist': mainlist, 'menuItemlist': menuItemlist,
'serversFound': serversFound, 'module': module, 'logMenu': logMenu, 'error': error})
@@ -217,7 +224,10 @@ logger.record = False
from specials import news
dictNewsChannels, any_active = news.get_channels_list()
print(channels)
# if not os.path.isdir(outDir):
# os.mkdir(outDir)
# json.dump(results, open(os.path.join(outDir, 'result.json'), 'w'))
# only 1 server item for single server
serverNames = []
serversFinal = []
@@ -350,6 +360,6 @@ if __name__ == '__main__':
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(report_name='report', add_timestamp=False, combine_reports=True,
report_title='KoD Test Suite', template=os.path.join(config.get_runtime_path(), 'tests', 'template.html')), exit=False)
import webbrowser
webbrowser.open(os.path.join(config.get_runtime_path(), 'reports', 'report.html'))
webbrowser.open(os.path.join(outDir, 'report.html'))
else:
unittest.main()