Skip to content

feat(amuleapi): audio/video media metadata over EC, REST, and File Details (#418) - #436

Merged
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:feat/webapi-media-metadata-418
Jul 11, 2026
Merged

feat(amuleapi): audio/video media metadata over EC, REST, and File Details (#418)#436
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:feat/webapi-media-metadata-418

Conversation

@got3nks

@got3nks got3nks commented Jul 11, 2026

Copy link
Copy Markdown

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} (0x04100x0415, added to ECCodes.h, its name-lookup switch, and ECCodes.abstract). Emitted in the CEC_SharedFile_Tag base ctor from the FT_MEDIA_* tags, guarded by GetMetaDataVer() != 0 so non-media files add no tags. Because it's the shared base ctor, both /shared and /downloads (partfiles) carry them.

Part 2 — webapi (amuleapi)

Decoded into a FileSnapshot media sub-struct (with a has_media gate) and emitted as 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 — desktop GUI + amulegui

A new Media Info box in the File Details dialog (layout + styling mirror the ICH box: label : + HOTLIGHT value, two per row), populated in CFileDetailDialog::UpdateData() from FT_MEDIA_*. amulegui decodes the Part-1 EC tags into the proxy file via AddTagUnique(CTagInt32/CTagString(FT_MEDIA_*, …)), so the identical GetIntTagValue/GetStrTagValue/GetMetaDataVer calls work in both the monolithic and remote builds — no build-specific display code.

Tests / docs / i18n

  • RefresherTest.MediaMetadataDecode (37 cases green); curl 04 asserts media is omitted for unprobed files (verified live).
  • REST reference documents the media object.
  • App catalogs regenerated for the new box strings (Media Info + labels); manpage/po4a catalogs untouched.
  • Builds validated: monolithic amule, amulegui, amuleapi all 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.

got3nks added 2 commits July 11, 2026 11:38
…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.
@got3nks
got3nks merged commit 2b6ffd2 into amule-org:master Jul 11, 2026
13 checks passed
@got3nks
got3nks deleted the feat/webapi-media-metadata-418 branch July 11, 2026 10:02
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