diff --git a/NickvisionTagger.GNOME/Controls/CorruptedFilesDialog.cs b/NickvisionTagger.GNOME/Controls/CorruptedFilesDialog.cs index cbab037f..b9e55cad 100644 --- a/NickvisionTagger.GNOME/Controls/CorruptedFilesDialog.cs +++ b/NickvisionTagger.GNOME/Controls/CorruptedFilesDialog.cs @@ -1,8 +1,8 @@ using NickvisionTagger.GNOME.Helpers; using NickvisionTagger.Shared.Helpers; +using NickvisionTagger.Shared.Models; using System.Collections.Generic; using static Nickvision.Aura.Localization.Gettext; -using static Nickvision.GirExt.GtkExt; namespace NickvisionTagger.GNOME.Controls; @@ -11,6 +11,8 @@ namespace NickvisionTagger.GNOME.Controls; /// public partial class CorruptedFilesDialog : Adw.Window { + private readonly List _files; + [Gtk.Connect] private readonly Gtk.Button _helpButton; [Gtk.Connect] private readonly Gtk.ScrolledWindow _scrolledWindow; [Gtk.Connect] private readonly Adw.PreferencesGroup _filesGroup; @@ -23,38 +25,43 @@ public partial class CorruptedFilesDialog : Adw.Window /// Icon name for the window /// Path of the parent directory of corrupted files /// List of corrupted files - private CorruptedFilesDialog(Gtk.Builder builder, Gtk.Window parent, string iconName, string parentPath, List files) : base(builder.GetPointer("_root"), false) + private CorruptedFilesDialog(Gtk.Builder builder, Gtk.Window parent, string iconName, string parentPath, List files) : base(builder.GetPointer("_root"), false) { + _files = files; builder.Connect(this); //Dialog Settings SetIconName(iconName); SetTransientFor(parent); _helpButton.OnClicked += (sender, e) => Gtk.Functions.ShowUri(this, DocumentationHelpers.GetHelpURL("corrupted"), 0); - foreach (var path in files) + foreach (var file in _files) { var row = Adw.ActionRow.New(); - var p = path.Remove(0, parentPath.Length); - if (p[0] == '/') + var path = file.Path.Remove(0, parentPath.Length); + if (path[0] == '/') { - p = p.Remove(0, 1); + path = path.Remove(0, 1); } - row.SetTitle(p); + row.SetUseMarkup(false); + row.SetTitle(path); row.SetTitleLines(1); row.SetTooltipText(path); var button = Gtk.Button.New(); - button.SetIconName("folder-symbolic"); - button.SetTooltipText(_("Open Folder")); + button.SetIconName("wrench-wide-symbolic"); + button.SetTooltipText(_("Fix File")); button.SetValign(Gtk.Align.Center); button.AddCssClass("flat"); button.OnClicked += async (sender, e) => { - var file = Gio.FileHelper.NewForPath(path); - var fileLauncher = Gtk.FileLauncher.New(file); - try - { - await fileLauncher.OpenContainingFolderAsync(this); - } - catch { } + var spinner = Gtk.Spinner.New(); + spinner.SetValign(Gtk.Align.Center); + spinner.SetSpinning(true); + row.Remove(button); + row.AddSuffix(spinner); + var res = await file.FixAsync(); + var lbl = Gtk.Label.New(res ? _("File fixed successfully") : _("Unable to fix file")); + lbl.SetValign(Gtk.Align.Center); + row.Remove(spinner); + row.AddSuffix(lbl); }; row.AddSuffix(button); row.SetActivatableWidget(button); @@ -69,7 +76,7 @@ private CorruptedFilesDialog(Gtk.Builder builder, Gtk.Window parent, string icon /// Icon name for the window /// Path of the parent directory of corrupted files /// List of corrupted files - public CorruptedFilesDialog(Gtk.Window parent, string iconName, string parentPath, List files) : this(Builder.FromFile("corrupted_files_dialog.ui"), parent, iconName, parentPath, files) + public CorruptedFilesDialog(Gtk.Window parent, string iconName, string parentPath, List files) : this(Builder.FromFile("corrupted_files_dialog.ui"), parent, iconName, parentPath, files) { } } \ No newline at end of file diff --git a/NickvisionTagger.GNOME/Program.cs b/NickvisionTagger.GNOME/Program.cs index fc6ce1b7..1a4a371e 100644 --- a/NickvisionTagger.GNOME/Program.cs +++ b/NickvisionTagger.GNOME/Program.cs @@ -33,7 +33,10 @@ public Program(string[] args) _mainWindow = null; _mainWindowController = new MainWindowController(args); _mainWindowController.AppInfo.Changelog = - @"* Fixed an issue where Tagger crashed on loading album art for some files + @"* Added the ability to specify ""/"" in a Tag to File Name format string to move files to a new directory when renaming files + * Tagger now has the ability to fix corrupted file right from within the app + * Tagger will now display files with corrupted album art as corrupted files + * Fixed an issue where some custom properties for vorbis and wav files could not be removed * Updated translations (Thanks everyone on Weblate!)"; _application.OnActivate += OnActivate; if (File.Exists(Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) + "/org.nickvision.tagger.gresource")) diff --git a/NickvisionTagger.GNOME/nuget-sources.json b/NickvisionTagger.GNOME/nuget-sources.json index c1f326a6..3b93ee0e 100644 --- a/NickvisionTagger.GNOME/nuget-sources.json +++ b/NickvisionTagger.GNOME/nuget-sources.json @@ -694,10 +694,10 @@ }, { "type": "file", - "url": "https://api.nuget.org/v3-flatcontainer/z440.atl.core/5.11.0/z440.atl.core.5.11.0.nupkg", - "sha512": "8a2dbb6e206698afa8ad08a5e408232d4cfdb0b2d76e688af40696faeefbb623a94472e3622c33c84abee5c7a5417d0c966e87197bfd645755cce6501787dcef", + "url": "https://api.nuget.org/v3-flatcontainer/z440.atl.core/5.12.0/z440.atl.core.5.12.0.nupkg", + "sha512": "1a86f24faff90598bc2a71d8e558c03ef0ac4290f155ac23ecad4c30e60036240a4a0b477da7e1cdb1a46d4a03654590ba46bda640d35158a11942cbc4f7c3d7", "dest": "nuget-sources", - "dest-filename": "z440.atl.core.5.11.0.nupkg" + "dest-filename": "z440.atl.core.5.12.0.nupkg" }, { "type": "file", diff --git a/NickvisionTagger.Shared/Controllers/MainWindowController.cs b/NickvisionTagger.Shared/Controllers/MainWindowController.cs index 73841da9..7f8a2645 100644 --- a/NickvisionTagger.Shared/Controllers/MainWindowController.cs +++ b/NickvisionTagger.Shared/Controllers/MainWindowController.cs @@ -80,7 +80,7 @@ public class MainWindowController : IDisposable /// /// The list of paths to corrupted music files in the music library /// - public List CorruptedFiles => _musicLibrary?.CorruptedFiles ?? new List(); + public List CorruptedFiles => _musicLibrary?.CorruptedFiles ?? new List(); /// /// The previous format string used by filename to tag /// @@ -164,7 +164,7 @@ public MainWindowController(string[] args) } Aura.Active.SetConfig("config"); Configuration.Current.Saved += ConfigurationSaved; - AppInfo.Version = "2023.11.0"; + AppInfo.Version = "2023.11.1-next"; AppInfo.ShortName = _("Tagger"); AppInfo.Description = _("Tag your music"); AppInfo.SourceRepo = new Uri("https://github.com/NickvisionApps/Tagger"); diff --git a/NickvisionTagger.Shared/Docs/html/C/corrupted.html b/NickvisionTagger.Shared/Docs/html/C/corrupted.html index 23fadfa9..f5817daa 100644 --- a/NickvisionTagger.Shared/Docs/html/C/corrupted.html +++ b/NickvisionTagger.Shared/Docs/html/C/corrupted.html @@ -17,12 +17,15 @@

Corrupted Files

-

This page explains music files with corrupted data.

+
+

This page explains music files with corrupted data.

+

If Tagger is unable to read a file, it will be ignored and a dialog will be displayed listing corrupted files for you to manage and fix accordingly.

+

This dialog will offer the option to have Tagger run the appropriate command to try and fix the corrupted file.

+

Invalid Data

An invalid tag header or junk data in a file can cause issues when reading information about a file and even cause playback issues. Some websites add extra junk data in files which in turn causes corruption.

-

If Tagger is unable to read a file, it will be ignored and a dialog will be displayed listing corrupted files for you to manage and fix accordingly.

@@ -60,6 +63,33 @@

You can also use fre:ac to re-encode files without convertion to another format.

+
+

Invalid Album Art

+
+

An invalid or corrupted embedded album art format can cause issues in displaying music files in Tagger.

+
+ + + + + + + + + + + + + +
+

FFmpeg can be used to fix album art issues. Run the following command to remove album art data from a file:

+
ffmpeg -map 0:a -c:a copy -map_metadata -1 -i in.mp3 out.mp3
+

+ where in.mp3 is the file path of the corrupted file and out.mp3 is the path to export the re-encoded file. +

+
+
+