Record coordinated reception results and prepare scoped web H264 option

This commit is contained in:
2026-10-12 23:57:10 +02:00
parent 5c10d8b9b8
commit a7e44efdf7
15 changed files with 12390 additions and 17 deletions
+11 -1
View File
@@ -9,7 +9,7 @@ def api(path,data=None,method=None,token=admin):
body=response.read();return json.loads(body) if body else None
report={'checked_utc':datetime.datetime.now(datetime.timezone.utc).isoformat()}
report['plugin']=next(x for x in api('/Plugins') if x['Name']=='Enigma2')
assert report['plugin']['Version']=='7.0.6.0' and report['plugin']['Status']=='Active'
assert report['plugin']['Version']=='7.0.7.0' and report['plugin']['Status']=='Active'
report['epg']=api('/DecoderIntegration/Status')
report['channel_count']=api('/LiveTv/Channels?Limit=0')['TotalRecordCount']
report['timer_count']=api('/LiveTv/Timers?Limit=0')['TotalRecordCount']
@@ -24,6 +24,11 @@ try:
tokens.append(login['AccessToken'])
for token in tokens: assert api('/DecoderIntegration/Preferences',token=token)['DefaultView']=='all'
channel=api('/LiveTv/Channels?Limit=1')['Items'][0]['Id']
assert api('/DecoderIntegration/WebPlaybackPolicy?channelId='+channel,token=tokens[0])=={'IsEnigmaChannel':True,'PreferH264':True}
assert api('/DecoderIntegration/WebPlaybackPolicy?channelId=00000000000000000000000000000000',token=tokens[0])=={'IsEnigmaChannel':False,'PreferH264':False}
movies=api('/Items?UserId='+users[0]+'&IncludeItemTypes=Movie&Recursive=true&Limit=1',token=tokens[0])['Items']
if movies: assert api('/DecoderIntegration/WebPlaybackPolicy?channelId='+movies[0]['Id'],token=tokens[0])=={'IsEnigmaChannel':False,'PreferH264':False}
report['web_playback_policy_channel_and_movie_scope']='PASS'
api('/DecoderIntegration/Preferences',{'FavoriteIds':[channel],'HiddenIds':[],'OrderedIds':[channel],'DefaultView':'favorites'},'PUT',tokens[0])
assert api('/DecoderIntegration/Preferences',token=tokens[0])['FavoriteIds']==[channel.replace('-','')]
assert api('/DecoderIntegration/Preferences',token=tokens[1])['FavoriteIds']==[]
@@ -43,6 +48,11 @@ try:
req=urllib.request.Request('http://127.0.0.1:8096/web/ConfigurationPage?name=decoder-channels',headers={'Authorization':'MediaBrowser Token="'+token+'", Client="DecoderIntegration", Device="Maintenance", DeviceId="decoder-maintenance", Version="7"'})
text=urllib.request.urlopen(req).read().decode();assert 'channelRows' in text
report['user_channel_page']='PASS'
policy=api('/Users/'+users[1])['Policy'];policy['EnableLiveTvAccess']=False
api('/Users/'+users[1]+'/Policy',policy)
try:api('/DecoderIntegration/WebPlaybackPolicy?channelId='+channel,token=tokens[1]);raise AssertionError('live TV denied user policy permitted')
except urllib.error.HTTPError as ex:assert ex.code==403
report['web_playback_policy_denied_user']='PASS'
finally:
for user in users:
api('/Users/'+user,method='DELETE')