From 37ba3103c263f33bad81520eda53ad8cd962c12a Mon Sep 17 00:00:00 2001
From: libgenapps <33476799+libgenapps@users.noreply.github.com>
Date: Wed, 23 May 2018 05:39:01 +0300
Subject: [PATCH] xslt update
---
LibgenDesktop.Setup/AppFiles.cs | 3 +-
LibgenDesktop.Setup/Constants.cs | 4 +-
LibgenDesktop/Common/Constants.cs | 6 +-
LibgenDesktop/LibgenDesktop.csproj | 9 +-
.../Localizators/LibraryWindowLocalizator.cs | 24 +++-
.../Models/Localization/Translation.cs | 11 ++
LibgenDesktop/Models/MainModel.cs | 90 +++++++++------
.../ProgressArgs/ScanCompleteProgress.cs | 4 +-
.../Models/ProgressArgs/ScanProgress.cs | 5 +-
LibgenDesktop/Resources/Languages/English.lng | 13 ++-
LibgenDesktop/Resources/Languages/Russian.lng | 13 ++-
.../Resources/Mirrors/booksc_org_step1.xslt | 9 ++
.../Resources/Mirrors/booksc_org_step2.xslt | 9 ++
.../Resources/Mirrors/mirrors.config | 4 +-
.../Library/ScanResultItemViewModel.cs | 25 ++++
.../Windows/LibraryWindowViewModel.cs | 109 ++++++++++++++++--
.../Views/Windows/LibraryWindow.xaml | 78 +++++++++++--
17 files changed, 342 insertions(+), 74 deletions(-)
create mode 100644 LibgenDesktop/Resources/Mirrors/booksc_org_step1.xslt
create mode 100644 LibgenDesktop/Resources/Mirrors/booksc_org_step2.xslt
create mode 100644 LibgenDesktop/ViewModels/Library/ScanResultItemViewModel.cs
diff --git a/LibgenDesktop.Setup/AppFiles.cs b/LibgenDesktop.Setup/AppFiles.cs
index 3de509e..2c2f7c2 100644
--- a/LibgenDesktop.Setup/AppFiles.cs
+++ b/LibgenDesktop.Setup/AppFiles.cs
@@ -42,7 +42,8 @@ static AppFiles()
AddFile(@"Mirrors\bookfi_net.xslt");
AddFile(@"Mirrors\b_ok_xyz_step1.xslt");
AddFile(@"Mirrors\b_ok_xyz_step2.xslt");
- AddFile(@"Mirrors\booksc_org.xslt");
+ AddFile(@"Mirrors\booksc_org_step1.xslt");
+ AddFile(@"Mirrors\booksc_org_step2.xslt");
}
public static string GetBinariesDirectoryPath(bool is64Bit)
diff --git a/LibgenDesktop.Setup/Constants.cs b/LibgenDesktop.Setup/Constants.cs
index 67c382f..e39a086 100644
--- a/LibgenDesktop.Setup/Constants.cs
+++ b/LibgenDesktop.Setup/Constants.cs
@@ -2,8 +2,8 @@
{
internal static class Constants
{
- public const string CURRENT_VERSION = "1.1.3";
- public const string TITLE_VERSION = "1.1.3";
+ public const string CURRENT_VERSION = "1.1.4";
+ public const string TITLE_VERSION = "1.1.4";
public const string PRODUCT_TITLE_FORMAT = "Libgen Desktop " + TITLE_VERSION + " ({0}-bit)";
public const string SHORTCUT_TITLE_FORMAT = "Libgen Desktop ({0}-bit)";
public const string PRODUCT_COMPANY = "Libgen Apps";
diff --git a/LibgenDesktop/Common/Constants.cs b/LibgenDesktop/Common/Constants.cs
index 046099f..f34d362 100644
--- a/LibgenDesktop/Common/Constants.cs
+++ b/LibgenDesktop/Common/Constants.cs
@@ -4,9 +4,9 @@ namespace LibgenDesktop.Common
{
internal static class Constants
{
- public const string CURRENT_VERSION = "1.1.3";
- public const string CURRENT_GITHUB_RELEASE_NAME = "1.1.3";
- public static readonly DateTime CURRENT_GITHUB_RELEASE_DATE = new DateTime(2018, 5, 22);
+ public const string CURRENT_VERSION = "1.1.4";
+ public const string CURRENT_GITHUB_RELEASE_NAME = "1.1.4";
+ public static readonly DateTime CURRENT_GITHUB_RELEASE_DATE = new DateTime(2018, 5, 23);
public const string CURRENT_DATABASE_VERSION = "1.0";
public const string APP_SETTINGS_FILE_NAME = "libgen.config";
diff --git a/LibgenDesktop/LibgenDesktop.csproj b/LibgenDesktop/LibgenDesktop.csproj
index ad5a37f..545e133 100644
--- a/LibgenDesktop/LibgenDesktop.csproj
+++ b/LibgenDesktop/LibgenDesktop.csproj
@@ -237,6 +237,7 @@
+
@@ -701,9 +702,13 @@
PreserveNewest
Mirrors\b_ok_xyz_step2.xslt
-
+
PreserveNewest
- Mirrors\booksc_org.xslt
+ Mirrors\booksc_org_step1.xslt
+
+
+ PreserveNewest
+ Mirrors\booksc_org_step2.xslt
PreserveNewest
diff --git a/LibgenDesktop/Models/Localization/Localizators/LibraryWindowLocalizator.cs b/LibgenDesktop/Models/Localization/Localizators/LibraryWindowLocalizator.cs
index 2bb5f0e..36437f3 100644
--- a/LibgenDesktop/Models/Localization/Localizators/LibraryWindowLocalizator.cs
+++ b/LibgenDesktop/Models/Localization/Localizators/LibraryWindowLocalizator.cs
@@ -12,22 +12,38 @@ public LibraryWindowLocalizator(List prioritizedTranslationList, La
Scan = Format(translation => translation?.Scan);
BrowseDirectoryDialogTitle = Format(translation => translation?.BrowseDirectoryDialogTitle);
CreatingIndexes = Format(translation => translation?.CreatingIndexes);
- NotFound = Format(translation => translation?.NotFound);
+ ScanLog = Format(translation => translation?.ScanLog);
+ Error = Format(translation => translation?.Error);
+ ColumnsFile = Format(translation => translation?.File);
+ ColumnsAuthors = Format(translation => translation?.Authors);
+ ColumnsTitle = Format(translation => translation?.Title);
}
public string WindowTitle { get; }
public string Scan { get; }
public string BrowseDirectoryDialogTitle { get; }
public string CreatingIndexes { get; }
- public string NotFound { get; }
+ public string ScanLog { get; }
+ public string Error { get; }
+ public string ColumnsFile { get; }
+ public string ColumnsAuthors { get; }
+ public string ColumnsTitle { get; }
public string GetScanStartedString(string directory) => Format(translation => translation?.ScanStarted, new { directory });
- public string GetScanCompleteString(int found, int notFound) => Format(translation => translation?.ScanComplete,
- new { found = Formatter.ToFormattedString(found), notFound = Formatter.ToFormattedString(notFound) });
+ public string GetFoundString(int count) => Format(translation => translation?.Found, new { count });
+ public string GetNotFoundString(int count) => Format(translation => translation?.NotFound, new { count });
+ public string GetScanCompleteString(int found, int notFound, int errors) => Format(translation => translation?.ScanComplete,
+ new { found = Formatter.ToFormattedString(found), notFound = Formatter.ToFormattedString(notFound),
+ errors = Formatter.ToFormattedString(errors) });
private string Format(Func field, object templateArguments = null)
{
return Format(translation => field(translation?.Library), templateArguments);
}
+
+ private string Format(Func field, object templateArguments = null)
+ {
+ return Format(translation => field(translation?.Library?.Columns), templateArguments);
+ }
}
}
diff --git a/LibgenDesktop/Models/Localization/Translation.cs b/LibgenDesktop/Models/Localization/Translation.cs
index fa75097..b5106cc 100644
--- a/LibgenDesktop/Models/Localization/Translation.cs
+++ b/LibgenDesktop/Models/Localization/Translation.cs
@@ -544,6 +544,13 @@ internal class SynchronizationTranslation
public SynchronizationLogMessagesTranslation LogMessages { get; set; }
}
+ internal class LibraryColumnsTranslation
+ {
+ public string File { get; set; }
+ public string Authors { get; set; }
+ public string Title { get; set; }
+ }
+
internal class LibraryTranslation
{
public string WindowTitle { get; set; }
@@ -551,8 +558,12 @@ internal class LibraryTranslation
public string BrowseDirectoryDialogTitle { get; set; }
public string ScanStarted { get; set; }
public string CreatingIndexes { get; set; }
+ public string Found { get; set; }
public string NotFound { get; set; }
+ public string ScanLog { get; set; }
+ public string Error { get; set; }
public string ScanComplete { get; set; }
+ public LibraryColumnsTranslation Columns { get; set; }
}
internal class DatabaseTranslation
diff --git a/LibgenDesktop/Models/MainModel.cs b/LibgenDesktop/Models/MainModel.cs
index 54e7153..8c82038 100644
--- a/LibgenDesktop/Models/MainModel.cs
+++ b/LibgenDesktop/Models/MainModel.cs
@@ -489,6 +489,7 @@ public Task ScanAsync(string scanDirectory, IProgress