feat(amuleapi): audio/video media metadata over EC, REST, and File Details (#418) - #436
Merged
got3nks merged 2 commits intoJul 11, 2026
Merged
Conversation
…ils (amule-project#418) Part 1 (amuled/EC): six new EC_TAG_KNOWNFILE_MEDIA_* tag codes (0x0410-0x0415, added to ECCodes.h + .abstract + name switch), emitted in the CEC_SharedFile_Tag base ctor from FT_MEDIA_* and guarded by GetMetaDataVer() != 0 so non-media files add no tags. Both /shared and /downloads (partfiles) carry them via the shared base ctor. Part 2 (webapi): decode into a FileSnapshot media sub-struct (has_media gate); emit an inline `media` object {length_s,bitrate,codec,artist, album,title} on GET /downloads/{hash} and GET /shared/{hash}, omitted entirely when the file has no probed metadata. Part 3 (GUI): a new 'Media Info' box in the File Details dialog (fileDetails() + IDC_FD_MEDIA_* ids), populated in CFileDetailDialog::UpdateData() from FT_MEDIA_*; amulegui decodes the Part-1 EC tags into the proxy file via AddTagUnique so the identical GetIntTagValue/GetStrTagValue/GetMetaDataVer calls work in both builds. Layout + styling mirror the ICH box. Reuses existing translatable strings (Length:/Bitrate:/Codec:/Artist:/Album:/Title:/Media Info/N/A) — no new strings, no catalog regen. RefresherTest gains a media decode case; curl 04 asserts media is omitted for unprobed files; REST reference documents the media object.
…roject#418) New translatable strings from the File Details Media Info box: "Media Info", "Length :", "Bitrate :", "Codec :", "Artist :", "Album :" ("Title :" already existed). App catalog only (scripts/update-po.sh); manpage/po4a catalogs untouched.
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.
Implements #418 — the last item in the File-Details cluster and the only one that touches all three layers (EC protocol + webapi + desktop GUI).
Part 1 — amuled / EC protocol
Six new tag codes
EC_TAG_KNOWNFILE_MEDIA_{LENGTH,BITRATE,CODEC,ARTIST,ALBUM,TITLE}(0x0410–0x0415, added toECCodes.h, its name-lookup switch, andECCodes.abstract). Emitted in theCEC_SharedFile_Tagbase ctor from theFT_MEDIA_*tags, guarded byGetMetaDataVer() != 0so non-media files add no tags. Because it's the shared base ctor, both/sharedand/downloads(partfiles) carry them.Part 2 — webapi (amuleapi)
Decoded into a
FileSnapshotmedia sub-struct (with ahas_mediagate) and emitted as an inlinemediaobject{ length_s, bitrate, codec, artist, album, title }onGET /downloads/{hash}andGET /shared/{hash}— omitted entirely when the file has no probed metadata.Part 3 — desktop GUI + amulegui
A new Media Info box in the File Details dialog (layout + styling mirror the ICH box:
label :+HOTLIGHTvalue, two per row), populated inCFileDetailDialog::UpdateData()fromFT_MEDIA_*.amuleguidecodes the Part-1 EC tags into the proxy file viaAddTagUnique(CTagInt32/CTagString(FT_MEDIA_*, …)), so the identicalGetIntTagValue/GetStrTagValue/GetMetaDataVercalls work in both the monolithic and remote builds — no build-specific display code.Tests / docs / i18n
RefresherTest.MediaMetadataDecode(37 cases green); curl04assertsmediais omitted for unprobed files (verified live).mediaobject.Media Info+ labels); manpage/po4a catalogs untouched.amule,amulegui,amuleapiall link.Note: File Details is a downloads-only dialog in aMule (no shared-file variant), so the desktop Media Info box shows for downloads; completed-shared-file media is exposed via
GET /shared/{hash}and Kad search results.