Skip to content

Commit

Permalink
Cleaned the code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad-qamar committed Aug 28, 2022
1 parent 8573b00 commit d0b7c57
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
22 changes: 0 additions & 22 deletions Soundtrack Finder/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ private void readAudioFiles()
{
try
{
/*var metadata = MetadataExtractor.Formats.Mpeg.Mp3MetadataReader
.ReadMetadata(new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));*/

AudioFiles.Add((file, TagLib.File.Create(file).Properties.Duration));
}
catch { }
Expand All @@ -82,7 +79,6 @@ void filterAndDisplaySongs()
{
try
{
int iterations = 0;
var allowedOffset = TimeSpan.FromSeconds(dateTimePicker2.Value.Second + (dateTimePicker2.Value.Minute * 60)).Ticks;
var requiredDuration = TimeSpan.FromSeconds(dateTimePicker1.Value.Second + (dateTimePicker1.Value.Minute * 60)).Ticks;

Expand Down Expand Up @@ -115,24 +111,6 @@ void filterAndDisplaySongs()
{ }
}

/*
trackIndexes[x] = t;
trackBuffer.Clear();
trackBuffer = trackIndexes.Select(d => AudioFiles[d]).ToList();
var duration = trackBuffer.Sum(d => d.Item2.Ticks);
Console.WriteLine($"[{string.Join(", ", trackIndexes)}]");
if (trackIndexes.Length != trackIndexes.Distinct().Count()) continue;
if (((requiredDuration + allowedOffset >= duration) && (requiredDuration - allowedOffset <= duration)))
{
tracksFound.AddRange(trackBuffer.Select(d => (d.Item1, d.Item2.ToString("mm\\:ss"))));
tracksFound.Add(("", ""));
}
*/

dataGridView1.Rows.Clear();
dataGridView1.Rows.AddRange(tracksFound.Select(t =>
{
Expand Down
27 changes: 27 additions & 0 deletions Soundtrack Finder/Soundtrack Finder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -96,5 +111,17 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

0 comments on commit d0b7c57

Please sign in to comment.