This commit is contained in:
Frank Skare
2021-04-30 11:50:41 +02:00
parent d0ad69656a
commit 6e2d11952f
24 changed files with 241 additions and 296 deletions

View File

@@ -95,10 +95,21 @@ namespace RatingExtension // the assembly name must end with 'Extension'
else
{
TimeSpan ts = DateTime.Now - DeleteTime;
if (FileToDelete == core.get_property_string("path") && ts.TotalSeconds < 5 && File.Exists(FileToDelete))
string path = core.get_property_string("path");
if (FileToDelete == path && ts.TotalSeconds < 5 && File.Exists(FileToDelete))
{
core.command("playlist-remove current");
int pos = core.get_property_int("playlist-pos");
if (pos == -1)
{
int count = core.get_property_int("playlist-count");
if (count > 0)
core.set_property_int("playlist-pos", count - 1);
}
Thread.Sleep(2000);
FileSystem.DeleteFile(FileToDelete, UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
}

View File

@@ -13,39 +13,23 @@
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\mpv.net\bin\x86\Extensions\RatingExtension\</OutputPath>
<OutputPath>..\..\mpv.net\bin\Extensions\RatingExtension\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\..\mpv.net\bin\x86\Extensions\RatingExtension\</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>..\..\mpv.net\bin\Extensions\RatingExtension\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\mpv.net\bin\x64\Extensions\RatingExtension\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\..\mpv.net\bin\x64\Extensions\RatingExtension\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>