feat(search): Length, Bitrate and Codec columns in search results - #139
Merged
Conversation
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.
|
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. |
|
Lol, I was one minute late 😂 |
2 tasks
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_CODECtags that ed2k publishers (eMule, eMule AI, aMule with metadata extraction) advertise on shared files. aMule already parsed these tags intoCSearchFilebut never surfaced them.Behaviour
L/B/C.CMuleListCtrl's settings store).*UndefinedAtBottomcomparators established.Formatting
CastSecondsToHM(existing helper). Renders as e.g.1:42 hours/45:30 mins.CFormat("%u kbps"). Renders as e.g.1280 kbps.FormatMediaCodecinOtherFunctions, mapping ~30 common video / audio FOURCC strings to friendlier display names (H264→H.264,XVID→Xvid,HEVC→H.265 / HEVC,MP3→MP3,AC3→AC-3, etc.). Unknown codec IDs pass through unchanged. Mapping inspired by eMule AI'sMediaInfo.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