Skip to content

ALI-2360: Media Viewer: list and play the video and music types in the desktop file - #11

Merged
michaelaguiar merged 5 commits into
mainfrom
ali-2360-media-mimetypes
Dec 3, 2026
Merged

michaelaguiar merged 5 commits into
mainfrom
ali-2360-media-mimetypes

Conversation

@michaelaguiar

@michaelaguiar michaelaguiar commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Part of ALI-2360 (Alias View as aliasOS's video and music player). This is the alias-view part only. The aliasOS side (mimetypes.sh defaults, removing mpv) is a separate PR after an alias-view release.

What changes

  • packaging/com.aliasproject.view.desktop
    • MimeType= lists video and music types as well as pictures, so "Open with" offers Alias View for them, and xdg-open can use it once aliasOS makes it the default.
    • The entry is now Media Viewer, the launcher name Omarchy's Omaview uses for pictures, video and music: Name, GenericName and Comment changed.
    • Categories keeps Graphics;Viewer; and adds AudioVideo;Audio;Video;Player;.
    • Keywords keeps the picture words and adds video, movie, music, song and player.
  • src/player/mod.rs: VIDEO and MUSIC also accept the other extensions that shared-mime-info gives the listed types. Before this, "Open with" could hand over a .vob or a .qt, and it failed as a picture. A new test covers them, and it failed before the change.
  • README, the crate description and main.rs's doc: they describe a media viewer and list every accepted extension. The binary, the app id (com.aliasproject.view) and the repo keep their names.

Extensions

The player tells video from music by extension. Each new extension was checked with a generated sample through the local libmpv (mpv 0.42 with --vo=null --ao=null, nothing on screen) and ffmpeg n9.1; each demuxed and decoded.

New extension Kind Sample shared-mime-info type
f4v, lrv, lrf video H.264 + AAC in MP4 video/mp4
qt, moov video H.264 + AAC in QuickTime video/quicktime
divx, avf video MPEG-4 part 2 + MP3 in AVI video/vnd.avi
vob video MPEG-2 + AC-3 in MPEG-PS video/mpeg
mpe video MPEG-1 + MP2 in MPEG-PS video/mpeg
3gpp video H.263 + AMR-NB in 3GP video/3gpp
3gp2, 3gpp2 video H.264 + AAC in 3G2 video/3gpp2
mpga music MP3 audio/mpeg
mp2 music MPEG-1 Layer II audio/mp2 (also video/mpeg)
f4a music AAC in MP4 audio/mp4
adts music AAC (ADTS) audio/aac
spx music Speex in Ogg audio/x-speex+ogg
wvp music WavPack audio/x-wavpack
3ga music AMR-NB in 3GP, no video video/3gpp
  • .mp2 and .3ga are music, not video. .mp2 is nearly always MPEG audio (GIO types the sample audio/mp2). .3ga is the sound-only 3GPP name phone recorders use, and audio/3gpp is an alias of video/3gpp. As music they get the music view and play on to the next song.
  • Left out:
    • .ass is a subtitle file. shared-mime-info gives it text/x-ssa (weight 50) as well as audio/aac (weight 10), so .ass files are typed as subtitles. audio/aac stays listed for .aac and .adts.
    • .qtvr is QuickTime VR, panoramas and object movies, which libmpv can't show as they're meant to be. video/quicktime stays listed for .mov, .qt and .moov.
    • The NNN.vdr name pattern of video/mpeg would need its own case in kind_of_name.
  • Other types on the same names:
    • .lrf is also a Sony BBeB e-book (application/x-sony-bbeb, weight 50 against video/mp4's 60). An e-book named .lrf in a folder now lists as a video and fails to play.
    • .spx is also raw Speex (audio/x-speex), which ffmpeg has no demuxer for. Neither type is listed.

All accepted extensions: video mp4, m4v, f4v, lrv, lrf, mkv, webm, mov, qt, moov, avi, divx, avf, flv, wmv, mpeg, mpg, mpe, vob, ogv, ogm, 3gp, 3gpp, 3g2, 3gp2, 3gpp2, asf. Music mp3, mpga, mp2, flac, ogg, oga, opus, spx, m4a, f4a, aac, adts, wav, wma, aif, aiff, mka, wv, wvp, ape, 3ga.

MIME types

Each type is a shared-mime-info (2.5.1) type that files with an accepted extension are given, or an alias that shared-mime-info defines for it. For .ogg, .oga, .opus and .spx, the codec types (+ogg) are told apart by the file's contents. Every accepted extension's media type is listed. The only extensions of a listed type that aren't accepted are .ass, .qtvr and NNN.vdr.

Extensions Types
mp4, m4v, f4v, lrv, lrf video/mp4, video/x-m4v
mkv video/matroska, video/x-matroska
webm video/webm
mov, qt, moov video/quicktime
avi, divx, avf video/vnd.avi, video/x-msvideo, video/avi
flv video/x-flv
wmv video/x-ms-wmv
mpeg, mpg, mpe, vob video/mpeg
ogv, ogg video/ogg, video/x-theora+ogg
ogm video/x-ogm+ogg
3gp, 3gpp, 3ga video/3gpp
3g2, 3gp2, 3gpp2 video/3gpp2
asf application/vnd.ms-asf, video/x-ms-asf
mp3, mpga audio/mpeg, audio/mp3, audio/x-mp3
mp2 audio/mp2, audio/x-mp2
flac audio/flac, audio/x-flac
ogg, oga, opus, spx audio/ogg, audio/x-vorbis+ogg, audio/x-flac+ogg, audio/x-opus+ogg, audio/x-speex+ogg
m4a, f4a audio/mp4, audio/x-m4a
aac, adts audio/aac, audio/x-aac
wav audio/vnd.wave, audio/wav, audio/x-wav
wma audio/x-ms-wma
aif, aiff audio/x-aiff
mka audio/matroska, audio/x-matroska
wv, wvp audio/x-wavpack
ape audio/x-ape

The aliases include the names aliasOS's mimetypes.sh uses today (video/x-matroska, video/x-msvideo, video/x-ms-asf), so the later aliasOS PR can point the same names at Alias View. application/ogg is left out because its only extension, .ogx, isn't accepted.

For the aliasOS PR

aliasOS's test/shell.d/alias-view-migration-test.sh compares the types mimetypes.sh gives Alias View with this desktop file's whole MimeType= list. It does that only when an alias-view checkout sits beside the aliasOS one, so CI skips it. With this PR the desktop file also lists video and music, so that check fails until the aliasOS PR sends the same types to Alias View, or compares only the picture types.

Checks

  • desktop-file-validate: no errors or warnings. It prints one hint, which the categories make expected: more than one main category (Graphics and AudioVideo), so the app may appear under both in a category menu.
  • Type list: a script checked the list against /usr/share/mime/packages/freedesktop.org.xml and VIDEO/MUSIC in both directions.
  • Handler lookup: with throwaway XDG_* directories, update-desktop-database and gio mime list Alias View for the video and audio types.
  • Rust: make check (131 + 6 tests) and cargo +1.100 clippy --all-targets --locked -- -D warnings pass. kind_of_name's new test fails without the extension change.

Alias View plays video and music since ALI-2358, but its desktop file still
listed only picture types, so "Open with" and xdg-open never offered it for
them. MimeType= now also lists the shared-mime-info type of every extension
the player accepts (VIDEO and MUSIC in src/player/mod.rs), with the common
aliases shared-mime-info defines. The README's format list now matches the
code (mpg, ogm, 3g2, oga and aif were missing).
The desktop file's types also cover extensions the player doesn't accept
(.vob, .qt, .f4v and others). Such a file opens as a picture and fails,
and the README now says so.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 1 (fresh reviewer, code-review at high), on 5ae7d59.

The reviewer confirmed: every listed type exists in shared-mime-info 2.5.1 as a type or alias, each maps to an extension the player accepts, all 29 accepted extensions are covered, the speex and application/ogg omissions are right, and the README lists match VIDEO and MUSIC. No P1 or P2 findings.

  • Known gap list incomplete (P3): fixed in the PR description. Added .lrf, .qtvr, .3ga, .3gpp2 and .ass, with a note that .ass clashes with the subtitle type and the file's contents decide.
  • README doesn't say what happens to a listed type's other extensions (P3): fixed in c0ad5b2.
  • BRIEF.md still says video and audio stay with mpv (P3): declined. BRIEF.md is the original v0.1 design brief and is kept as written; the README describes the app as it is.
  • Name, Comment, Categories and Keywords still describe a picture viewer (P3): waiting on Mike. The ticket asks for the MIME types only, and renaming the entry or adding AudioVideo;Player; changes how it shows in the app launcher, so that's his call.
  • Some aliases left out (audio/x-ogg, video/x-ogg, audio/x-mpeg and others) (P3): declined. GIO and xdg-mime resolve an alias to its canonical type before looking up handlers, so the canonical types already cover them. The aliases listed are the older canonical names that other tools still write (video/x-matroska, video/x-msvideo, audio/x-wav, audio/x-flac and the names aliasOS's mimetypes.sh uses).
  • No test keeps the desktop file in step with VIDEO and MUSIC (P3): declined for this PR. The repo has no packaging tests, and this PR doesn't start one. A unit test that reads the desktop file with include_str! would do it if wanted later.

Speex in an .ogg or .oga file, which the player accepts and plays, is given
audio/x-speex+ogg, so it belongs in the list like the other Ogg codecs.
The Ogg codec types come from a file's contents, not its name, and the
comment now says so.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 2 (fresh reviewer, code-review at high), on c0ad5b2.

The reviewer confirmed the README sentence from round 1 holds: kind_of_name goes only by extension, a file named on the command line is kept whatever its extension, and the app sends it to the picture decoder when kind_of is None. No P1 or P2 findings.

  • audio/x-speex+ogg left out for the wrong reason (P3): fixed in d3833cc. Round 1 accepted the description's claim that its only extension is .spx, which was a reversal of the right call. shared-mime-info also gives it .ogg and .oga (sniffed from contents), both of which the player accepts and plays, so it's now listed like the other Ogg codec types. .spx joins the known-gap list.
  • Known-gap list misses video/mpeg's [0-9][0-9][0-9].vdr pattern (P3): fixed in the PR description.
  • Desktop file comment says every type is an extension's type, but the Ogg codec types come from contents (P3): fixed in d3833cc.
  • The reviewer's code-review pass re-raised the round 1 declines with no new argument; they stand. It also noted that without an aliasOS default, desktop-file order decides which app opens audio: that's for the aliasOS PR, which sets the defaults.

Checks on d3833cc: desktop-file-validate passes. Only the desktop file and README changed, so the Rust checks from the first push still apply.

@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 3 (fresh reviewer, code-review at high), on d3833cc: clean. The reviewer confirmed audio/x-speex+ogg maps to the accepted .ogg and .oga, the desktop file's comment and the description's table, "Left out on purpose" and "Known gap" match shared-mime-info and VIDEO/MUSIC, and desktop-file-validate passes. One wording nit on the description (the +ogg types also carry globs) is declined: the desktop file's comment already words it exactly. The code-review pass re-raised earlier declines and the documented known gap with no new argument.

The desktop file's types also cover extensions the player didn't accept
(.vob, .qt, .f4v and others), so "Open with" handed those files over and
they failed as pictures. The player now accepts them: .f4v, .lrv, .lrf,
.qt, .moov, .divx, .avf, .vob, .mpe, .3gpp, .3gp2 and .3gpp2 as video, and
.mpga, .mp2, .f4a, .adts, .spx, .wvp and .3ga as music. Each was checked
with a sample through the local libmpv and ffmpeg. .mp2 brings audio/mp2
into the desktop file. .ass (a subtitle name), .qtvr (QuickTime VR) and the
NNN.vdr pattern stay out.

The desktop entry is now "Media Viewer", the name Omarchy's Omaview uses,
with categories and keywords for video and music as well as pictures. The
README, the crate description and main.rs's doc say the same.
@michaelaguiar michaelaguiar changed the title ALI-2360: List the video and music MIME types in the desktop file ALI-2360: Media Viewer: list and play the video and music types in the desktop file Dec 3, 2026
xdg-open uses Alias View only once it's the default for a type, which the
aliasOS side sets; "Open with" offers it now. The desktop file's comment
names the few covered names that aren't played (.ass, .qtvr, NNN.vdr).
The Wayland module's doc and the README's opening say media viewer.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Round 4 (fresh reviewer, code-review at high), on f9b6f36: the Media Viewer name and the extra extensions Mike asked for.

The reviewer found no code defects. It confirmed the MIME-to-extension mapping, that desktop-file-validate prints only the expected "more than one main category" hint, and that the player tests pass.

  • aliasOS's migration test fails against the new MimeType= list (P2): redirected to the aliasOS PR. test/shell.d/alias-view-migration-test.sh compares mimetypes.sh's Alias View types with the whole desktop-file list, and only when an alias-view checkout sits beside aliasOS (CI has none). The aliasOS PR that sends video and music to Alias View has to update that comparison. The PR description now says so. This repo needs no change.
  • README overclaimed xdg-open (P3): fixed in a9a3dd9. xdg-open uses Alias View once aliasOS makes it the default.
  • The desktop file's comment didn't say which covered names aren't played (P3): fixed in a9a3dd9. They are .ass, .qtvr and NNN.vdr.
  • src/wl.rs:2 still said "picture viewer" (P3): fixed in a9a3dd9.
  • README opening wrapped unevenly (P3): fixed in a9a3dd9.
  • A Sony e-book named .lrf in a folder lists as a video (P3): declined. It's documented in the PR, .lrf is a name the brief asked for, and shared-mime-info ranks it as video/mp4 first.

@michaelaguiar
michaelaguiar marked this pull request as ready for review December 3, 2026 02:57
@michaelaguiar
michaelaguiar merged commit 484fcbc into main Dec 3, 2026
2 checks passed
@michaelaguiar
michaelaguiar deleted the ali-2360-media-mimetypes branch December 3, 2026 04:04
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