Skip to content

Commit

Permalink
All - Update Aura
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Nov 22, 2023
1 parent 06ab10b commit c051eff
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "3.2.0",
"version": "4.0.0",
"commands": [
"dotnet-cake"
]
Expand Down
2 changes: 1 addition & 1 deletion NickvisionTagger.GNOME/NickvisionTagger.GNOME.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="GirCore.Adw-1" Version="0.5.0-preview.3" />
<PackageReference Include="Nickvision.Aura" Version="2023.11.3" />
<PackageReference Include="Nickvision.Aura" Version="2023.11.4" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion NickvisionTagger.GNOME/Views/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ private bool OnCloseRequested(Gtk.Window sender, EventArgs e)
_controller.WindowWidth = width;
_controller.WindowHeight = height;
_controller.WindowMaximized = IsMaximized();
_controller.SaveConfig();
_controller.SaveConfiguration();
if (!_controller.CanClose)
{
var dialog = Adw.MessageDialog.New(this, _("Apply Changes?"), _("Some music files still have changes waiting to be applied. What would you like to do?"));
Expand Down
12 changes: 6 additions & 6 deletions NickvisionTagger.GNOME/nuget-sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@
},
{
"type": "file",
"url": "https://api.nuget.org/v3-flatcontainer/nickvision.aura/2023.11.3/nickvision.aura.2023.11.3.nupkg",
"sha512": "80a7d1514433de2b08fce0f5315b722b1b3f8bda679ed38654ad1a14af065d5e31d284a19c975e208cd8a27aec5af52db644969fff3243334749a236cfc1ecfc",
"url": "https://api.nuget.org/v3-flatcontainer/nickvision.aura/2023.11.4/nickvision.aura.2023.11.4.nupkg",
"sha512": "ddf2502d83d4957ef4acecfb472f697360daa487d4c721969e94741bed24087f107478618b717209bd4c35186f0666cffbcf64dc240785dae7b21180dc2b0bcb",
"dest": "nuget-sources",
"dest-filename": "nickvision.aura.2023.11.3.nupkg"
"dest-filename": "nickvision.aura.2023.11.4.nupkg"
},
{
"type": "file",
Expand Down Expand Up @@ -701,10 +701,10 @@
},
{
"type": "file",
"url": "https://api.nuget.org/v3-flatcontainer/cake.tool/3.2.0/cake.tool.3.2.0.nupkg",
"sha512": "d83ba507bf930833817462e20f1413dfbd88b7c6c15876e774641aed08deeb15e39db17bc931248510e833823b4a833faaaee8c138a055a109273d1c368bf77a",
"url": "https://api.nuget.org/v3-flatcontainer/cake.tool/4.0.0/cake.tool.4.0.0.nupkg",
"sha512": "63b5049577afda8b70f7586582a1971452d767b2f771f2f3d1c0e4367ca3d6406a1b7e3a6ee81c7392e7b1a0ce98eb1f6494de9b7539a75fa9327140685b2b7d",
"dest": "nuget-sources",
"dest-filename": "cake.tool.3.2.0.nupkg"
"dest-filename": "cake.tool.4.0.0.nupkg"
},
{
"type": "file",
Expand Down
75 changes: 32 additions & 43 deletions NickvisionTagger.Shared/Controllers/MainWindowController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ public class MainWindowController : IDisposable
/// <param name="args">Command-line arguments</param>
public MainWindowController(string[] args)
{
Aura.Init("org.nickvision.tagger", "Nickvision Tagger");
AppInfo.EnglishShortName = "Tagger";
//Vars
_disposed = false;
if (args.Length > 0)
{
Expand All @@ -147,53 +150,22 @@ public MainWindowController(string[] args)
_libraryToLaunch = path;
}
}
Aura.Init("org.nickvision.tagger", "Nickvision Tagger");
AppInfo.EnglishShortName = "Tagger";
if (Directory.Exists($"{UserDirectories.Config}{Path.DirectorySeparatorChar}Nickvision{Path.DirectorySeparatorChar}{AppInfo.Name}"))
{
// Move config files from older versions and delete old directory
try
{
foreach (var file in Directory.GetFiles($"{UserDirectories.Config}{Path.DirectorySeparatorChar}Nickvision{Path.DirectorySeparatorChar}{AppInfo.Name}"))
{
File.Move(file, $"{UserDirectories.ApplicationConfig}{Path.DirectorySeparatorChar}{Path.GetFileName(file)}");
}
}
catch (IOException) { }
Directory.Delete($"{UserDirectories.Config}{Path.DirectorySeparatorChar}Nickvision{Path.DirectorySeparatorChar}{AppInfo.Name}", true);
}
Aura.Active.SetConfig<Configuration>("config");
Configuration.Current.Saved += ConfigurationSaved;
AppInfo.Version = "2023.11.3";
AppInfo.ShortName = _("Tagger");
AppInfo.Description = _("Tag your music");
AppInfo.SourceRepo = new Uri("https://github.com/NickvisionApps/Tagger");
AppInfo.IssueTracker = new Uri("https://github.com/NickvisionApps/Tagger/issues/new");
AppInfo.SupportUrl = new Uri("https://github.com/NickvisionApps/Tagger/discussions");
AppInfo.ExtraLinks[_("Matrix Chat")] = new Uri("https://matrix.to/#/#nickvision:matrix.org");
AppInfo.Developers[_("Nicholas Logozzo")] = new Uri("https://github.com/nlogozzo");
AppInfo.Developers[_("Contributors on GitHub ❤️")] = new Uri("https://github.com/NickvisionApps/Tagger/graphs/contributors");
AppInfo.Designers[_("Nicholas Logozzo")] = new Uri("https://github.com/nlogozzo");
AppInfo.Designers[_("Fyodor Sobolev")] = new Uri("https://github.com/fsobolev");
AppInfo.Designers[_("DaPigGuy")] = new Uri("https://github.com/DaPigGuy");
AppInfo.Artists[_("David Lapshin")] = new Uri("https://github.com/daudix-UFO");
AppInfo.TranslatorCredits = _("translator-credits");
_forceAllowClose = false;
_musicLibrary = null;
_musicFileChangedFromUpdate = new List<bool>();
_filesBeingEditedOriginals = new Dictionary<int, PropertyMap>();
_hadUserFilenameChange = false;
_validSearchProperties = new string[]
{
_validSearchProperties =
[
"filename", _("filename"), "title", _("title"), "artist", _("artist"), "album", _("album"),
"year", _("year"), "track", _("track"), "tracktotal", _("tracktotal"), "albumartist", _("albumartist"),
"genre", _("genre"), "comment", _("comment"), "beatsperminute", _("beatsperminute"), "bpm", _("bpm"),
"composer", _("composer"), "description", _("description"), "discnumber", _("discnumber"),
"disctotal", _("disctotal"), "publisher", _("publisher"), "publishingdate", _("publishingdate"),
"custom", _("custom")
};
_genreSuggestions = new string[]
{
];
_genreSuggestions =
[
"Blues", "Classic rock", "Country", "Dance", "Disco", "Funk", "Grunge", "Hip-hop", "Jazz", "Metal",
"New age", "Oldies", "Other", "Pop", "Rhythm and blues", "Rap", "Reggae", "Rock", "Techno", "Industrial",
"Alternative", "Ska", "Death metal", "Pranks", "Soundtrack", "Euro-techno", "Ambient", "Trip-hop", "Vocal",
Expand All @@ -204,11 +176,28 @@ public MainWindowController(string[] args)
"Trailer", "Low-fi", "Tribal", "Polka", "Retro", "Musical", "Rock 'n' roll", "Hard rock", "Folk", "Swing",
"Latin", "Chorus", "Acoustic", "Opera", "Club", "Tango", "Samba", "Freestyle", "A cappella", "Dance hall",
"Indie", "Merengue", "Salsa", "Bachata", "Christmas", "EDM"
};
FormatStrings = new string[] { _("%artist%- %title%"), _("%title%- %artist%"), _("%track%- %title%"), _("%title%") };
];
FormatStrings = [_("%artist%- %title%"), _("%title%- %artist%"), _("%track%- %title%"), _("%title%")];
MusicFileSaveStates = new List<bool>();
SelectedMusicFiles = new Dictionary<int, MusicFile>();
SelectedPropertyMap = new PropertyMap();
//AppInfo
AppInfo.Version = "2023.11.3";
AppInfo.ShortName = _("Tagger");
AppInfo.Description = _("Tag your music");
AppInfo.SourceRepo = new Uri("https://github.com/NickvisionApps/Tagger");
AppInfo.IssueTracker = new Uri("https://github.com/NickvisionApps/Tagger/issues/new");
AppInfo.SupportUrl = new Uri("https://github.com/NickvisionApps/Tagger/discussions");
AppInfo.ExtraLinks[_("Matrix Chat")] = new Uri("https://matrix.to/#/#nickvision:matrix.org");
AppInfo.Developers[_("Nicholas Logozzo")] = new Uri("https://github.com/nlogozzo");
AppInfo.Developers[_("Contributors on GitHub ❤️")] = new Uri("https://github.com/NickvisionApps/Tagger/graphs/contributors");
AppInfo.Designers[_("Nicholas Logozzo")] = new Uri("https://github.com/nlogozzo");
AppInfo.Designers[_("Fyodor Sobolev")] = new Uri("https://github.com/fsobolev");
AppInfo.Designers[_("DaPigGuy")] = new Uri("https://github.com/DaPigGuy");
AppInfo.Artists[_("David Lapshin")] = new Uri("https://github.com/daudix-UFO");
AppInfo.TranslatorCredits = _("translator-credits");
//Events
Configuration.Current.Saved += ConfigurationSaved;
}

