Skip to content

Commit

Permalink
fix: do the maths client side
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy committed Jul 15, 2024
1 parent 10de453 commit b0aa42c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion comet/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@
return {
indexers: indexers,
maxResults: parseInt(maxResults),
maxSize: parseFloat(maxSize),
maxSize: parseInt(maxSize) * 1073741824,
resolutions: selectedResolutions,
languages: selectedLanguages,
debridService: debridService,
Expand Down
2 changes: 1 addition & 1 deletion comet/utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ async def get_balanced_hashes(hashes: dict, config: dict):
for hash, hash_data in hashes.items():
hash_info = hash_data["data"]

if hash_info["size"] / (1024**3) > max_size and max_size != 0:
if max_size != 0 and hash_info["size"] > max_size:
continue

if (
Expand Down
2 changes: 1 addition & 1 deletion comet/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ConfigModel(BaseModel):
languages: Optional[List[str]] = ["All"]
resolutions: Optional[List[str]] = ["All"]
maxResults: Optional[int] = 0
maxSize: Optional[float] = 0
maxSize: Optional[int] = 0
debridService: str
debridApiKey: str
debridStreamProxyPassword: Optional[str] = ""
Expand Down

0 comments on commit b0aa42c

Please sign in to comment.