Skip to content

Commit

Permalink
Merge pull request #207 from NeoCoderMatrix86/v3.x
Browse files Browse the repository at this point in the history
V3.x
  • Loading branch information
NeoCoderMatrix86 authored Aug 30, 2022
2 parents 859276a + 9b032ab commit a8bd491
Show file tree
Hide file tree
Showing 180 changed files with 5,417 additions and 4,556 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.104'
dotnet-version: '6.0.202'

# Only publish when unit tests are ok
- name: Run Unit Tests
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Run unit tests
# Run workflow on every push to the master branch
on:
push:
branches: [ master ]
pull_request:
types: [opened, reopened]

Expand All @@ -20,12 +19,8 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.104'
dotnet-version: '6.0.202'

# Only publish when unit tests are ok
- name: Run Unit Tests
run: dotnet test

# publishes Blazor project to the release-folder
- name: Publish .NET Core Project
run: dotnet publish --no-restore AudioCuesheetEditor/AudioCuesheetEditor.csproj -c Release -o release --nologo
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
**/bin
**/obj
**/.vs
*.user
31 changes: 13 additions & 18 deletions AudioCuesheetEditor.sln
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
# Visual Studio Version 17
VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AudioCuesheetEditor", "AudioCuesheetEditor\AudioCuesheetEditor.csproj", "{F7214F5E-2752-4639-B2CA-07816BC74E1E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AudioCuesheetEditor", "AudioCuesheetEditor\AudioCuesheetEditor.csproj", "{099AE4DF-4847-460F-BBF2-207B9A35B58D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AudioCuesheetEditorTests", "AudioCuesheetEditorTests\AudioCuesheetEditorTests.csproj", "{221791A7-460D-46BD-B61D-50E120B3028B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6FD4F2C7-3121-40EF-A431-2A61FF6CACEC}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AudioCuesheetEditorTests", "AudioCuesheetEditorTests\AudioCuesheetEditorTests.csproj", "{12CA5D1F-D758-4016-85D0-A045AC06CFE6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F7214F5E-2752-4639-B2CA-07816BC74E1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7214F5E-2752-4639-B2CA-07816BC74E1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7214F5E-2752-4639-B2CA-07816BC74E1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7214F5E-2752-4639-B2CA-07816BC74E1E}.Release|Any CPU.Build.0 = Release|Any CPU
{221791A7-460D-46BD-B61D-50E120B3028B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{221791A7-460D-46BD-B61D-50E120B3028B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{221791A7-460D-46BD-B61D-50E120B3028B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{221791A7-460D-46BD-B61D-50E120B3028B}.Release|Any CPU.Build.0 = Release|Any CPU
{099AE4DF-4847-460F-BBF2-207B9A35B58D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{099AE4DF-4847-460F-BBF2-207B9A35B58D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{099AE4DF-4847-460F-BBF2-207B9A35B58D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{099AE4DF-4847-460F-BBF2-207B9A35B58D}.Release|Any CPU.Build.0 = Release|Any CPU
{12CA5D1F-D758-4016-85D0-A045AC06CFE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{12CA5D1F-D758-4016-85D0-A045AC06CFE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{12CA5D1F-D758-4016-85D0-A045AC06CFE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{12CA5D1F-D758-4016-85D0-A045AC06CFE6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {205FE004-7363-4F4C-8507-1F6B7801C896}
SolutionGuid = {225C235E-EA31-4C24-9DBC-8DAE6167090F}
EndGlobalSection
EndGlobal
6 changes: 4 additions & 2 deletions AudioCuesheetEditor/App.razor
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Router AppAssembly="@typeof(Program).Assembly">
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
60 changes: 38 additions & 22 deletions AudioCuesheetEditor/AudioCuesheetEditor.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
<RazorLangVersion>3.0</RazorLangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PackageProjectUrl>https://github.com/NeoCoderMatrix86/AudioCuesheetEditor</PackageProjectUrl>
<RazorLangVersion>3.0</RazorLangVersion>
<Version>2.8.0</Version>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>

<ItemGroup>
<Content Remove="Resources\Localization\About\de.json" />
<Content Remove="Resources\Localization\About\en.json" />
<Content Remove="Resources\Localization\AudioPlayer\de.json" />
<Content Remove="Resources\Localization\AudioPlayer\en.json" />
<Content Remove="Resources\Localization\CatalogueNumber\de.json" />
<Content Remove="Resources\Localization\CatalogueNumber\en.json" />
<Content Remove="Resources\Localization\ErrorReport\de.json" />
<Content Remove="Resources\Localization\ErrorReport\en.json" />
<Content Remove="Resources\Localization\CuesheetData\de.json" />
<Content Remove="Resources\Localization\CuesheetData\en.json" />
<Content Remove="Resources\Localization\ExportProfilesDialog\de.json" />
<Content Remove="Resources\Localization\ExportProfilesDialog\en.json" />
<Content Remove="Resources\Localization\MainLayout\de.json" />
<Content Remove="Resources\Localization\MainLayout\en.json" />
<Content Remove="Resources\Localization\ModalDialog\de.json" />
<Content Remove="Resources\Localization\ModalDialog\en.json" />
<Content Remove="Resources\Localization\OptionsDialog\de.json" />
<Content Remove="Resources\Localization\OptionsDialog\en.json" />
<Content Remove="Resources\Localization\ProcessingHints\de.json" />
<Content Remove="Resources\Localization\ProcessingHints\en.json" />
<Content Remove="Resources\Localization\TracksTable\de.json" />
<Content Remove="Resources\Localization\TracksTable\en.json" />
<Content Remove="Resources\Localization\ValidationMessage\de.json" />
<Content Remove="Resources\Localization\CultureSelector\de.json" />
<Content Remove="Resources\Localization\CultureSelector\en.json" />
Expand All @@ -33,6 +42,8 @@
<Content Remove="Resources\Localization\Index\de.json" />
<Content Remove="Resources\Localization\Index\en.json" />
<Content Remove="Resources\Localization\ValidationMessage\en.json" />
<Content Remove="Resources\Localization\ViewModeImport\de.json" />
<Content Remove="Resources\Localization\ViewModeImport\en.json" />
<Content Remove="Resources\Localization\ViewModeRecord\de.json" />
<Content Remove="Resources\Localization\ViewModeRecord\en.json" />
</ItemGroup>
Expand All @@ -44,14 +55,20 @@
<EmbeddedResource Include="Resources\Localization\AudioPlayer\de.json" />
<EmbeddedResource Include="Resources\Localization\CatalogueNumber\en.json" />
<EmbeddedResource Include="Resources\Localization\CatalogueNumber\de.json" />
<EmbeddedResource Include="Resources\Localization\ErrorReport\en.json" />
<EmbeddedResource Include="Resources\Localization\ErrorReport\de.json" />
<EmbeddedResource Include="Resources\Localization\CuesheetData\de.json" />
<EmbeddedResource Include="Resources\Localization\CuesheetData\en.json" />
<EmbeddedResource Include="Resources\Localization\ExportProfilesDialog\de.json" />
<EmbeddedResource Include="Resources\Localization\ExportProfilesDialog\en.json" />
<EmbeddedResource Include="Resources\Localization\MainLayout\en.json" />
<EmbeddedResource Include="Resources\Localization\MainLayout\de.json" />
<EmbeddedResource Include="Resources\Localization\ModalDialog\en.json" />
<EmbeddedResource Include="Resources\Localization\ModalDialog\de.json" />
<EmbeddedResource Include="Resources\Localization\OptionsDialog\de.json" />
<EmbeddedResource Include="Resources\Localization\OptionsDialog\en.json" />
<EmbeddedResource Include="Resources\Localization\ProcessingHints\en.json" />
<EmbeddedResource Include="Resources\Localization\ProcessingHints\de.json" />
<EmbeddedResource Include="Resources\Localization\TracksTable\de.json" />
<EmbeddedResource Include="Resources\Localization\TracksTable\en.json" />
<EmbeddedResource Include="Resources\Localization\ValidationMessage\en.json" />
<EmbeddedResource Include="Resources\Localization\ValidationMessage\de.json" />
<EmbeddedResource Include="Resources\Localization\CultureSelector\de.json" />
Expand All @@ -62,31 +79,30 @@
<EmbeddedResource Include="Resources\Localization\Help\en.json" />
<EmbeddedResource Include="Resources\Localization\Index\en.json" />
<EmbeddedResource Include="Resources\Localization\Index\de.json" />
<EmbeddedResource Include="Resources\Localization\ViewModeImport\de.json" />
<EmbeddedResource Include="Resources\Localization\ViewModeImport\en.json" />
<EmbeddedResource Include="Resources\Localization\ViewModeRecord\de.json" />
<EmbeddedResource Include="Resources\Localization\ViewModeRecord\en.json" />
</ItemGroup>

<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="wwwroot\Licence.txt" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BlazorDownloadFile" Version="2.1.6" />
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.5" />
<PackageReference Include="Blazorise.Components" Version="0.9.3.5" />
<PackageReference Include="Blazorise.Bootstrap5" Version="1.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.4" PrivateAssets="all" />
<PackageReference Include="BlazorDownloadFile" Version="2.4.0.2" />
<PackageReference Include="Blazorise.Components" Version="1.0.4" />
<PackageReference Include="Howler.Blazor" Version="0.9.8" />
<PackageReference Include="Macross.Json.Extensions" Version="2.0.0" />
<PackageReference Include="Markdig" Version="0.24.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="5.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
<PackageReference Include="Toolbelt.Blazor.HotKeys" Version="10.0.1" />
<PackageReference Include="z440.atl.core" Version="3.20.0" />
<PackageReference Include="Markdig" Version="0.30.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="6.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
<PackageReference Include="Toolbelt.Blazor.HotKeys" Version="12.1.1" />
<PackageReference Include="z440.atl.core" Version="4.4.0" />
</ItemGroup>

<ProjectExtensions><VisualStudio><UserProperties /></VisualStudio></ProjectExtensions>

</Project>
8 changes: 6 additions & 2 deletions AudioCuesheetEditor/AudioCuesheetEditor.csproj.user
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup>
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
</PropertyGroup>
</Project>
25 changes: 9 additions & 16 deletions AudioCuesheetEditor/Controller/CuesheetController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using AudioCuesheetEditor.Model.Entity;
using AudioCuesheetEditor.Model.IO.Audio;
using AudioCuesheetEditor.Model.Reflection;
using Blazorise;
using Microsoft.AspNetCore.Components.Forms;
using System;
using System.Collections.Generic;
Expand All @@ -26,16 +27,12 @@ namespace AudioCuesheetEditor.Controller
{
public class CuesheetController
{
private readonly Dictionary<FieldReference, Guid> fieldIdentifier = new Dictionary<FieldReference, Guid>();
private readonly Dictionary<FieldReference, Guid> fieldIdentifier = new();

public String GetFieldIdentifier(IValidateable validateable, String property)
{
if (validateable == null)
{
throw new ArgumentNullException(nameof(validateable));
}
var identifier = fieldIdentifier.FirstOrDefault(x => x.Key.Owner == validateable && x.Key.Property == property);
if (identifier.Key == null)
if (identifier.Equals(default(KeyValuePair<FieldReference, Guid>)))
{
fieldIdentifier.Add(FieldReference.Create(validateable, property), Guid.NewGuid());
identifier = fieldIdentifier.FirstOrDefault(x => x.Key.Owner == validateable && x.Key.Property == property);
Expand All @@ -45,27 +42,23 @@ public String GetFieldIdentifier(IValidateable validateable, String property)

public String GetFieldIdentifier(FieldReference fieldReference)
{
if (fieldReference == null)
{
throw new ArgumentNullException(nameof(fieldReference));
}
var identifier = fieldIdentifier.FirstOrDefault(x => x.Key == fieldReference);
if (identifier.Key == null)
if (identifier.Equals(default(KeyValuePair<FieldReference, Guid>)))
{
fieldIdentifier.Add(fieldReference, Guid.NewGuid());
identifier = fieldIdentifier.FirstOrDefault(x => x.Key == fieldReference);
}
return String.Format("{0}_{1}", identifier.Key.CompleteName, identifier.Value.ToString());
}

public static Boolean CheckFileMimeType(IBrowserFile file, String mimeType, String fileExtension)
public static Boolean CheckFileMimeType(IFileEntry file, String mimeType, String fileExtension)
{
Boolean fileMimeTypeMatches = false;
if ((file != null) && (String.IsNullOrEmpty(mimeType) == false) && (String.IsNullOrEmpty(fileExtension) == false))
{
if (String.IsNullOrEmpty(file.ContentType) == false)
if (String.IsNullOrEmpty(file.Type) == false)
{
fileMimeTypeMatches = file.ContentType.ToLower() == mimeType.ToLower();
fileMimeTypeMatches = file.Type.ToLower() == mimeType.ToLower();
}
else
{
Expand All @@ -77,13 +70,13 @@ public static Boolean CheckFileMimeType(IBrowserFile file, String mimeType, Stri
return fileMimeTypeMatches;
}

public static Boolean CheckFileMimeType(IBrowserFile file, IReadOnlyCollection<AudioCodec> audioCodecs)
public static Boolean CheckFileMimeType(IFileEntry file, IReadOnlyCollection<AudioCodec> audioCodecs)
{
Boolean fileMimeTypeMatches = false;
if ((file != null) && (audioCodecs != null))
{
var extension = Path.GetExtension(file.Name).ToLower();
var audioCodecsFound = audioCodecs.Where(x => x.MimeType.Equals(file.ContentType, StringComparison.OrdinalIgnoreCase) || x.FileExtension.Equals(extension, StringComparison.OrdinalIgnoreCase));
var audioCodecsFound = audioCodecs.Where(x => x.MimeType.Equals(file.Type, StringComparison.OrdinalIgnoreCase) || x.FileExtension.Equals(extension, StringComparison.OrdinalIgnoreCase));
fileMimeTypeMatches = (audioCodecsFound != null) && (audioCodecsFound.Any());
}
return fileMimeTypeMatches;
Expand Down
85 changes: 0 additions & 85 deletions AudioCuesheetEditor/Controller/OptionsController.cs

This file was deleted.

Loading

0 comments on commit a8bd491

Please sign in to comment.