mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
[App] Be more verbose about what is happening when a file is not imported because not known, or duplicate.
This commit is contained in:
@@ -66,10 +66,9 @@ internal static class Program
|
|||||||
public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>()
|
public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>()
|
||||||
.UsePlatformDetect()
|
.UsePlatformDetect()
|
||||||
|
|
||||||
//#if DEBUG
|
#if DEBUG
|
||||||
// .LogToSerilog(LogEventLevel.Debug);
|
.LogToSerilog(LogEventLevel.Debug);
|
||||||
//#else
|
#else
|
||||||
.LogToSerilog(LogEventLevel.Information);
|
.LogToSerilog(LogEventLevel.Information);
|
||||||
|
#endif
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
12
RomRepoMgr/Resources/Localization.Designer.cs
generated
12
RomRepoMgr/Resources/Localization.Designer.cs
generated
@@ -794,5 +794,17 @@ namespace RomRepoMgr.Resources {
|
|||||||
return ResourceManager.GetString("ErrorProcessingArchive", resourceCulture);
|
return ResourceManager.GetString("ErrorProcessingArchive", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string UnknownFile {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("UnknownFile", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string FileAlreadyInRepository {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("FileAlreadyInRepository", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,4 +393,10 @@ Tardará mucho tiempo...</value>
|
|||||||
<data name="ErrorProcessingArchive" xml:space="preserve">
|
<data name="ErrorProcessingArchive" xml:space="preserve">
|
||||||
<value>Error procesando archivo.</value>
|
<value>Error procesando archivo.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="UnknownFile" xml:space="preserve">
|
||||||
|
<value>Fichero desconocido.</value>
|
||||||
|
</data>
|
||||||
|
<data name="FileAlreadyInRepository" xml:space="preserve">
|
||||||
|
<value>Fichero ya en el repositorio.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -401,4 +401,10 @@ This will take a long time...</value>
|
|||||||
<data name="ErrorProcessingArchive" xml:space="preserve">
|
<data name="ErrorProcessingArchive" xml:space="preserve">
|
||||||
<value>Error processing archive.</value>
|
<value>Error processing archive.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="UnknownFile" xml:space="preserve">
|
||||||
|
<value>Unknown file.</value>
|
||||||
|
</data>
|
||||||
|
<data name="FileAlreadyInRepository" xml:space="preserve">
|
||||||
|
<value>File already in repository.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -404,14 +404,41 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
|||||||
// Process files in archive
|
// Process files in archive
|
||||||
while(reader.MoveToNextEntry())
|
while(reader.MoveToNextEntry())
|
||||||
{
|
{
|
||||||
|
string filename = Path.GetFileName(reader.Entry.Key);
|
||||||
|
|
||||||
if(reader.Entry.IsDirectory) continue;
|
if(reader.Entry.IsDirectory) continue;
|
||||||
|
|
||||||
if(reader.Entry.Crc == 0 && KnownOnlyChecked) continue;
|
if(reader.Entry.Crc == 0 && KnownOnlyChecked ||
|
||||||
|
!archiveImporter.IsCrcInDb(reader.Entry.Crc) && KnownOnlyChecked)
|
||||||
|
{
|
||||||
|
Dispatcher.UIThread.Post(() => Importers.Add(new RomImporter
|
||||||
|
{
|
||||||
|
Filename = filename,
|
||||||
|
Indeterminate = false,
|
||||||
|
Progress = 1,
|
||||||
|
Maximum = 1,
|
||||||
|
Minimum = 0,
|
||||||
|
StatusMessage = Localization.UnknownFile
|
||||||
|
}));
|
||||||
|
|
||||||
if(!archiveImporter.IsCrcInDb(reader.Entry.Crc) && KnownOnlyChecked) continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Do not import files that are already in the repository
|
// Do not import files that are already in the repository
|
||||||
if(archiveImporter.IsInRepo(reader.Entry.Crc)) continue;
|
if(archiveImporter.IsInRepo(reader.Entry.Crc))
|
||||||
|
{
|
||||||
|
Dispatcher.UIThread.Post(() => Importers.Add(new RomImporter
|
||||||
|
{
|
||||||
|
Filename = filename,
|
||||||
|
Indeterminate = false,
|
||||||
|
Progress = 1,
|
||||||
|
Maximum = 1,
|
||||||
|
Minimum = 0,
|
||||||
|
StatusMessage = Localization.FileAlreadyInRepository
|
||||||
|
}));
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var model = new RomImporter
|
var model = new RomImporter
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user