Release Kaleido 0.1.8 with cast browsing and refreshed title pages
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m8s

This commit is contained in:
Elijah 2026-10-25 21:49:24 -07:00
parent 119f1ae5a9
commit 5199bb0928
28 changed files with 982 additions and 187 deletions

73
scripts/verify_details.py Normal file
View file

@ -0,0 +1,73 @@
"""Live details/cast/related checks on the onn. Temporarily toggles unwatched fixtures.
The movie and every episode of the show must start unwatched with no resume point.
Both are restored, including on failure. Do not run beside another device/UI test.
"""
import json,time,urllib.parse,urllib.request
from device import adb,OUT,screenshot
from inspect_server import get,base,token
from verify_ui import launch,key,text,focused,wait,focus,labels,snapshot
MOVIE='36486' # Matchbox: first recent-release movie on the private test server.
SHOW='16413' # 3 Body Problem: first A-Z show, eight initially unwatched episodes.
def metadata(ident):return get('/library/metadata/'+ident)['Metadata'][0]
def leaves(ident):return get('/library/metadata/'+ident+'/allLeaves').get('Metadata',[])
def clean(item):return not item.get('viewCount',0) and not item.get('viewOffset',0)
def reset(ident):
# Cleanup uses Plex's same endpoint if a failing UI cannot restore the fixture.
path='/:/unscrobble?'+urllib.parse.urlencode({'key':ident,'identifier':'com.plexapp.plugins.library'})
request=urllib.request.Request(base+path,headers={'X-Plex-Token':token,'Accept':'application/json'})
with urllib.request.urlopen(request,timeout=20) as response:assert response.status==200
def main():
movie=metadata(MOVIE);show=metadata(SHOW);episodes=leaves(SHOW)
assert clean(movie),'Movie fixture has existing watched/resume state; choose another fixture'
assert episodes and all(clean(e) for e in episodes),'Show fixture has existing watched/resume state; choose another fixture'
results=[];touched=set()
try:
launch();key(22);focused('Movies');text('Recently released');key(20);focused('Discover');key(20);key(23)
text(movie['title']);text('Cast');focused('Play');text('Mark watched')
key(22);focused('Mark watched');touched.add(MOVIE);key(23);focused('Mark unwatched')
assert metadata(MOVIE).get('viewCount',0)>0
screenshot('details-movie-watched');key(23);focused('Mark watched');assert clean(metadata(MOVIE))
results.append('Movie watched/unwatched persisted in Plex');print('PASS '+results[-1],flush=True)
key(21);focused('Play');key(20)
actor=movie['Role'][0];focused(actor['tag']);key(23)
expected=[]
for section in get('/library/sections').get('Directory',[]):
if section['type'] in ('movie','show'):
expected.extend(get('/library/sections/'+section['key']+'/all?actor='+str(actor['id'])).get('Metadata',[]))
expected={j['ratingKey']:j for j in expected};text(actor['tag']);text(str(len(expected))+' titles')
wait(lambda r:focus(r) not in ('','Back'),'Actor title grid focus');first=focus(snapshot());key(22);second=focus(snapshot());key(23)
wait(lambda r:'Cast' in labels(r),'Selected actor title details');key(4);focused(second);key(4);focused(actor['tag'])
screenshot('details-cast-restored')
results.append('Actor titles match both Plex libraries; title and cast focus restore');print('PASS '+results[-1],flush=True)
key(4);key(4);focused('Home');key(22,2);focused('TV Shows');key(20);focused('Discover');key(22);focused('Library');key(23)
wait(lambda r:any(x.startswith('All genres') for x in labels(r)),'Show library filters loaded');focused('Library');key(20)
if show['title'] not in focus(snapshot()):key(21)
focused(show['title']);key(23)
text('Seasons');focused('Watch next');text('Mark watched');key(22);focused('Mark watched');touched.add(SHOW);key(23);focused('Mark unwatched')
assert metadata(SHOW).get('viewedLeafCount')==len(episodes)
assert all(e.get('viewCount',0)>0 for e in leaves(SHOW))
screenshot('details-show-watched');key(23);focused('Mark watched')
assert metadata(SHOW).get('viewedLeafCount',0)==0 and all(clean(e) for e in leaves(SHOW))
results.append('Series watched/unwatched updates every episode in Plex');print('PASS '+results[-1],flush=True)
related=get('/library/metadata/'+SHOW+'/related').get('Hub',[])
expected_related={m['ratingKey'] for h in related for m in h.get('Metadata',[]) if m.get('type')=='show' and m['ratingKey']!=SHOW}
assert expected_related,'Related-show fixture missing server-generated hubs'
key(21);focused('Watch next');key(20);text('Seasons');key(20);focused(show['Role'][0]['tag']);key(20);text('Related shows')
selected=focus(snapshot());assert selected and selected not in ('Watch next','Mark watched')
screenshot('details-related-shows');key(23);focused('Watch next');key(4);focused(selected)
results.append('Server-related shows render, open and restore focus');print('PASS '+results[-1],flush=True)
key(4,3);focused('Home')
finally:
for ident in touched:
changed=not clean(metadata(ident)) if ident==MOVIE else any(not clean(e) for e in leaves(ident))
if changed:reset(ident)
assert clean(metadata(MOVIE)) and all(clean(e) for e in leaves(SHOW)),'Fixture restoration failed'
(OUT/'details-feature-results.json').write_text(json.dumps(results,indent=2)+'\n')
print('PASS original unwatched/resume state restored for both fixtures',flush=True)
if __name__=='__main__':main()