/// <summary>
Expand Down Expand Up @@ -409,7 +398,7 @@ public async Task StartupAsync()
/// <summary>
/// Saves the app's configuration file to disk
/// </summary>
public void SaveConfig() => Aura.Active.SaveConfig("config");
public void SaveConfiguration() => Configuration.Current.Save();

/// <summary>
/// Checks for an application update and notifies the user if one is available
Expand Down Expand Up @@ -473,7 +462,7 @@ public async Task OpenLibraryAsync(string path)
if (Configuration.Current.RememberLastOpenedFolder)
{
Configuration.Current.LastOpenedFolder = _musicLibrary.Path;
Aura.Active.SaveConfig("config");
Configuration.Current.Save();
}
await ReloadLibraryAsync();
}
Expand All @@ -492,7 +481,7 @@ public void CloseLibrary()
if (Configuration.Current.RememberLastOpenedFolder)
{
Configuration.Current.LastOpenedFolder = "";
Aura.Active.SaveConfig("config");
Configuration.Current.Save();
}
MusicLibraryUpdated?.Invoke(this, EventArgs.Empty);
}
Expand Down Expand Up @@ -975,7 +964,7 @@ await Task.Run(() =>
{
UpdateSelectedMusicFilesProperties();
Configuration.Current.PreviousFTTFormatString = formatString;
Aura.Active.SaveConfig("config");
Configuration.Current.Save();
}
MusicFileSaveStatesChanged?.Invoke(this, MusicFileSaveStates.Any(x => !x));
NotificationSent?.Invoke(this, new NotificationSentEventArgs(_n("Converted {0} file name to tag successfully", "Converted {0} file names to tags successfully", success, success), NotificationSeverity.Success, "format"));
Expand Down Expand Up @@ -1011,7 +1000,7 @@ await Task.Run(() =>
{
UpdateSelectedMusicFilesProperties();
Configuration.Current.PreviousTTFFormatString = formatString;
Aura.Active.SaveConfig("config");
Configuration.Current.Save();
}
MusicFileSaveStatesChanged?.Invoke(this, MusicFileSaveStates.Any(x => !x));
NotificationSent?.Invoke(this, new NotificationSentEventArgs(_n("Converted {0} tag to file name successfully", "Converted {0} tags to file names successfully", success, success), NotificationSeverity.Success, "format"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ public string AcoustIdUserAPIKey
/// <summary>
/// Saves the configuration to disk
/// </summary>
public void SaveConfiguration() => Aura.Active.SaveConfig("config");
public void SaveConfiguration() => Configuration.Current.Save();
}
3 changes: 1 addition & 2 deletions NickvisionTagger.Shared/Models/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Nickvision.Aura;
using Nickvision.Aura.Configuration;
using System.Runtime.InteropServices;

namespace NickvisionTagger.Shared.Models;
Expand Down Expand Up @@ -126,5 +125,5 @@ public Configuration()
/// <summary>
/// Gets the singleton object
/// </summary>
internal static Configuration Current => (Configuration)Aura.Active.ConfigFiles["config"];
internal static Configuration Current => Aura.Active.GetConfig<Configuration>("config");
}
2 changes: 1 addition & 1 deletion NickvisionTagger.Shared/NickvisionTagger.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.2" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageReference Include="AcoustID.NET" Version="1.3.3" />
<PackageReference Include="Nickvision.Aura" Version="2023.11.3" />
<PackageReference Include="Nickvision.Aura" Version="2023.11.4" />
<PackageReference Include="z440.atl.core" Version="5.12.0" />
<PackageReference Include="MetaBrainz.MusicBrainz" Version="5.0.1" />
<PackageReference Include="MetaBrainz.MusicBrainz.CoverArt" Version="5.1.0" />
Expand Down
2 changes: 1 addition & 1 deletion NickvisionTagger.WinUI/NickvisionTagger.WinUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231115000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.2428" />
<PackageReference Include="Vanara.PInvoke.User32" Version="3.4.17" />
<PackageReference Include="Nickvision.Aura" Version="2023.11.3" />
<PackageReference Include="Nickvision.Aura" Version="2023.11.4" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions NickvisionTagger.WinUI/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ private void SortFilesBy(object sender, RoutedEventArgs e)
sortBy = SortBy.Genre;
}
_controller.SortFilesBy = sortBy;
_controller.SaveConfig();
_controller.SaveConfiguration();
//Update sort file by menu
MenuSortFilesFileName.IsChecked = _controller.SortFilesBy == SortBy.Filename;
MenuSortFilesFilePath.IsChecked = _controller.SortFilesBy == SortBy.Path;
Expand Down Expand Up @@ -765,7 +765,7 @@ private void ExtrasPaneToggle(object sender, RoutedEventArgs e)
CmdBtnExtrasPane.Icon = new SymbolIcon(Symbol.ClosePane);
_controller.ExtrasPane = true;
}
_controller.SaveConfig();
_controller.SaveConfiguration();
}

/// <summary>
Expand Down

0 comments on commit c051eff

Please sign in to comment.