Skip to content

Commit

Permalink
feat: environment variable for custom addon ID (ADDON_ID)
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy committed Jul 2, 2024
1 parent 702b424 commit d2b7ee8
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 107 deletions.
1 change: 1 addition & 0 deletions .env-sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ADDON_ID=stremio.comet.fast # for Stremio
FASTAPI_HOST=0.0.0.0
FASTAPI_PORT=8000
FASTAPI_WORKERS=1 # remove to destroy CPU -> max performances
Expand Down
2 changes: 1 addition & 1 deletion comet/api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def configure(request: Request):
@main.get("/{b64config}/manifest.json")
async def manifest():
return {
"id": "stremio.comet.fast",
"id": settings.ADDON_ID,
"version": "1.0.0",
"name": "Comet",
"description": "Stremio's fastest torrent/debrid search add-on.",
Expand Down
1 change: 1 addition & 0 deletions comet/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class AppSettings(BaseSettings):
env_file_encoding="utf-8"
)

ADDON_ID: str = "stremio.comet.fast"
FASTAPI_HOST: str = "0.0.0.0"
FASTAPI_PORT: int = 8000
FASTAPI_WORKERS: int = 2 * (os.cpu_count() or 1)
Expand Down
Loading

0 comments on commit d2b7ee8

Please sign in to comment.