Release Kaleido 0.3.0 with categories, alphabet jumps and audio preferences
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m24s
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m24s
This commit is contained in:
parent
54519d4581
commit
0c62d7414e
31 changed files with 1051 additions and 80 deletions
|
|
@ -1,7 +1,7 @@
|
|||
"""Stage a locally signed APK for Git distribution and tag-triggered Forgejo releases."""
|
||||
import hashlib, json, pathlib, re, shutil, subprocess
|
||||
ROOT=pathlib.Path(__file__).resolve().parents[1]
|
||||
version=dict(l.split('=',1) for l in (ROOT/'version.properties').read_text().splitlines() if '=' in l)
|
||||
version=dict(l.split('=',1) for l in (ROOT/'version.properties').read_text(encoding='utf-8').splitlines() if '=' in l)
|
||||
apk=ROOT/'app/build/outputs/apk/release/app-release.apk'
|
||||
if not apk.exists():raise SystemExit('Run Build.ps1 -Release first.')
|
||||
out=ROOT/'distribution';out.mkdir(exist_ok=True)
|
||||
|
|
@ -11,8 +11,8 @@ digest=hashlib.sha256(apk.read_bytes()).hexdigest()
|
|||
repo='https://git.elijahkuntz.com/Elijah/Kaleido'
|
||||
tag='v'+version['versionName']
|
||||
# Only this version's section, matching the release body the app shows as notes.
|
||||
changelog=(ROOT/'CHANGELOG.md').read_text() if (ROOT/'CHANGELOG.md').exists() else ''
|
||||
changelog=(ROOT/'CHANGELOG.md').read_text(encoding='utf-8') if (ROOT/'CHANGELOG.md').exists() else ''
|
||||
section=re.search(r'^## v?'+re.escape(version['versionName'])+r'[ \t]*$(.*?)(?=^## |\Z)',changelog,re.M|re.S)
|
||||
manifest={'version':version['versionName'],'versionCode':int(version['versionCode']),'url':repo+'/raw/tag/'+tag+'/distribution/Kaleido.apk','checksumUrl':repo+'/raw/tag/'+tag+'/distribution/Kaleido.apk.sha256','notes':section.group(1).strip() if section else ''}
|
||||
(out/'latest.json').write_text(json.dumps(manifest,indent=2)+'\n')
|
||||
(out/'latest.json').write_text(json.dumps(manifest,indent=2)+'\n',encoding='utf-8')
|
||||
print('Packaged',tag,'SHA-256',digest)
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@ import hashlib, json, os, pathlib, re, urllib.request, uuid
|
|||
ROOT=pathlib.Path(__file__).resolve().parents[1]
|
||||
API='https://git.elijahkuntz.com/api/v1/repos/Elijah/Kaleido'
|
||||
token=os.environ['KALEIDO_RELEASE_TOKEN']
|
||||
version=dict(l.split('=',1) for l in (ROOT/'version.properties').read_text().splitlines() if '=' in l)
|
||||
version=dict(l.split('=',1) for l in (ROOT/'version.properties').read_text(encoding='utf-8').splitlines() if '=' in l)
|
||||
tag='v'+version['versionName']
|
||||
ref=os.environ.get('RELEASE_REF','')
|
||||
assert ref=='refs/tags/'+tag,'Tag must match version.properties exactly'
|
||||
out=ROOT/'distribution'
|
||||
def notes():
|
||||
"""Only this version's changelog section; the app shows the body as release notes."""
|
||||
text=(ROOT/'CHANGELOG.md').read_text()
|
||||
text=(ROOT/'CHANGELOG.md').read_text(encoding='utf-8')
|
||||
m=re.search(r'^## v?'+re.escape(version['versionName'])+r'[ \t]*$(.*?)(?=^## |\Z)',text,re.M|re.S)
|
||||
return m.group(1).strip() if m else ''
|
||||
assert hashlib.sha256((out/'Kaleido.apk').read_bytes()).hexdigest()==(out/'Kaleido.apk.sha256').read_text().split()[0]
|
||||
|
|
|
|||
111
scripts/verify_audio_preferences.py
Normal file
111
scripts/verify_audio_preferences.py
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
"""Validate optional themes and PCM boost on the authorized onn; restore the prior audio preferences."""
|
||||
import re,time,sys,xml.etree.ElementTree as ET
|
||||
from device import adb,OUT,screenshot
|
||||
from verify_ui import launch,key,text,focused,focus,snapshot,labels,wait,passed
|
||||
|
||||
def settings(category):
|
||||
launch();key(22,4);focused('Settings');key(23);focused('Switch account')
|
||||
key(21);focused('Connection');key(20,category);key(22)
|
||||
|
||||
def choose(options,value):
|
||||
key(23)
|
||||
current=focus(snapshot())
|
||||
assert current in options,(current,options)
|
||||
delta=options.index(value)-options.index(current)
|
||||
key(20 if delta>=0 else 19,abs(delta));focused(value);key(23)
|
||||
|
||||
def logs():return adb('logcat','-d','-s','KaleidoTheme:I','KaleidoPlayback:I','*:S').decode(errors='replace')
|
||||
|
||||
def wait_log(fragment,timeout=40):
|
||||
deadline=time.monotonic()+timeout
|
||||
while time.monotonic()<deadline:
|
||||
value=logs()
|
||||
if fragment in value:return value
|
||||
time.sleep(.5)
|
||||
raise AssertionError('Missing log '+fragment)
|
||||
|
||||
def open_silo():
|
||||
launch();key(22,3);focused('Search');key(23);text('Search')
|
||||
adb('shell','input','text','silo')
|
||||
text('TV shows');key(66);focused('Silo');key(23);text('Seasons')
|
||||
|
||||
if __name__=='__main__':
|
||||
playback_only='--playback-only' in sys.argv
|
||||
original_xml=None
|
||||
if playback_only:
|
||||
# UI preferences and persistence are checked separately; isolate the playback batch
|
||||
# using only this debug app's private preferences, with byte-for-byte restoration.
|
||||
original_xml=adb('shell','run-as','tv.kaleido.app','cat','shared_prefs/preferences.xml')
|
||||
(OUT/'030-audio-original-preferences.xml').write_bytes(original_xml)
|
||||
tree=ET.fromstring(original_xml)
|
||||
for name,kind,value in [('themeMusic','boolean','true'),('themeVolume','int','20'),('volumeBoostDb','int','6')]:
|
||||
node=next((n for n in tree if n.get('name')==name),None)
|
||||
if node is None:node=ET.SubElement(tree,kind,{'name':name})
|
||||
node.set('value',value)
|
||||
adb('shell','am','force-stop','tv.kaleido.app')
|
||||
adb('shell','run-as','tv.kaleido.app','sh','-c','"cat > shared_prefs/preferences.xml"',data=ET.tostring(tree,encoding='utf-8',xml_declaration=True))
|
||||
else:
|
||||
settings(3);focused('Navigation sounds');key(20);focused('Theme music')
|
||||
original_on=focus(snapshot()).endswith('On')
|
||||
if not original_on:key(23)
|
||||
key(20);focused('Theme music volume')
|
||||
original_volume=re.search(r'(\d+)%$',focus(snapshot())).group(1)+'%'
|
||||
choose([str(n)+'%' for n in range(10,101,10)],'20%');focused('Theme music volume')
|
||||
settings(1);focused('Playback quality');key(20,6);focused('Volume boost')
|
||||
current=focus(snapshot());original_boost='Off (+0 dB)' if current.endswith('Off (+0 dB)') else re.search(r'\+\d+ dB$',current).group()
|
||||
choose(['Off (+0 dB)','+3 dB','+6 dB','+9 dB','+12 dB'],'+6 dB');focused('Volume boost')
|
||||
screenshot('030-volume-boost')
|
||||
settings(3);key(20);focused('Theme music');assert focus(snapshot()).endswith('On')
|
||||
key(20);focused('Theme music volume');assert focus(snapshot()).endswith('20%')
|
||||
screenshot('030-theme-settings')
|
||||
passed('Theme toggle, theme volume and boost persist through cold starts; dialogs restore focus')
|
||||
try:
|
||||
adb('logcat','-c');open_silo();wait_log('KaleidoTheme: READY volume=20%')
|
||||
screenshot('030-silo-theme')
|
||||
adb('logcat','-c');key(3);wait_log('STOP')
|
||||
# Launchers may reopen Home rather than restore the previous Activity task.
|
||||
# Enter the title through the normal remote flow before expecting music again.
|
||||
open_silo();wait_log('PLAYING')
|
||||
passed('Theme stops in the background and plays again on a title page')
|
||||
# Show -> season -> neighbouring episode selection all retain a supported theme.
|
||||
key(20)
|
||||
wait(lambda r:'Season' in focus(r),'Season receives focus');key(23)
|
||||
wait(lambda r:any(t=='Episodes' or t.startswith(('Play','Resume')) for t in labels(r)),'Season episode header')
|
||||
wait_log('KaleidoTheme: READY volume=20%')
|
||||
passed('Series and season/episode detail pages play the real inherited Plex theme')
|
||||
# Actual video uses validation mode, which avoids changing Plex progress.
|
||||
adb('logcat','-c')
|
||||
adb('shell','am','start','-n','tv.kaleido.app/.MainActivity','--es','testTitleId','7599','--el','testOffset','90000','--ei','testMode','0','--ez','testValidation','true')
|
||||
wait_log('STOP');wait_log('BOOST processing PCM db=6');wait_log('READY item=7599')
|
||||
time.sleep(4)
|
||||
audit=adb('shell','run-as','tv.kaleido.app','cat','files/playback-validation.jsonl')
|
||||
(OUT/'030-boost-validation.jsonl').write_bytes(audit)
|
||||
import json
|
||||
events=[json.loads(line) for line in audit.decode().splitlines()]
|
||||
assert any(e.get('event')=='audioAdvancing' for e in events),'Decoded audio must advance'
|
||||
assert any(e.get('event')=='firstFrame' for e in events),'Video must render'
|
||||
passed('Theme stops for actual video; +6 dB processor receives decoded PCM and audio/video advance')
|
||||
adb('shell','am','force-stop','tv.kaleido.app');adb('logcat','-c')
|
||||
adb('shell','am','start','-n','tv.kaleido.app/.MainActivity','--es','testTitleId','9776','--el','testOffset','90000','--ei','testMode','2','--ez','testValidation','true')
|
||||
wait_log('BOOST processing PCM db=6');wait_log('READY item=9776');time.sleep(4)
|
||||
movie_audit=adb('shell','run-as','tv.kaleido.app','cat','files/playback-validation.jsonl')
|
||||
(OUT/'030-boost-movie-validation.jsonl').write_bytes(movie_audit)
|
||||
movie_events=[json.loads(line) for line in movie_audit.decode().splitlines()]
|
||||
assert any(e.get('event')=='audioAdvancing' for e in movie_events)
|
||||
assert any(e.get('event')=='firstFrame' for e in movie_events)
|
||||
passed('Volume boost also processes a real Plex-converted movie with rendered audio/video')
|
||||
adb('shell','am','force-stop','tv.kaleido.app')
|
||||
finally:
|
||||
if playback_only:
|
||||
adb('shell','am','force-stop','tv.kaleido.app')
|
||||
adb('shell','run-as','tv.kaleido.app','sh','-c','"cat > shared_prefs/preferences.xml"',data=original_xml)
|
||||
assert adb('shell','run-as','tv.kaleido.app','cat','shared_prefs/preferences.xml')==original_xml
|
||||
else:
|
||||
settings(1);key(20,6);focused('Volume boost')
|
||||
choose(['Off (+0 dB)','+3 dB','+6 dB','+9 dB','+12 dB'],original_boost)
|
||||
settings(3);key(20);focused('Theme music')
|
||||
if focus(snapshot()).endswith('On')!=original_on:key(23)
|
||||
key(20);focused('Theme music volume');choose([str(n)+'%' for n in range(10,101,10)],original_volume)
|
||||
launch()
|
||||
(OUT/'030-audio.log').write_text(logs())
|
||||
passed('Prior theme and boost preferences restored; device returned to Home')
|
||||
76
scripts/verify_library_jump.py
Normal file
76
scripts/verify_library_jump.py
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
"""Read-only D-pad checks for exact search, scoped genres and jumps beyond the first catalog page."""
|
||||
import json,time,urllib.parse,urllib.request
|
||||
from device import ROOT,adb,screenshot
|
||||
from verify_ui import launch,key,text,focused,focus,snapshot,labels,wait,passed
|
||||
|
||||
LETTERS=['#']+list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
||||
|
||||
def first_at_letter(section,media_type,letter,genre=''):
|
||||
cfg=dict(l.split('=',1) for l in (ROOT/'.env').read_text().splitlines() if '=' in l and not l.startswith('#'))
|
||||
base=cfg['PLEX_SERVER_URL'].strip('"\'').rstrip('/')
|
||||
headers={'X-Plex-Token':cfg['PLEX_TOKEN'].strip('"\''),'Accept':'application/json'}
|
||||
def get(path,params):
|
||||
request=urllib.request.Request(base+path+'?'+urllib.parse.urlencode(params),headers=headers)
|
||||
with urllib.request.urlopen(request,timeout=30) as response:return json.load(response)['MediaContainer']
|
||||
sections=get('/library/sections',{})['Directory']
|
||||
section=next(s['key'] for s in sections if s['type']==media_type)
|
||||
params={'type':'1' if media_type=='movie' else '2'}
|
||||
if genre:
|
||||
genres=get('/library/sections/'+section+'/genre',{})['Directory']
|
||||
params['genre']=next(g['key'] for g in genres if g['title']==genre)
|
||||
chars=get('/library/sections/'+section+'/firstCharacter',params)['Directory']
|
||||
offset=0
|
||||
for item in chars:
|
||||
if item['title']==letter:break
|
||||
offset+=item['size']
|
||||
params.update({'sort':'titleSort:asc','X-Plex-Container-Start':offset,'X-Plex-Container-Size':1})
|
||||
return get('/library/sections/'+section+'/all',params)['Metadata'][0]['title'],offset
|
||||
|
||||
def enter_rail():
|
||||
for _ in range(10):
|
||||
value=focus(snapshot())
|
||||
if value in LETTERS:return value
|
||||
key(22)
|
||||
raise AssertionError('Right edge must enter letter bar; focus='+focus(snapshot()))
|
||||
|
||||
def jump(letter,expected):
|
||||
current=enter_rail()
|
||||
delta=LETTERS.index(letter)-LETTERS.index(current)
|
||||
key(20 if delta>=0 else 19,abs(delta));focused(letter)
|
||||
key(23)
|
||||
# OK keeps the letter selected; Left explicitly enters the target title.
|
||||
time.sleep(2);focused(letter);key(21);focused(expected)
|
||||
key(23);wait(lambda r:any(s in labels(r) for s in ['Play','Resume','Seasons','Synopsis']),'Title details open')
|
||||
key(4);focused(expected)
|
||||
|
||||
def section_check(tab,media_type):
|
||||
launch();key(22,1 if tab=='Movies' else 2);focused(tab)
|
||||
key(20);focused('Discover');key(22);focused('Library');key(23);focused('Library')
|
||||
text('Z');screenshot('030-'+media_type+'-library')
|
||||
key(20);key(20)
|
||||
expected,offset=first_at_letter('',media_type,'S')
|
||||
jump('S',expected)
|
||||
passed(f'{tab} A-Z reaches S at absolute index {offset}, enters title and restores focus')
|
||||
key(4);focused('Discover');key(22,2);focused('Categories');key(23)
|
||||
# Genres are server-supplied and alphabetically ordered; move within the first row.
|
||||
wait(lambda r:focus(r) not in ('','Categories'),'Category tile receives focus')
|
||||
for _ in range(8):
|
||||
if focus(snapshot())=='Animation':break
|
||||
key(22)
|
||||
focused('Animation');key(23);text('Animation ⌄');text('Z')
|
||||
expected,offset=first_at_letter('',media_type,'S','Animation')
|
||||
jump('S',expected)
|
||||
screenshot('030-'+media_type+'-animation-jump')
|
||||
key(4);focused('Animation');key(4);focused('Discover')
|
||||
passed(f'{tab} Animation stays scoped and supports letter jump, details Back and category Back')
|
||||
|
||||
if __name__=='__main__':
|
||||
for tab,kind in [('Movies','movie'),('TV Shows','show')]:section_check(tab,kind)
|
||||
launch()
|
||||
key(22,3);focused('Search');key(23);text('Search')
|
||||
adb('shell','input','text','silo')
|
||||
text('TV shows');key(66);focused('Silo')
|
||||
# The first reachable result must be the exact series, never the unrelated movie row.
|
||||
key(23);text('Seasons');screenshot('030-exact-silo-search')
|
||||
key(4);focused('Silo');key(4);key(4)
|
||||
passed('Silo search enters the exact series first and restores the result on Back')
|
||||
Loading…
Add table
Add a link
Reference in a new issue