Skip to content

Commit

Permalink
fix: update attribute list and PA codename mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
seppzer0 committed Feb 19, 2024
1 parent 7541cab commit 50b28d5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions wrapper/clients/pa.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import override

from wrapper.clients.rom_api import RomApi


Expand All @@ -7,3 +9,13 @@ class ParanoidAndroidApi(RomApi):
endpoint: str = "https://api.paranoidandroid.co/updates/{}"
json_key: str = "updates"
rom_name: str = "PA"

@override
@property
def codename_mapper(self) -> str:
# specific rules for PA's API
specials = {
"dumpling": "oneplus5t",
"cheeseburger": "oneplus5",
}
return specials[self.codename] if self.codename in specials else self.codename
1 change: 1 addition & 0 deletions wrapper/clients/rom_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class RomApi(BaseModel, IRomApi):
json_key: str
rom_name: str
codename: str
rom_only: bool

def __init__(self, **data) -> None:
super().__init__(**data)
Expand Down
4 changes: 2 additions & 2 deletions wrapper/modules/assets_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def run(self) -> None:
rom_collector_dto = ""
match self.base:
case "los":
rom_collector_dto = LineageOsApi(codename=self.codename)
rom_collector_dto = LineageOsApi(codename=self.codename, rom_only=self.rom_only)
case "pa":
rom_collector_dto = ParanoidAndroidApi(codename=self.codename)
rom_collector_dto = ParanoidAndroidApi(codename=self.codename, rom_only=self.rom_only)
case "x" | "aosp":
msg.note("Selected kernel base is ROM-universal, no specific ROM image will be collected")
# process the "ROM-only" download for non-universal kernel bases
Expand Down

0 comments on commit 50b28d5

Please sign in to comment.