support shortcuts with media file target

This commit is contained in:
stax76
2022-07-11 06:14:01 +02:00
parent f719528017
commit ec17ae8ce9
3 changed files with 14 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
- Creating a playlist from a folder uses absolute normalized paths, non media files are ignored.
- The basic view of the show-info command was removed, the advanced view was enhanced with a General section and the filename.
- Media info titles are shortened if they contain duplicated or obvious information.
- Support of shortcuts (.lnk files) with media file target.
- Fix OSC hide behavior on mouse move.
- MediaInfo v22.06
- libmpv shinchiro 2022-07-02

View File

@@ -1202,8 +1202,11 @@ namespace mpvnet
string ext = file.Ext();
if (ext == "avs")
LoadAviSynth();
switch (ext)
{
case "avs": LoadAviSynth(); break;
case "lnk": file = GetShortcutTarget(file); break;
}
if (ext == "iso")
LoadISO(file);
@@ -1461,6 +1464,13 @@ namespace mpvnet
return name;
}
public static string GetShortcutTarget(string path)
{
Type t = Type.GetTypeFromProgID("WScript.Shell");
dynamic sh = Activator.CreateInstance(t);
return sh.CreateShortcut(path).TargetPath;
}
public void RaiseScaleWindow(float value) => ScaleWindow(value);
public void RaiseWindowScaleNET(float value) => WindowScaleNET(value);

View File

@@ -69,6 +69,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />