Files
patcher/patches/todo_custom_speed.py

26 lines
627 B
Python

"""
Добавляет пользовательские скорости воспроизведения видео
"custom_speed": {
"speeds": [9.0]
}
"""
priority = 0
from utils.smali_parser import float_to_hex
from utils.public import (
insert_after_public,
insert_after_id,
)
def apply(config: dict) -> bool:
assert float_to_hex(1.5) == "0x3fc00000"
last = "speed75"
for speed in config.get("speeds", []):
insert_after_public(last, f"speed{int(float(speed)*10)}")
insert_after_id(last, f"speed{int(float(speed)*10)}")
last = f"speed{int(float(speed)*10)}"
return False