Skip to content

feat(search): Length, Bitrate and Codec columns in search results - #139

Merged
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:feat/search-media-columns
Jun 13, 2026
Merged

feat(search): Length, Bitrate and Codec columns in search results#139
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:feat/search-media-columns

Conversation

@got3nks

@got3nks got3nks commented Jun 13, 2026

Copy link
Copy Markdown

Summary

Closes #136. Adds three new columns to the search results — Length, Bitrate, Codec — populated from the existing FT_MEDIA_LENGTH / FT_MEDIA_BITRATE / FT_MEDIA_CODEC tags that ed2k publishers (eMule, eMule AI, aMule with metadata extraction) advertise on shared files. aMule already parsed these tags into CSearchFile but never surfaced them.

Behaviour

  • Three columns inserted after Directories with single-character persistence keys L / B / C.
  • Cells stay empty for non-media results or for files whose owner didn't populate the tag.
  • Toggle-able via the existing right-click column-header menu — users can hide any of the new columns and the choice persists across restarts (CMuleListCtrl's settings store).
  • Sort handlers treat files without the tag as "undefined at bottom" — empties always cluster at the end of the list regardless of ascending/descending direction, matching the convention eMule AI's *UndefinedAtBottom comparators established.

Formatting

  • LengthCastSecondsToHM (existing helper). Renders as e.g. 1:42 hours / 45:30 mins.
  • BitrateCFormat("%u kbps"). Renders as e.g. 1280 kbps.
  • Codec — new helper FormatMediaCodec in OtherFunctions, mapping ~30 common video / audio FOURCC strings to friendlier display names (H264H.264, XVIDXvid, HEVCH.265 / HEVC, MP3MP3, AC3AC-3, etc.). Unknown codec IDs pass through unchanged. Mapping inspired by eMule AI's MediaInfo.cpp (GPL v2+); implementation rewritten for wx.

Scope

Consumer-only: aMule displays what other clients advertise. Phase B (extracting metadata from aMule's own shared files via libavformat / ffprobe and advertising it onto the network) is a separate, larger effort with dependency implications and is not part of this PR.

Test plan

  • macOS arm64 build clean; manual smoke test against a live server search for "film" — Length / Bitrate / Codec columns visible, populated for matches that carry the tags, empty for the rest.
  • Sort ascending and descending on each of the three new columns — undefined-tag rows correctly clustered at the bottom of the list in both directions.
  • Right-click column header → toggle each new column hidden / visible.
  • CI build matrix.

ed2k publishers (eMule, eMule AI, aMule with metadata extraction)
advertise per-file media metadata via FT_MEDIA_LENGTH (uint32 seconds),
FT_MEDIA_BITRATE (uint32 kbps) and FT_MEDIA_CODEC (string FOURCC).
aMule already parsed these tags into CSearchFile but never surfaced
them in the search results list.

Add three columns to SearchListCtrl after Directories: Length,
Bitrate, Codec. Cells stay empty for non-media results or for files
whose owner didn't populate the tag. Columns are toggle-able via the
existing right-click column-header menu (single-character persistence
keys L / B / C) and their widths persist alongside the existing
columns through CMuleListCtrl's settings store.

Sort handlers treat files without the tag as "undefined at bottom" —
they cluster at the end of the list in both ascending and descending
order, so sorting by Length never puts empty cells above real values.

New helper FormatMediaCodec(const wxString&) in OtherFunctions maps
common video / audio FOURCC strings ("H264", "XVID", "MP3", "AC3",
"HEVC", ...) to friendlier display names ("H.264", "Xvid", "MP3",
"AC-3", "H.265 / HEVC", ...). Unknown codec IDs pass through
unchanged so something useful still shows. Mapping inspired by eMule
AI's MediaInfo.cpp (GPL v2+); implementation rewritten for wx.

Closes amule-project#136.
@got3nks
got3nks merged commit 9091d48 into amule-org:master Jun 13, 2026
9 checks passed
@got3nks
got3nks deleted the feat/search-media-columns branch June 13, 2026 09:02
@danim7

danim7 commented Jun 13, 2026

Copy link
Copy Markdown

Nice! May I ask to put the Directories column at the end? That column is almost always empty, I think it is only populated when retrieving the shared list from another peer, and it is very rare for someone to share it nowadays.

@danim7

danim7 commented Jun 13, 2026

Copy link
Copy Markdown

Lol, I was one minute late 😂

@got3nks

got3nks commented Jun 13, 2026

Copy link
Copy Markdown
Author

Good call — Directories is empty for the vast majority of search results today, so clustering it next to the also-often-empty media columns reads better. Will reorder in a small follow-up.

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.

Add Bitrate / Length / Codec / etc... to Search Results

2 participants