Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes + Tweaks #396

Merged
merged 15 commits into from
Nov 8, 2023
5 changes: 1 addition & 4 deletions NickvisionTagger.GNOME/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ public Program(string[] args)
_mainWindow = null;
_mainWindowController = new MainWindowController(args);
_mainWindowController.AppInfo.Changelog =
@"* 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
@"* Fixed an issue where specifying the directory separator in Tag to File Name when Limit Filename Characters was enabled caused new directories to not be made
* 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
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public MainWindowController(string[] args)
}
Aura.Active.SetConfig<Configuration>("config");
Configuration.Current.Saved += ConfigurationSaved;
AppInfo.Version = "2023.11.1";
AppInfo.Version = "2023.11.2-next";
AppInfo.ShortName = _("Tagger");
AppInfo.Description = _("Tag your music");
AppInfo.SourceRepo = new Uri("https://github.com/NickvisionApps/Tagger");
Expand Down
10 changes: 5 additions & 5 deletions NickvisionTagger.Shared/Docs/html/cs/corrupted.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<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>
<p class="p">Tento dialog vám nabídne možnost nechat aplikaci spustit příslušný příkaz a pokusit se opravit poškozený soubor.</p>
</div>
<section id=""><div class="inner">
<div class="hgroup pagewide"><h2 class="title"><span class="title">Neplatná data</span></h2></div>
Expand Down Expand Up @@ -64,9 +64,9 @@
</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="hgroup pagewide"><h2 class="title"><span class="title">Neplatný obal alba</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>
<p class="p">Neplatný nebo poškozený formát vloženého obalu alba může způsobit problémy při zobrazování hudebních souborů v aplikaci Označovač.</p>
<div class="note note-advanced" title="Pokročilé">
<svg height="24" width="24" version="1.1">
<g>
Expand All @@ -82,8 +82,8 @@
<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">Pro opravení problémů s obalem alba lze použít FFmpeg. Spusťte následující příkaz pro odebrání data o obalu alba ze souboru:</p>
<div class="code"><pre class="contents"><code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i vstup.mp3 vystup.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>
Expand Down
8 changes: 4 additions & 4 deletions NickvisionTagger.Shared/Docs/html/es/corrupted.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="contents pagewide">
<p class="p">En esta página se explican los archivos de música con datos dañados.</p>
<p class="p">Si <span class="app">Tagger</span> no puede leer un archivo, se ignorará y se mostrará un diálogo con una lista de los archivos dañados para que los gestione y corrija en consecuencia.</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>
<p class="p">Este cuadro de diálogo ofrecerá la opción de que Tagger ejecute el comando adecuado para intentar reparar el archivo dañado.</p>
</div>
<section id=""><div class="inner">
<div class="hgroup pagewide"><h2 class="title"><span class="title">Datos no válidos</span></h2></div>
Expand Down Expand Up @@ -64,9 +64,9 @@
</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="hgroup pagewide"><h2 class="title"><span class="title">Carátula del álbum no válida</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>
<p class="p">Un formato de carátula no válido o dañado puede causar problemas en la visualización de los archivos de música en Tagger.</p>
<div class="note note-advanced" title="Avanzada">
<svg height="24" width="24" version="1.1">
<g>
Expand All @@ -82,7 +82,7 @@
<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>
<p class="p">FFmpeg puede utilizarse para solucionar problemas en las carátulas de los álbumes. Ejecute el siguiente comando para eliminar los datos de las carátulas de un archivo:</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">donde <span class="code">in.mp3</span> es la ruta del archivo dañado y <span class="code">out.mp3</span> es la ruta para exportar el archivo recodificado.</p>
</div></div></div>
Expand Down
10 changes: 5 additions & 5 deletions NickvisionTagger.Shared/Docs/html/ru/corrupted.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<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>
<p class="p">В этом окне будет предложена опция, при которой Tagger выполнит команду, которая, возможно, исправит повреждённый файл.</p>
</div>
<section id=""><div class="inner">
<div class="hgroup pagewide"><h2 class="title"><span class="title">Invalid Data</span></h2></div>
Expand Down Expand Up @@ -64,9 +64,9 @@
</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="hgroup pagewide"><h2 class="title"><span class="title">Неправильное изображение обложки</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>
<p class="p">Неправильное или повреждённое встроенное изображение обложки альбома может создавать проблемы при отображении музыки в Tagger.</p>
<div class="note note-advanced" title="Подробности">
<svg height="24" width="24" version="1.1">
<g>
Expand All @@ -82,8 +82,8 @@
<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">Вы можете использовать FFmpeg для исправления проблемных обложек. Выполните следующую команду для удаления обложки из файла:</p>
<div class="code"><pre class="contents"><code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i исходный.mp3 новый.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>
Expand Down
10 changes: 5 additions & 5 deletions NickvisionTagger.Shared/Docs/yelp/cs/corrupted.page
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<title>Poškozené soubory</title>
<p>Tato stránka vysvětluje hudební soubory s poškozenými daty.</p>
<p>Pokud <app>Označovač</app> 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>This dialog will offer the option to have Tagger run the appropriate command to try and fix the corrupted file.</p>
<p>Tento dialog vám nabídne možnost nechat aplikaci spustit příslušný příkaz a pokusit se opravit poškozený soubor.</p>
<section>
<title>Neplatná data</title>
<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>
Expand All @@ -37,11 +37,11 @@
</note>
</section>
<section>
<title>Invalid Album Art</title>
<p>An invalid or corrupted embedded album art format can cause issues in displaying music files in Tagger.</p>
<title>Neplatný obal alba</title>
<p>Neplatný nebo poškozený formát vloženého obalu alba může způsobit problémy při zobrazování hudebních souborů v aplikaci Označovač.</p>
<note style="advanced">
<p>FFmpeg can be used to fix album art issues. Run the following command to remove album art data from a file:</p>
<code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i in.mp3 out.mp3</code>
<p>Pro opravení problémů s obalem alba lze použít FFmpeg. Spusťte následující příkaz pro odebrání data o obalu alba ze souboru:</p>
<code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i vstup.mp3 vystup.mp3</code>
<p>kde je <code>vstup.mp3</code> cesta k poškozenému souboru a <code>výstup.mp3</code> cesta k exportovanému opětovně kódovanému souboru.</p>
</note>
</section>
Expand Down
8 changes: 4 additions & 4 deletions NickvisionTagger.Shared/Docs/yelp/es/corrupted.page
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<title>Archivos dañados</title>
<p>En esta página se explican los archivos de música con datos dañados.</p>
<p>Si <app>Tagger</app> no puede leer un archivo, se ignorará y se mostrará un diálogo con una lista de los archivos dañados para que los gestione y corrija en consecuencia.</p>
<p>This dialog will offer the option to have Tagger run the appropriate command to try and fix the corrupted file.</p>
<p>Este cuadro de diálogo ofrecerá la opción de que Tagger ejecute el comando adecuado para intentar reparar el archivo dañado.</p>
<section>
<title>Datos no válidos</title>
<p>Un encabezado de etiqueta no válido o datos basura en un archivo pueden causar problemas al leer la información sobre un archivo e incluso causar problemas de reproducción. Algunas páginas web añaden datos basura a los archivos, lo que a su vez provoca su corrupción.</p>
Expand All @@ -37,10 +37,10 @@
</note>
</section>
<section>
<title>Invalid Album Art</title>
<p>An invalid or corrupted embedded album art format can cause issues in displaying music files in Tagger.</p>
<title>Carátula del álbum no válida</title>
<p>Un formato de carátula no válido o dañado puede causar problemas en la visualización de los archivos de música en Tagger.</p>
<note style="advanced">
<p>FFmpeg can be used to fix album art issues. Run the following command to remove album art data from a file:</p>
<p>FFmpeg puede utilizarse para solucionar problemas en las carátulas de los álbumes. Ejecute el siguiente comando para eliminar los datos de las carátulas de un archivo:</p>
<code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i in.mp3 out.mp3</code>
<p>donde <code>in.mp3</code> es la ruta del archivo dañado y <code>out.mp3</code> es la ruta para exportar el archivo recodificado.</p>
</note>
Expand Down
10 changes: 5 additions & 5 deletions NickvisionTagger.Shared/Docs/yelp/ru/corrupted.page
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<title>Повреждённые файлы</title>
<p>This page explains music files with corrupted data.</p>
<p>If <app>Tagger</app> 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>This dialog will offer the option to have Tagger run the appropriate command to try and fix the corrupted file.</p>
<p>В этом окне будет предложена опция, при которой Tagger выполнит команду, которая, возможно, исправит повреждённый файл.</p>
<section>
<title>Invalid Data</title>
<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>
Expand All @@ -43,11 +43,11 @@
</note>
</section>
<section>
<title>Invalid Album Art</title>
<p>An invalid or corrupted embedded album art format can cause issues in displaying music files in Tagger.</p>
<title>Неправильное изображение обложки</title>
<p>Неправильное или повреждённое встроенное изображение обложки альбома может создавать проблемы при отображении музыки в Tagger.</p>
<note style="advanced">
<p>FFmpeg can be used to fix album art issues. Run the following command to remove album art data from a file:</p>
<code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i in.mp3 out.mp3</code>
<p>Вы можете использовать FFmpeg для исправления проблемных обложек. Выполните следующую команду для удаления обложки из файла:</p>
<code>ffmpeg -map 0:a -c:a copy -map_metadata -1 -i исходный.mp3 новый.mp3</code>
<p>
where <code>in.mp3</code> is the file path of the corrupted file and <code>out.mp3</code> is the path to export the re-encoded file.
</p>
Expand Down
18 changes: 10 additions & 8 deletions NickvisionTagger.Shared/Models/MusicFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ static MusicFile()
{
_invalidSystemFilenameCharacters.Remove('\\');
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
else
{
_invalidSystemFilenameCharacters.Remove('/');
_invalidWindowsFilenameCharacters.Remove('/');
nlogozzo marked this conversation as resolved.
Show resolved Hide resolved
}
SortFilesBy = SortBy.Path;
LimitFilenameCharacters = false;
Expand Down Expand Up @@ -544,13 +545,13 @@ public bool SaveTagToDisk(bool preserveModificationTimestamp)
Directory.CreateDirectory(System.IO.Path.GetDirectoryName(newPath)!);
if(File.Exists(newPath))
{
newPath = newPath.Remove(newPath.IndexOf(_dotExtension)) + $" (1){_dotExtension}";
}
var i = 2;
while (File.Exists(newPath))
{
newPath = newPath.Remove(newPath.IndexOf($" ({i - 1})")) + $" ({i}){_dotExtension}";
i++;
newPath = newPath.Remove(newPath.IndexOf(_dotExtension));
var i = 1;
while(File.Exists($"{newPath} ({i}){_dotExtension}"))
{
i++;
}
newPath += $" ({i}){_dotExtension}";
}
File.Move(Path, newPath);
Path = newPath;
Expand Down Expand Up @@ -886,6 +887,7 @@ public bool TagToFilename(string formatString)
{
replace = PublishingDate == DateTime.MinValue ? "" : PublishingDate.ToShortDateString();
}
replace = replace.Replace(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? '\\' : '/', '_');
nlogozzo marked this conversation as resolved.
Show resolved Hide resolved
formatString = formatString.Replace(match.Value, replace);
}
else if (customProps.Contains(value))
Expand Down
Loading
Loading