Skip to content

Commit

Permalink
Merge pull request #393 from NickvisionApps/next
Browse files Browse the repository at this point in the history
Features and Fixes
  • Loading branch information
nlogozzo authored Nov 5, 2023
2 parents f34d286 + 6f26c05 commit 73ed71b
Show file tree
Hide file tree
Showing 74 changed files with 2,529 additions and 1,048 deletions.
41 changes: 24 additions & 17 deletions NickvisionTagger.GNOME/Controls/CorruptedFilesDialog.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -11,6 +11,8 @@ namespace NickvisionTagger.GNOME.Controls;
/// </summary>
public partial class CorruptedFilesDialog : Adw.Window
{
private readonly List<CorruptedMusicFile> _files;

[Gtk.Connect] private readonly Gtk.Button _helpButton;
[Gtk.Connect] private readonly Gtk.ScrolledWindow _scrolledWindow;
[Gtk.Connect] private readonly Adw.PreferencesGroup _filesGroup;
Expand All @@ -23,38 +25,43 @@ public partial class CorruptedFilesDialog : Adw.Window
/// <param name="iconName">Icon name for the window</param>
/// <param name="parentPath">Path of the parent directory of corrupted files</param>
/// <param name="files">List of corrupted files</param>
private CorruptedFilesDialog(Gtk.Builder builder, Gtk.Window parent, string iconName, string parentPath, List<string> files) : base(builder.GetPointer("_root"), false)
private CorruptedFilesDialog(Gtk.Builder builder, Gtk.Window parent, string iconName, string parentPath, List<CorruptedMusicFile> 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);
Expand All @@ -69,7 +76,7 @@ private CorruptedFilesDialog(Gtk.Builder builder, Gtk.Window parent, string icon
/// <param name="iconName">Icon name for the window</param>
/// <param name="parentPath">Path of the parent directory of corrupted files</param>
/// <param name="files">List of corrupted files</param>
public CorruptedFilesDialog(Gtk.Window parent, string iconName, string parentPath, List<string> files) : this(Builder.FromFile("corrupted_files_dialog.ui"), parent, iconName, parentPath, files)
public CorruptedFilesDialog(Gtk.Window parent, string iconName, string parentPath, List<CorruptedMusicFile> files) : this(Builder.FromFile("corrupted_files_dialog.ui"), parent, iconName, parentPath, files)
{
}
}
5 changes: 4 additions & 1 deletion NickvisionTagger.GNOME/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
6 changes: 3 additions & 3 deletions NickvisionTagger.GNOME/nuget-sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions NickvisionTagger.Shared/Controllers/MainWindowController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public class MainWindowController : IDisposable
/// <summary>
/// The list of paths to corrupted music files in the music library
/// </summary>
public List<string> CorruptedFiles => _musicLibrary?.CorruptedFiles ?? new List<string>();
public List<CorruptedMusicFile> CorruptedFiles => _musicLibrary?.CorruptedFiles ?? new List<CorruptedMusicFile>();
/// <summary>
/// The previous format string used by filename to tag
/// </summary>
Expand Down Expand Up @@ -164,7 +164,7 @@ public MainWindowController(string[] args)
}
Aura.Active.SetConfig<Configuration>("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");
Expand Down
34 changes: 32 additions & 2 deletions NickvisionTagger.Shared/Docs/html/C/corrupted.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
<header><div class="inner pagewide"><div class="trails" role="navigation"><div class="trail">
<a class="trail" href="index.html" title="Tagger Help">Tagger Help</a> » </div></div></div></header><article><div class="hgroup pagewide"><h1 class="title"><span class="title">Corrupted Files</span></h1></div>
<div class="region">
<div class="contents pagewide"><p class="p">This page explains music files with corrupted data.</p></div>
<div class="contents pagewide">
<p class="p">This page explains music files with corrupted data.</p>
<p class="p">If <span class="app">Tagger</span> 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.</p>
<p class="p">This dialog will offer the option to have Tagger run the appropriate command to try and fix the corrupted file.</p>
</div>
<section id=""><div class="inner">
<div class="hgroup pagewide"><h2 class="title"><span class="title">Invalid Data</span></h2></div>
<div class="region"><div class="contents pagewide">
<p class="p">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.</p>
<p class="p">If <span class="app">Tagger</span> 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.</p>
<div class="note note-advanced" title="Advanced">
<svg height="24" width="24" version="1.1">
<g>
Expand Down Expand Up @@ -60,6 +63,33 @@
</svg><div class="inner"><div class="region"><div class="contents"><p class="p">You can also use <span class="link"><a href="https://www.freac.org" title="https://www.freac.org">fre:ac</a></span> to re-encode files without convertion to another format.</p></div></div></div>
</div>
</div></div>
</div></section><section id=""><div class="inner">
<div class="hgroup pagewide"><h2 class="title"><span class="title">Invalid Album Art</span></h2></div>
<div class="region"><div class="contents pagewide">
<p class="p">An invalid or corrupted embedded album art format can cause issues in displaying music files in Tagger.</p>
<div class="note note-advanced" title="Advanced">
<svg height="24" width="24" version="1.1">
<g>
<path class="yelp-svg-fill" d="m5.4473 12.572c-2.039 0.957-3.4473 3.019-3.4473 5.428v4h20v-4c0-2.406-1.406-4.466-3.441-5.424a8 8 0 0 1 -6.559 3.424 8 8 0 0 1 -6.5527 -3.428z"></path>
<path class="yelp-svg-fill" d="m12 3a5 5 0 0 0 -5 5 5 5 0 0 0 5 5 5 5 0 0 0 5 -5 5 5 0 0 0 -5 -5zm0 3a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2z"></path>
<path class="yelp-svg-fill" d="m15.312 6 3.688 1v2l-3.4688 1z"></path>
<path class="yelp-svg-fill" d="m14 11.312-1 3.688h-2l-1-3.469z"></path>
<path class="yelp-svg-fill" d="m10 4.6875 1-3.6875h2l1 3.4688z"></path>
<path class="yelp-svg-fill" d="m8.6875 10-3.6875-1v-2l3.4688-1z"></path>
<path class="yelp-svg-fill" d="m12.928 4.2435 3.3146-1.9003 1.4142 1.4142-1.7457 3.1599z"></path>
<path class="yelp-svg-fill" d="m15.757 8.9281 1.9003 3.3146-1.4142 1.4142-3.1599-1.7457z"></path>
<path class="yelp-svg-fill" d="m8.2435 7.0719-1.9004-3.3145 1.4143-1.4143 3.1596 1.7457z"></path>
<path class="yelp-svg-fill" d="m11.072 11.757-3.3146 1.9-1.4143-1.414 1.7457-3.1602z"></path>
</g>
</svg><div class="inner"><div class="region"><div class="contents">
<p class="p">FFmpeg can be used to fix album art issues. Run the following command to remove album art data from a file:</p>
<div class="code"><pre class="contents"><code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i in.mp3 out.mp3</code></pre></div>
<p class="p">
where <span class="code">in.mp3</span> is the file path of the corrupted file and <span class="code">out.mp3</span> is the path to export the re-encoded file.
</p>
</div></div></div>
</div>
</div></div>
</div></section><section class="links" role="navigation"><div class="inner">
<div class="hgroup pagewide"></div>
<div class="contents pagewide"><div class="links guidelinks"><div class="inner">
Expand Down
32 changes: 30 additions & 2 deletions NickvisionTagger.Shared/Docs/html/cs/corrupted.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
<header><div class="inner pagewide"><div class="trails" role="navigation"><div class="trail">
<a class="trail" href="index.html" title="Nápověda aplikace Označovač">Nápověda aplikace Označovač</a> » </div></div></div></header><article><div class="hgroup pagewide"><h1 class="title"><span class="title">Poškozené soubory</span></h1></div>
<div class="region">
<div class="contents pagewide"><p class="p">Tato stránka vysvětluje hudební soubory s poškozenými daty.</p></div>
<div class="contents pagewide">
<p class="p">Tato stránka vysvětluje hudební soubory s poškozenými daty.</p>
<p class="p">Pokud <span class="app">Označovač</span> nedokáže přečíst soubor, bude ignorován a bude zobrazen dialog se seznamem poškozených souborů, které následně můžete spravovat a opravit.</p>
<p class="p">This dialog will offer the option to have Tagger run the appropriate command to try and fix the corrupted file.</p>
</div>
<section id=""><div class="inner">
<div class="hgroup pagewide"><h2 class="title"><span class="title">Neplatná data</span></h2></div>
<div class="region"><div class="contents pagewide">
<p class="p">Neplatná hlavička značky nebo nevyžádaná data v souboru mohou způsobit problémy při čtení informací o souboru a dokonce i problémy s přehráváním. Některé webové stránky přidávají do souborů další nevyžádaná data, která následně způsobují poškození.</p>
<p class="p">Pokud <span class="app">Označovač</span> nedokáže přečíst soubor, bude ignorován a bude zobrazen dialog se seznamem poškozených souborů, které následně můžete spravovat a opravit.</p>
<div class="note note-advanced" title="Pokročilé">
<svg height="24" width="24" version="1.1">
<g>
Expand Down Expand Up @@ -60,6 +63,31 @@
</svg><div class="inner"><div class="region"><div class="contents"><p class="p">Pro opětovné kódování souborů bez převodu na jiný formát můžete použít také službu <span class="link"><a href="https://www.freac.org" title="https://www.freac.org">fre:ac</a></span>.</p></div></div></div>
</div>
</div></div>
</div></section><section id=""><div class="inner">
<div class="hgroup pagewide"><h2 class="title"><span class="title">Invalid Album Art</span></h2></div>
<div class="region"><div class="contents pagewide">
<p class="p">An invalid or corrupted embedded album art format can cause issues in displaying music files in Tagger.</p>
<div class="note note-advanced" title="Pokročilé">
<svg height="24" width="24" version="1.1">
<g>
<path class="yelp-svg-fill" d="m5.4473 12.572c-2.039 0.957-3.4473 3.019-3.4473 5.428v4h20v-4c0-2.406-1.406-4.466-3.441-5.424a8 8 0 0 1 -6.559 3.424 8 8 0 0 1 -6.5527 -3.428z"></path>
<path class="yelp-svg-fill" d="m12 3a5 5 0 0 0 -5 5 5 5 0 0 0 5 5 5 5 0 0 0 5 -5 5 5 0 0 0 -5 -5zm0 3a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2z"></path>
<path class="yelp-svg-fill" d="m15.312 6 3.688 1v2l-3.4688 1z"></path>
<path class="yelp-svg-fill" d="m14 11.312-1 3.688h-2l-1-3.469z"></path>
<path class="yelp-svg-fill" d="m10 4.6875 1-3.6875h2l1 3.4688z"></path>
<path class="yelp-svg-fill" d="m8.6875 10-3.6875-1v-2l3.4688-1z"></path>
<path class="yelp-svg-fill" d="m12.928 4.2435 3.3146-1.9003 1.4142 1.4142-1.7457 3.1599z"></path>
<path class="yelp-svg-fill" d="m15.757 8.9281 1.9003 3.3146-1.4142 1.4142-3.1599-1.7457z"></path>
<path class="yelp-svg-fill" d="m8.2435 7.0719-1.9004-3.3145 1.4143-1.4143 3.1596 1.7457z"></path>
<path class="yelp-svg-fill" d="m11.072 11.757-3.3146 1.9-1.4143-1.414 1.7457-3.1602z"></path>
</g>
</svg><div class="inner"><div class="region"><div class="contents">
<p class="p">FFmpeg can be used to fix album art issues. Run the following command to remove album art data from a file:</p>
<div class="code"><pre class="contents"><code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i in.mp3 out.mp3</code></pre></div>
<p class="p">kde je <span class="code">vstup.mp3</span> cesta k poškozenému souboru a <span class="code">výstup.mp3</span> cesta k exportovanému opětovně kódovanému souboru.</p>
</div></div></div>
</div>
</div></div>
</div></section><section class="links" role="navigation"><div class="inner">
<div class="hgroup pagewide"></div>
<div class="contents pagewide"><div class="links guidelinks"><div class="inner">
Expand Down
32 changes: 30 additions & 2 deletions NickvisionTagger.Shared/Docs/html/de/corrupted.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
<header><div class="inner pagewide"><div class="trails" role="navigation"><div class="trail">
<a class="trail" href="index.html" title="Tagger Hilfe">Tagger Hilfe</a> » </div></div></div></header><article><div class="hgroup pagewide"><h1 class="title"><span class="title">Korrupte Dateien</span></h1></div>
<div class="region">
<div class="contents pagewide"><p class="p">Diese Seite erklärt Audiodateien mit korrupten Daten.</p></div>
<div class="contents pagewide">
<p class="p">Diese Seite erklärt Audiodateien mit korrupten Daten.</p>
<p class="p">Wenn <span class="app">Tagger</span> nicht in der Lage ist, eine Datei zu lesen, wird sie ignoriert. Die beschädigten Dateien werden in einem Dialogfeld aufgelistet, damit du sie entsprechend verwalten und reparieren kannst.</p>
<p class="p">This dialog will offer the option to have Tagger run the appropriate command to try and fix the corrupted file.</p>
</div>
<section id=""><div class="inner">
<div class="hgroup pagewide"><h2 class="title"><span class="title">Ungültige Daten</span></h2></div>
<div class="region"><div class="contents pagewide">
<p class="p">Ein ungültiger Tag-Header oder Junk-Daten in einer Datei können zu Problemen beim Lesen von Informationen über eine Datei und sogar zu Wiedergabeproblemen führen. Einige Websites fügen zusätzliche Junk-Daten in Dateien ein, die wiederum zu Beschädigungen führen.</p>
<p class="p">Wenn <span class="app">Tagger</span> nicht in der Lage ist, eine Datei zu lesen, wird sie ignoriert. Die beschädigten Dateien werden in einem Dialogfeld aufgelistet, damit du sie entsprechend verwalten und reparieren kannst.</p>
<div class="note note-advanced" title="Erweitert">
<svg height="24" width="24" version="1.1">
<g>
Expand Down Expand Up @@ -60,6 +63,31 @@
</svg><div class="inner"><div class="region"><div class="contents"><p class="p">Die kannst alternativ <span class="link"><a href="https://www.freac.org" title="https://www.freac.org">fre:ac</a></span> nutzen um Dateien neu zu enkodieren, ohne sie in ein anderes Format umzuwandeln.</p></div></div></div>
</div>
</div></div>
</div></section><section id=""><div class="inner">
<div class="hgroup pagewide"><h2 class="title"><span class="title">Invalid Album Art</span></h2></div>
<div class="region"><div class="contents pagewide">
<p class="p">An invalid or corrupted embedded album art format can cause issues in displaying music files in Tagger.</p>
<div class="note note-advanced" title="Erweitert">
<svg height="24" width="24" version="1.1">
<g>
<path class="yelp-svg-fill" d="m5.4473 12.572c-2.039 0.957-3.4473 3.019-3.4473 5.428v4h20v-4c0-2.406-1.406-4.466-3.441-5.424a8 8 0 0 1 -6.559 3.424 8 8 0 0 1 -6.5527 -3.428z"></path>
<path class="yelp-svg-fill" d="m12 3a5 5 0 0 0 -5 5 5 5 0 0 0 5 5 5 5 0 0 0 5 -5 5 5 0 0 0 -5 -5zm0 3a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2z"></path>
<path class="yelp-svg-fill" d="m15.312 6 3.688 1v2l-3.4688 1z"></path>
<path class="yelp-svg-fill" d="m14 11.312-1 3.688h-2l-1-3.469z"></path>
<path class="yelp-svg-fill" d="m10 4.6875 1-3.6875h2l1 3.4688z"></path>
<path class="yelp-svg-fill" d="m8.6875 10-3.6875-1v-2l3.4688-1z"></path>
<path class="yelp-svg-fill" d="m12.928 4.2435 3.3146-1.9003 1.4142 1.4142-1.7457 3.1599z"></path>
<path class="yelp-svg-fill" d="m15.757 8.9281 1.9003 3.3146-1.4142 1.4142-3.1599-1.7457z"></path>
<path class="yelp-svg-fill" d="m8.2435 7.0719-1.9004-3.3145 1.4143-1.4143 3.1596 1.7457z"></path>
<path class="yelp-svg-fill" d="m11.072 11.757-3.3146 1.9-1.4143-1.414 1.7457-3.1602z"></path>
</g>
</svg><div class="inner"><div class="region"><div class="contents">
<p class="p">FFmpeg can be used to fix album art issues. Run the following command to remove album art data from a file:</p>
<div class="code"><pre class="contents"><code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i in.mp3 out.mp3</code></pre></div>
<p class="p">wobei <span class="code">in.mp3</span> der Dateipfad zur beschädigten Datei ist und <span class="code">out.mp3</span> der Pfad an dem die reparierte Datei gespeichert werden soll.</p>
</div></div></div>
</div>
</div></div>
</div></section><section class="links" role="navigation"><div class="inner">
<div class="hgroup pagewide"></div>
<div class="contents pagewide"><div class="links guidelinks"><div class="inner">
Expand Down
Loading

0 comments on commit 73ed71b

Please sign in to comment.