View file

@ -0,0 +1,20 @@
"""Check a fresh show page keeps its Back control and description in the safe area."""
import re
from device import screenshot
from verify_ui import launch,key,focused,wait,focus,labels,snapshot
launch();key(22,2);focused('TV Shows');key(20);focused('Discover');key(22);focused('Library');key(23)
wait(lambda r:any(x.startswith('All genres') for x in labels(r)),'Show library loaded');focused('Library');key(20)
if '3 Body Problem' not in focus(snapshot()):key(21)
focused('3 Body Problem');key(23);focused('Watch next')
root=snapshot();screenshot('show-layout-current')
title=next(n for n in root.iter('node') if n.get('text')=='3 Body Problem')
bounds=list(map(int,re.findall(r'\d+',title.get('bounds'))))
back=next((n for n in root.iter('node') if n.get('content-desc')=='Back'),None)
print('Title bounds:',bounds,'Back visible:',back is not None,flush=True)
assert bounds[1]>=88,'Show title was scrolled above the safe header area on initial focus'
assert back is not None,'Back control must remain visible on initial show entry'
back_bounds=list(map(int,re.findall(r'\d+',back.get('bounds'))))
assert back_bounds[1]>=0 and back_bounds[3]>back_bounds[1],'Back control must stay inside the visible header'
assert 'Seasons' in labels(root),'Seasons must lead the rows beneath show information'
print('PASS safe show header and Seasons first on initial entry')

View file

@ -9,15 +9,15 @@ from device import adb,OUT,screenshot
def setting():
launch();key(22,4);focused('Settings');key(23);focused('Sign in with Plex')
key(20);focused('Mode: Direct stream');key(20);focused('Mark watched at 80%');key(20)
key(21);focused('Connection');key(20,2);focused('Interface');key(22);focused('Navigation sounds')
def persistence():
setting();focused('Navigation sounds: On');key(23);focused('Navigation sounds: Off')
setting();focused('Navigation sounds');text('On');key(23);focused('Navigation sounds');text('Off')
screenshot('navigation-sounds-off')
setting();focused('Navigation sounds: Off')
setting();focused('Navigation sounds');text('Off')
print('PASS disabling navigation sounds persists across process restart',flush=True)
key(23);focused('Navigation sounds: On')
setting();focused('Navigation sounds: On')
key(23);focused('Navigation sounds');text('On')
setting();focused('Navigation sounds');text('On')
print('PASS enabling navigation sounds persists across process restart',flush=True)
screenshot('navigation-sounds-on');key(4);focused('Home');text('Continue Watching')
@ -28,16 +28,16 @@ def audio():
adb('shell','atrace','--async_start','-b','16384','audio')
try:
for _ in range(3):
adb('shell','input','keyevent','20');time.sleep(.3)
adb('shell','input','keyevent','19');time.sleep(.3)
adb('shell','input','keyevent','21');time.sleep(.3)
adb('shell','input','keyevent','22');time.sleep(.3)
time.sleep(.4)
finally:raw=adb('shell','atrace','--async_stop','audio').decode(errors='replace')
(OUT/f'navigation-audio-{label}-atrace.txt').write_text(raw)
focused('Navigation sounds: '+label.capitalize())
focused('Navigation sounds');text(label.capitalize())
return sum('tracing_mark_write: B|' in line and line.endswith('|write') for line in raw.splitlines())
setting();focused('Navigation sounds: On');key(23);focused('Navigation sounds: Off')
setting();focused('Navigation sounds');text('On');key(23);focused('Navigation sounds');text('Off')
muted=probe('off')
key(23);focused('Navigation sounds: On');enabled=probe('on')
key(23);focused('Navigation sounds');text('On');enabled=probe('on')
result={'mutedMixerWrites':muted,'enabledMixerWrites':enabled}
(OUT/'navigation-audio-results.json').write_text(json.dumps(result,indent=2)+'\n')
print('Native audio activity:',result,flush=True)

View file

@ -0,0 +1,20 @@
"""D-pad checks for the category settings page; dialogs are cancelled without changes."""
from verify_ui import launch,key,text,focused,focus,snapshot
from device import screenshot
launch();key(22,4);focused('Settings');key(23);focused('Sign in with Plex')
key(21);focused('Connection');key(20);focused('Playback');key(22);focused('Playback quality')
key(23);focused('Original quality');key(4);focused('Playback quality')
key(20);focused('Watched status');key(23);focused('80%');key(4);focused('Watched status')
print('PASS quality and watched-threshold dialogs cancel back to their controls',flush=True)
screenshot('settings-playback-current')
key(21);focused('Playback');key(20);focused('Interface');key(22);focused('Navigation sounds')
key(21);focused('Interface');key(20);focused('Updates');key(22);focused('Check for updates');key(23)
text('Kaleido is up to date.');focused('Check for updates')
screenshot('settings-updates-current')
key(21);focused('Updates');key(19,3);focused('Connection');key(22);focused('Sign in with Plex')
key(22)
if 'Choose server' in focus(snapshot()):key(22)
focused('Sign out');key(23);focused('Keep watching');key(4);focused('Sign out')
key(4);focused('Home')
print('PASS category focus, live update check and safe sign-out cancellation',flush=True)