Skip to content

feat(webserver): wire up priority selector on shared page - #210

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/issues11
Jun 20, 2026
Merged

feat(webserver): wire up priority selector on shared page#210
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/issues11

Conversation

@ngosang

@ngosang ngosang commented Jun 20, 2026

Copy link
Copy Markdown
Member

The priority dropdown on the shared files page of the default template was dead UI: it only offered Low/Normal/High and its OK button emitted a 'setprio' command that the backend never handled, so nothing was applied.

Template changes (amuleweb-main-shared.php):

  • Expand the selector to the full set of priorities (Auto, Very low, Low, Normal, High, Very high, Release), with Auto as the first option.
  • Wire the 'setprio' action: map the selected label to its priority constant (src/Constants.h) and dispatch the real 'prio' command via amule_do_shared_cmd($hash, 'prio', N).

Priority arrow logic (WebServer.cpp):

  • GetHigherPrioShared/GetLowerPrioShared now walk only the manual scale (Very low <-> Low <-> Normal <-> High <-> Very high <-> Release) with clamped ends; the arrows no longer set or pass through Auto.
  • Raising while in Auto leaves it at High, lowering leaves it at Low. Auto can now only be enabled from the selector, fixing the previous behavior where raising priority in Auto dropped the file to Very low.

The priority dropdown on the shared files page of the default template
was dead UI: it only offered Low/Normal/High and its OK button emitted a
'setprio' command that the backend never handled, so nothing was applied.

Template changes (amuleweb-main-shared.php):
- Expand the selector to the full set of priorities (Auto, Very low, Low,
  Normal, High, Very high, Release), with Auto as the first option.
- Wire the 'setprio' action: map the selected label to its priority
  constant (src/Constants.h) and dispatch the real 'prio' command via
  amule_do_shared_cmd($hash, 'prio', N).

Priority arrow logic (WebServer.cpp):
- GetHigherPrioShared/GetLowerPrioShared now walk only the manual scale
  (Very low <-> Low <-> Normal <-> High <-> Very high <-> Release) with
  clamped ends; the arrows no longer set or pass through Auto.
- Raising while in Auto leaves it at High, lowering leaves it at Low.
  Auto can now only be enabled from the selector, fixing the previous
  behavior where raising priority in Auto dropped the file to Very low.
@ngosang
ngosang merged commit 053d10f into amule-org:master Jun 20, 2026
9 checks passed
@ngosang
ngosang deleted the feature/issues11 branch June 20, 2026 16:59
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