Skip to content

Commit

Permalink
1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
libgenapps committed Jun 23, 2019
1 parent a61f564 commit ca9cc29
Show file tree
Hide file tree
Showing 97 changed files with 1,926 additions and 975 deletions.
2 changes: 2 additions & 0 deletions LibgenDesktop.Setup/AppFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static AppFiles()
AddFile("HtmlAgilityPack.dll");
AddFile("Microsoft.WindowsAPICodePack.dll");
AddFile("Microsoft.WindowsAPICodePack.Shell.dll");
AddFile("WpfMouseWheelLib.dll");
X86.Add(new AppFile(@"x86\SQLite.Interop.dll", "SQLite.Interop.dll"));
X64.Add(new AppFile(@"x64\SQLite.Interop.dll", "SQLite.Interop.dll"));
AddFile(@"Languages\English.lng");
Expand All @@ -31,6 +32,7 @@ static AppFiles()
AddFile(@"Languages\Spanish.lng");
AddFile(@"Languages\French.lng");
AddFile(@"Mirrors\mirrors.config");
AddFile(@"Mirrors\libgen_io_nonfiction.xslt");
AddFile(@"Mirrors\libgen_pw_nonfiction.xslt");
AddFile(@"Mirrors\libgen_pw_fiction.xslt");
AddFile(@"Mirrors\libgen_pw_scimag.xslt");
Expand Down
4 changes: 2 additions & 2 deletions LibgenDesktop.Setup/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{
internal static class Constants
{
public const string CURRENT_VERSION = "1.3.1";
public const string TITLE_VERSION = "1.3.1";
public const string CURRENT_VERSION = "1.3.2";
public const string TITLE_VERSION = "1.3.2";
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";
Expand Down
23 changes: 16 additions & 7 deletions LibgenDesktop/Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace LibgenDesktop.Common
internal static class Constants
{
public const string DATABASE_METADATA_APP_NAME = "LibgenDesktop";
public const string CURRENT_VERSION = "1.3.1";
public const string CURRENT_GITHUB_RELEASE_NAME = "1.3.1";
public static readonly DateTime CURRENT_GITHUB_RELEASE_DATE = new DateTime(2019, 5, 30);
public const string CURRENT_VERSION = "1.3.2";
public const string CURRENT_GITHUB_RELEASE_NAME = "1.3.2";
public static readonly DateTime CURRENT_GITHUB_RELEASE_DATE = new DateTime(2019, 6, 23);
public const string CURRENT_DATABASE_VERSION = "1.2.1";

public const string APP_SETTINGS_FILE_NAME = "libgen.config";
Expand All @@ -29,8 +29,8 @@ internal static class Constants
public const int NON_FICTION_GRID_PUBLISHER_COLUMN_MIN_WIDTH = 150;
public const int NON_FICTION_GRID_FORMAT_COLUMN_MIN_WIDTH = 80;
public const int NON_FICTION_GRID_FILESIZE_COLUMN_MIN_WIDTH = 130;
public const int NON_FICTION_GRID_OCR_COLUMN_MIN_WIDTH = 55;
public const int NON_FICTION_GRID_EXISTS_IN_LIBRARY_COLUMN_MIN_WIDTH = 55;
public const int NON_FICTION_GRID_OCR_COLUMN_MIN_WIDTH = 60;
public const int NON_FICTION_GRID_EXISTS_IN_LIBRARY_COLUMN_MIN_WIDTH = 60;
public const int FICTION_DETAILS_WINDOW_MIN_WIDTH = 600;
public const int FICTION_DETAILS_WINDOW_MIN_HEIGHT = 500;
public const int FICTION_GRID_TITLE_COLUMN_MIN_WIDTH = 150;
Expand All @@ -40,7 +40,7 @@ internal static class Constants
public const int FICTION_GRID_PUBLISHER_COLUMN_MIN_WIDTH = 150;
public const int FICTION_GRID_FORMAT_COLUMN_MIN_WIDTH = 80;
public const int FICTION_GRID_FILESIZE_COLUMN_MIN_WIDTH = 130;
public const int FICTION_GRID_EXISTS_IN_LIBRARY_COLUMN_MIN_WIDTH = 55;
public const int FICTION_GRID_EXISTS_IN_LIBRARY_COLUMN_MIN_WIDTH = 60;
public const int SCI_MAG_DETAILS_WINDOW_MIN_WIDTH = 600;
public const int SCI_MAG_DETAILS_WINDOW_MIN_HEIGHT = 500;
public const int SCI_MAG_GRID_TITLE_COLUMN_MIN_WIDTH = 150;
Expand All @@ -49,7 +49,7 @@ internal static class Constants
public const int SCI_MAG_GRID_YEAR_COLUMN_MIN_WIDTH = 60;
public const int SCI_MAG_GRID_FILESIZE_COLUMN_MIN_WIDTH = 130;
public const int SCI_MAG_GRID_DOI_COLUMN_MIN_WIDTH = 150;
public const int SCI_MAG_GRID_EXISTS_IN_LIBRARY_COLUMN_MIN_WIDTH = 55;
public const int SCI_MAG_GRID_EXISTS_IN_LIBRARY_COLUMN_MIN_WIDTH = 60;
public const int DOWNLOAD_MANAGER_TAB_DOWNLOADS_PANEL_MIN_HEIGHT = 100;
public const int DOWNLOAD_MANAGER_TAB_LOG_PANEL_MIN_HEIGHT = 50;
public const int DOWNLOAD_MANAGER_TAB_LOG_PANEL_DEFAULT_HEIGHT = 150;
Expand All @@ -75,6 +75,10 @@ internal static class Constants
public const int DATABASE_WINDOW_WIDTH = 500;
public const int ABOUT_WINDOW_WIDTH = 670;
public const int MESSAGE_BOX_WINDOW_WIDTH = 500;
public const int SQL_DEBUGGER_WINDOW_DEFAULT_WIDTH = 620;
public const int SQL_DEBUGGER_WINDOW_DEFAULT_HEIGHT = 450;
public const int SQL_DEBUGGER_WINDOW_MIN_WIDTH = 400;
public const int SQL_DEBUGGER_WINDOW_MIN_HEIGHT = 300;

public const string DEFAULT_DATABASE_FILE_NAME = "libgen.db";
public const string LIBGEN_SERVER_DATABASE_METADATA_APP_NAME = "LibgenServer";
Expand Down Expand Up @@ -117,9 +121,13 @@ internal static class Constants
public const double SEARCH_PROGRESS_REPORT_INTERVAL = 0.1;
public const double IMPORT_PROGRESS_UPDATE_INTERVAL = 0.5;
public const double SYNCHRONIZATION_PROGRESS_UPDATE_INTERVAL = 0.1;
public const int COVER_CACHE_CAPACITY = 1000;
public const long LOW_DISK_SPACE_THRESHOLD_BYTES = 1024 * 1024 * 1024;
public const int DISK_SPACE_CHECK_FOR_EVERY_IMPORTED_ENTRY_COUNT = 10000;
public const int DATABASE_TRANSACTION_BATCH = 500;
public const int MAX_EXPORT_ROWS_PER_FILE = 1048575;
public const int LARGE_NUMBER_OF_ITEMS_TO_DOWNLOAD_WARNING_THRESHOLD = 1000;
public const int LARGE_DOWNLOADER_BATCH_UPDATE_ITEM_COUNT = 1000;
public const int MIN_DOWNLOAD_TIMEOUT = 15;
public const int MAX_DOWNLOAD_TIMEOUT = 9999;
public const int DEFAULT_DOWNLOAD_TIMEOUT = 120;
Expand All @@ -128,6 +136,7 @@ internal static class Constants
public const int MAX_DOWNLOAD_RETRY_DELAY = 9999;
public const int DEFAULT_DOWNLOAD_RETRY_DELAY = 60;
public const int MAX_DOWNLOAD_REDIRECT_COUNT = 10;
public const int ASYNC_LOG_QUEUE_SIZE = 10000;

public const string GITHUB_RELEASE_API_URL = "https://api.github.com/repos/libgenapps/LibgenDesktop/releases";
public const string USER_AGENT = "LibgenDesktop/" + CURRENT_VERSION;
Expand Down
7 changes: 4 additions & 3 deletions LibgenDesktop/Common/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Linq;
using System.Runtime.CompilerServices;
using NLog;
using NLog.Config;
using NLog.Targets;
using NLog.Targets.Wrappers;
using static LibgenDesktop.Common.Constants;

namespace LibgenDesktop.Common
Expand Down Expand Up @@ -55,9 +55,10 @@ private static void CreateLogger()
FileTarget fileTarget = new FileTarget
{
FileName = Environment.LogFilePath,
Layout = "${longdate} [${threadid}] ${callsite} ${level:uppercase=true} ${message}"
Layout = "${longdate} [${threadid}] ${callsite} ${level:uppercase=true} ${message}",
};
loggingConfiguration.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, fileTarget));
AsyncTargetWrapper fileAsyncTargetWrapper = new AsyncTargetWrapper(fileTarget, ASYNC_LOG_QUEUE_SIZE, AsyncTargetWrapperOverflowAction.Grow);
loggingConfiguration.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, fileAsyncTargetWrapper));
LogManager.Configuration = loggingConfiguration;
logger = LogManager.GetLogger(String.Empty);
}
Expand Down
4 changes: 2 additions & 2 deletions LibgenDesktop/Infrastructure/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace LibgenDesktop.Infrastructure
{
internal class Command : ICommand
{
Predicate<object> canExecute = null;
Action<Object> executeAction = null;
private readonly Predicate<object> canExecute = null;
private readonly Action<Object> executeAction = null;

public Command(Action executeAction)
: this(param => true, param => executeAction())
Expand Down
2 changes: 1 addition & 1 deletion LibgenDesktop/Infrastructure/FuncCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void Execute(object parameter)

public TResult Execute()
{
TResult result = executeFunction != null ? executeFunction() : default(TResult);
TResult result = executeFunction != null ? executeFunction() : default;
OnCanExecuteChanged();
return result;
}
Expand Down
4 changes: 3 additions & 1 deletion LibgenDesktop/Infrastructure/RegisteredWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ internal enum WindowKey
APPLICATION_UPDATE_WINDOW,
LIBRARY_WINDOW,
DATABASE_WINDOW,
ABOUT_WINDOW
ABOUT_WINDOW,
SQL_DEBUGGER_WINDOW
}

internal class RegisteredWindow
Expand Down Expand Up @@ -53,6 +54,7 @@ static RegisteredWindows()
RegisterWindow(WindowKey.APPLICATION_UPDATE_WINDOW, typeof(ApplicationUpdateWindow), typeof(ApplicationUpdateWindowViewModel));
RegisterWindow(WindowKey.DATABASE_WINDOW, typeof(DatabaseWindow), typeof(DatabaseWindowViewModel));
RegisterWindow(WindowKey.ABOUT_WINDOW, typeof(AboutWindow), typeof(AboutWindowViewModel));
RegisterWindow(WindowKey.SQL_DEBUGGER_WINDOW, typeof(SqlDebuggerWindow), typeof(SqlDebuggerWindowViewModel));
MessageBox = new MessageBox();
}

