Repository navigation
ALI-2360: Media Viewer: list and play the video and music types in the desktop file - #11
Conversation
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.
|
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
|
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.
|
Review round 2 (fresh reviewer, code-review at high), on c0ad5b2. The reviewer confirmed the README sentence from round 1 holds:
Checks on d3833cc: |
|
Review round 3 (fresh reviewer, code-review at high), on d3833cc: clean. The reviewer confirmed |
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.
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.
|
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
|
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.desktopMimeType=lists video and music types as well as pictures, so "Open with" offers Alias View for them, andxdg-opencan use it once aliasOS makes it the default.Name,GenericNameandCommentchanged.CategorieskeepsGraphics;Viewer;and addsAudioVideo;Audio;Video;Player;.Keywordskeeps the picture words and adds video, movie, music, song and player.src/player/mod.rs:VIDEOandMUSICalso 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.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.video/mp4video/quicktimevideo/vnd.avivideo/mpegvideo/mpegvideo/3gppvideo/3gpp2audio/mpegaudio/mp2(alsovideo/mpeg)audio/mp4audio/aacaudio/x-speex+oggaudio/x-wavpackvideo/3gppaudio/mp2). .3ga is the sound-only 3GPP name phone recorders use, andaudio/3gppis an alias ofvideo/3gpp. As music they get the music view and play on to the next song.text/x-ssa(weight 50) as well asaudio/aac(weight 10), so .ass files are typed as subtitles.audio/aacstays listed for .aac and .adts.video/quicktimestays listed for .mov, .qt and .moov.NNN.vdrname pattern ofvideo/mpegwould need its own case inkind_of_name.application/x-sony-bbeb, weight 50 againstvideo/mp4's 60). An e-book named .lrf in a folder now lists as a video and fails to play.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 andNNN.vdr.video/mp4,video/x-m4vvideo/matroska,video/x-matroskavideo/webmvideo/quicktimevideo/vnd.avi,video/x-msvideo,video/avivideo/x-flvvideo/x-ms-wmvvideo/mpegvideo/ogg,video/x-theora+oggvideo/x-ogm+oggvideo/3gppvideo/3gpp2application/vnd.ms-asf,video/x-ms-asfaudio/mpeg,audio/mp3,audio/x-mp3audio/mp2,audio/x-mp2audio/flac,audio/x-flacaudio/ogg,audio/x-vorbis+ogg,audio/x-flac+ogg,audio/x-opus+ogg,audio/x-speex+oggaudio/mp4,audio/x-m4aaudio/aac,audio/x-aacaudio/vnd.wave,audio/wav,audio/x-wavaudio/x-ms-wmaaudio/x-aiffaudio/matroska,audio/x-matroskaaudio/x-wavpackaudio/x-apeThe aliases include the names aliasOS's
mimetypes.shuses 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/oggis left out because its only extension, .ogx, isn't accepted.For the aliasOS PR
aliasOS's
test/shell.d/alias-view-migration-test.shcompares the typesmimetypes.shgives Alias View with this desktop file's wholeMimeType=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./usr/share/mime/packages/freedesktop.org.xmlandVIDEO/MUSICin both directions.XDG_*directories,update-desktop-databaseandgio mimelist Alias View for the video and audio types.make check(131 + 6 tests) andcargo +1.100 clippy --all-targets --locked -- -D warningspass.kind_of_name's new test fails without the extension change.