Skip to content

fix(webserver): correct MByte/GByte multipliers in search size filters - #76

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/search-size-multipliers
Jun 11, 2026
Merged

fix(webserver): correct MByte/GByte multipliers in search size filters#76
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/search-size-multipliers

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

str2mult() in the default template's search page converted the min/max size filter units using 10121024 for MByte and 101210241024 for GByte instead of 10241024 and 102410241024, a typo that made every size-filtered search off by ~1.2%. A search filtered to "min 700 MByte" actually asked the core for files >= 726,663,168 bytes instead of 734,003,200, silently excluding or including files near the boundary.

Use the correct power-of-two multipliers so the filter matches the units shown in the search form.

str2mult() in the default template's search page converted the min/max
size filter units using 1012*1024 for MByte and 1012*1024*1024 for
GByte instead of 1024*1024 and 1024*1024*1024, a typo that made every
size-filtered search off by ~1.2%. A search filtered to "min 700 MByte"
actually asked the core for files >= 726,663,168 bytes instead of
734,003,200, silently excluding or including files near the boundary.

Use the correct power-of-two multipliers so the filter matches the
units shown in the search form.
@ngosang
ngosang merged commit 7cbd1a8 into amule-org:master Jun 11, 2026
9 checks passed
@ngosang
ngosang deleted the fix/search-size-multipliers branch June 11, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant