Filter layout IDs based on author or device brand for better compatibility

This commit is contained in:
Hoang Hong Quan
2024-10-17 02:37:26 +07:00
parent e0bf924f79
commit c9a112ef49
2 changed files with 2588 additions and 642 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -421,7 +421,9 @@ class ConfigProdigy:
if hardware_report.get("Sound"):
codec_id = list(hardware_report.get("Sound").items())[0][-1].get("Device ID")
if codec_id in codec_layouts.data:
boot_args.append("alcid={}".format(random.choice(codec_layouts.data.get(codec_id))))
recommended_authors = ("Mirone", "InsanelyDeepak", "Toleda", "DalianSky")
recommended_layouts = [layout for layout in codec_layouts.data.get(codec_id) if self.utils.contains_any(recommended_authors, layout.comment) or hardware_report.get("Motherboard").get("Name").split(" ")[0].lower() in layout.comment.lower()]
boot_args.append("alcid={}".format(random.choice((recommended_layouts or codec_layouts.data.get(codec_id))).id))
elif kext.name == "VoodooI2C":
boot_args.append("-vi2c-force-polling")
elif kext.name == "CpuTopologyRebuild":