support shortcuts with media file target
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
|
||||
Reference in New Issue
Block a user