Expand Down
16 changes: 16 additions & 0 deletions LibgenDesktop/Infrastructure/SelectionChangedCommandArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Collections;

namespace LibgenDesktop.Infrastructure
{
internal class SelectionChangedCommandArgs
{
public SelectionChangedCommandArgs(IList addedItems, IList removedItems)
{
AddedItems = addedItems;
RemovedItems = removedItems;
}

public IList AddedItems { get; }
public IList RemovedItems { get; }
}
}
3 changes: 2 additions & 1 deletion LibgenDesktop/Infrastructure/ViewModelEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ public enum RegisteredEventId
{
FOCUS_SEARCH_TEXT_BOX = 1,
SCROLL_TO_SELECTION,
BRING_TO_FRONT
BRING_TO_FRONT,
FOCUS_SQL_QUERY_TEXT_BOX
}

public ViewModelEvent(RegisteredEventId eventId)
Expand Down
34 changes: 28 additions & 6 deletions LibgenDesktop/LibgenDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.11\lib\net45\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.6.5\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.22.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.22.0\lib\net45\SharpCompress.dll</HintPath>
Expand Down Expand Up @@ -113,6 +113,9 @@
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WpfMouseWheelLib">
<HintPath>..\Libraries\WpfMouseWheelLib.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
Expand All @@ -134,19 +137,19 @@
<Compile Include="Infrastructure\SaveFileDialogResult.cs" />
<Compile Include="Infrastructure\SelectFolderDialogParameters.cs" />
<Compile Include="Infrastructure\SelectFolderDialogResult.cs" />
<Compile Include="Infrastructure\SelectionChangedCommandArgs.cs" />
<Compile Include="Infrastructure\ViewModelEvent.cs" />
<Compile Include="Infrastructure\WindowContext.cs" />
<Compile Include="Infrastructure\WindowManager.cs" />
<Compile Include="Common\Logger.cs" />
<Compile Include="Models\Database\DatabaseStats.cs" />
<Compile Include="Models\Database\Migration.cs" />
<Compile Include="Models\Database\SearchQueryParser.cs" />
<Compile Include="Models\Download\CoverCache.cs" />
<Compile Include="Models\Download\Downloader.cs" />
<Compile Include="Models\Download\DownloaderBatchEventArgs.cs" />
<Compile Include="Models\Download\DownloaderEventArgs.cs" />
<Compile Include="Models\Download\DownloadItem.cs" />
<Compile Include="Models\Download\DownloadItemLogLineEventArgs.cs" />
<Compile Include="Models\Download\DownloadItemChangedEventArgs.cs" />
<Compile Include="Models\Download\DownloadItemRemovedEventArgs.cs" />
<Compile Include="Models\Download\DownloadItemAddedEventArgs.cs" />
<Compile Include="Models\Download\DownloadItemLogLine.cs" />
<Compile Include="Models\Download\DownloadItemLogLineType.cs" />
<Compile Include="Models\Download\DownloadItemRequest.cs" />
Expand Down Expand Up @@ -177,6 +180,7 @@
<Compile Include="Models\Localization\Localizators\ApplicationUpdateLocalizator.cs" />
<Compile Include="Models\Localization\Localizators\CommonDetailsTabLocalizator.cs" />
<Compile Include="Models\Localization\Localizators\AboutWindowLocalizator.cs" />
<Compile Include="Models\Localization\Localizators\SqlDebuggerWindowLocalizator.cs" />
<Compile Include="Models\Localization\Localizators\LibraryTabLocalizator.cs" />
<Compile Include="Models\Localization\Localizators\DatabaseWindowLocalizator.cs" />
<Compile Include="Models\Localization\Localizators\CreateDatabaseWindowLocalizator.cs" />
Expand Down Expand Up @@ -211,6 +215,8 @@
<Compile Include="Models\ProgressArgs\DownloadFileProgress.cs" />
<Compile Include="Models\ProgressArgs\GenericProgress.cs" />
<Compile Include="Models\ProgressArgs\ImportCreateIndexProgress.cs" />
<Compile Include="Models\ProgressArgs\SynchronizationDiskSpaceProgress.cs" />
<Compile Include="Models\ProgressArgs\ImportDiskSpaceProgress.cs" />
<Compile Include="Models\ProgressArgs\ImportLoadLibgenIdsProgress.cs" />
<Compile Include="Models\ProgressArgs\ImportObjectsProgress.cs" />
<Compile Include="Models\ProgressArgs\ImportSearchTableDefinitionProgress.cs" />
Expand All @@ -220,7 +226,7 @@
<Compile Include="Models\ProgressArgs\ScanCompleteProgress.cs" />
<Compile Include="Models\ProgressArgs\ScanProgress.cs" />
<Compile Include="Models\ProgressArgs\SearchProgress.cs" />
<Compile Include="Models\ProgressArgs\SynchronizationProgress.cs" />
<Compile Include="Models\ProgressArgs\SynchronizationObjectsProgress.cs" />
<Compile Include="Models\Settings\Mirrors.cs" />
<Compile Include="Models\Settings\MirrorStorage.cs" />
<Compile Include="Models\SqlDump\ColumnDefinition.cs" />
Expand Down Expand Up @@ -268,6 +274,7 @@
<Compile Include="ViewModels\Panels\ExportPanelViewModel.cs" />
<Compile Include="ViewModels\Tabs\FictionDetailsTabViewModel.cs" />
<Compile Include="ViewModels\Panels\ImportLogPanelViewModel.cs" />
<Compile Include="ViewModels\Windows\SqlDebuggerWindowViewModel.cs" />
<Compile Include="ViewModels\Windows\LibgenWindowViewModel.cs" />
<Compile Include="ViewModels\SearchResultItems\SearchResultItemViewModel.cs" />
<Compile Include="ViewModels\Tabs\SearchResultsTabViewModel.cs" />
Expand Down Expand Up @@ -325,6 +332,9 @@
<Compile Include="Views\Windows\DatabaseWindow.xaml.cs">
<DependentUpon>DatabaseWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Windows\SqlDebuggerWindow.xaml.cs">
<DependentUpon>SqlDebuggerWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Windows\MessageBoxWindow.xaml.cs">
<DependentUpon>MessageBoxWindow.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -407,6 +417,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Styles\SqlDebuggerWindowStyles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Styles\LibraryTabStyles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -451,6 +465,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Windows\SqlDebuggerWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Windows\MessageBoxWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -676,6 +694,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Mirrors\mirrors.config</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="Resources\Mirrors\libgen_io_nonfiction.xslt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Mirrors\libgen_io_nonfiction.xslt</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="Resources\Mirrors\libgen_pw_nonfiction.xslt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Mirrors\libgen_pw_nonfiction.xslt</TargetPath>
Expand Down
Loading

0 comments on commit ca9cc29

Please sign in to comment.