diff --git a/Changelog.md b/Changelog.md index 448f7d9..c34091a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,8 @@ ### 4.7.3 - fix cursor showing load activity on startup -- added file size to info command using audio files +- added file size and type to info command using audio files +- added image format support for the info command ### 4.7.1 diff --git a/mpv.net/Misc/Command.cs b/mpv.net/Misc/Command.cs index 2d1d8ae..5a07489 100644 --- a/mpv.net/Misc/Command.cs +++ b/mpv.net/Misc/Command.cs @@ -109,7 +109,22 @@ namespace mpvnet if (genre != "") text += "Genre: " + genre + "\n"; if (date != "") text += "Year: " + date + "\n"; if (duration != "") text += "Length: " + duration + "\n"; - text += "Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String"); + text += "Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String") + "\n"; + text += "Type: " + Path.GetExtension(path).ToUpper().TrimStart('.'); + + mp.commandv("show-text", text, "5000"); + return; + } + } + else if (App.ImageTypes.Contains(Path.GetExtension(path).ToLower().TrimStart('.'))) + { + using (MediaInfo mediaInfo = new MediaInfo(path)) + { + text = + "Width: " + mediaInfo.GetInfo(MediaInfoStreamKind.Image, "Width") + "\n" + + "Height: " + mediaInfo.GetInfo(MediaInfoStreamKind.Image, "Height") + "\n" + + "Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String") + "\n" + + "Type: " + Path.GetExtension(path).ToUpper().TrimStart('.'); mp.commandv("show-text", text, "5000"); return;