Skip to content

Commit

Permalink
Merge pull request #9 from zhangjk95/master
Browse files Browse the repository at this point in the history
Version 0.6.0
  • Loading branch information
zhangjk95 authored Aug 8, 2021
2 parents 81d3aac + 2f33217 commit 4be266d
Show file tree
Hide file tree
Showing 115 changed files with 134,006 additions and 10,847 deletions.
8 changes: 4 additions & 4 deletions Etupirka.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.852
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Etupirka", "Etupirka\Etupirka.csproj", "{2DE8A7AD-A633-4CE4-AB24-9590A7BB0202}"
EndProject
Expand All @@ -11,8 +11,8 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2DE8A7AD-A633-4CE4-AB24-9590A7BB0202}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{2DE8A7AD-A633-4CE4-AB24-9590A7BB0202}.Debug|Any CPU.Build.0 = Release|Any CPU
{2DE8A7AD-A633-4CE4-AB24-9590A7BB0202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2DE8A7AD-A633-4CE4-AB24-9590A7BB0202}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DE8A7AD-A633-4CE4-AB24-9590A7BB0202}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DE8A7AD-A633-4CE4-AB24-9590A7BB0202}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Expand Down
4 changes: 1 addition & 3 deletions Etupirka/Dialog/GlobalSettingDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ namespace Etupirka.Dialogs
public partial class GlobalSettingDialog : MetroWindow
{

// Views.ProxyConfigView pcv;
public GlobalSettingDialog()
{
InitializeComponent();
if (Properties.Settings.Default.disableGlowBrush)
{
this.GlowBrush = null;
}
// pcv = new Views.ProxyConfigView();
}

private void btnDialogOk_Click(object sender, RoutedEventArgs e)
Expand All @@ -50,7 +48,7 @@ private void btnDialogOk_Click(object sender, RoutedEventArgs e)
Properties.Settings.Default.disableGlowBrush = GeneralView.DisableGlowBrush;
Properties.Settings.Default.hideListWhenPlaying = GeneralView.HideListWhenPlaying;
Properties.Settings.Default.useOfflineESDatabase = DatabaseView.UseOfflineDatabase;
Properties.Settings.Default.databaseSyncServer = DatabaseView.DatabaseSyncServer;
Properties.Settings.Default.useGoogleCache = DatabaseView.UseGoogleCache;
Properties.Settings.Default.Save();
this.DialogResult = true;
}
Expand Down
78 changes: 36 additions & 42 deletions Etupirka/Etupirka.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Etupirka</RootNamespace>
<AssemblyName>Etupirka</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand All @@ -28,7 +28,8 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>2430b868</NuGetPackageImportStamp>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -59,75 +60,68 @@
<StartupObject>Etupirka.App</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll</HintPath>
</Reference>
<Reference Include="De.TorstenMandelkow.MetroChart">
<HintPath>..\packages\De.TorstenMandelkow.MetroChart.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.0.0\lib\net40\EntityFramework.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.0.0\lib\net40\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.5\lib\net40\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.5\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.11.34.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.11.34\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="Loya.Dameer">
<HintPath>..\packages\Loya.Dameer.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.1.2.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net40\MahApps.Metro.dll</HintPath>
<Private>True</Private>
<Reference Include="MahApps.Metro, Version=1.6.5.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.6.5\lib\net46\MahApps.Metro.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.19\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.98.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.98.1\lib\net40\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\System.Data.SQLite.Core.1.0.98.1\lib\net46\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.EF6, Version=1.0.98.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.98.1\lib\net40\System.Data.SQLite.EF6.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.98.1\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.Linq, Version=1.0.98.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.98.1\lib\net40\System.Data.SQLite.Linq.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.98.1\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.IO, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.IO.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Net" />
<Reference Include="System.Runtime, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.Threading.Tasks, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Threading.Tasks.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net40\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
Expand Down Expand Up @@ -397,18 +391,18 @@
<Content Include="Resources\devcon64.exe" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.98.1\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.98.1\build\net40\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.98.1\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.98.1\build\net40\System.Data.SQLite.Core.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<Import Project="..\packages\System.Data.SQLite.Core.1.0.98.1\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.98.1\build\net46\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.98.1\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.98.1\build\net46\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
41 changes: 13 additions & 28 deletions Etupirka/GameData/GameInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;

namespace Etupirka
{
Expand Down Expand Up @@ -35,19 +36,6 @@ public void GenerateUID()
}

public GameInfo() { erogameScapeID = -1; }
public GameInfo(string _title)
{
title = _title;
GenerateUID();
}

public GameInfo(int _erogameScapeID)
{
erogameScapeID = _erogameScapeID;
GenerateUID();
updateInfoFromES();

}

protected int erogameScapeID;
public int ErogameScapeID
Expand Down Expand Up @@ -93,6 +81,7 @@ public string SaleDayString
else return "";
}
}

public async Task updateInfoFromES()
{
if (Properties.Settings.Default.useOfflineESDatabase)
Expand All @@ -103,41 +92,37 @@ public async Task updateInfoFromES()
{
await updateInfoFromESOnline();
}

}

public void updateInfoFromESOffline()
{
if (erogameScapeID > 0)
{
Utility.im.getEsInfo(this);
/* int pos = Utility.esInfo.getTermID(ErogameScapeID);
if (pos >= 0)
{
Title = System.Net.WebUtility.HtmlDecode(Utility.esInfo.name[pos]);
Brand = System.Net.WebUtility.HtmlDecode(Utility.esInfo.brand[pos]);
SaleDay = DateTime.ParseExact(Utility.esInfo.saleday[pos], "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
}*/
}
}

public async Task updateInfoFromESOnline()
{
if (erogameScapeID > 0)
{
var document = await NetworkUtility.GetHtmlDocument("http://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/game.php?game=" + erogameScapeID);

Title = document.GetElementById("soft-title").GetElementsByTagName("span")[0].InnerText;
Brand = document.GetElementById("brand").GetElementsByTagName("td")[0].InnerText;
string saleday = document.GetElementById("sellday").GetElementsByTagName("td")[0].InnerText;
var uri = "http://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/game.php?game=" + erogameScapeID;
if (Properties.Settings.Default.useGoogleCache)
{
uri = "https://webcache.googleusercontent.com/search?q=cache:" + HttpUtility.UrlEncode(uri) + "&strip=1";
}
var document = await NetworkUtility.GetHtmlDocument(uri);
Title = HttpUtility.HtmlDecode(document.GetElementbyId("game_title").InnerText);
Brand = HttpUtility.HtmlDecode(document.GetElementbyId("brand").Descendants("td").First().InnerText);
string saleday = HttpUtility.HtmlDecode(document.GetElementbyId("sellday").Descendants("td").First().InnerText);
SaleDay = DateTime.ParseExact(saleday, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
}
}

protected void OnPropertyChanged(string name)
{
if (PropertyChanged == null) return;
PropertyChanged(this, new PropertyChangedEventArgs(name));
if (PropertyChanged == null) return;
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
}
39 changes: 14 additions & 25 deletions Etupirka/InformationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class InformationManager
{
private string db_file;
public SQLiteConnection conn;

public InformationManager(string file)
{
create(file);

}
public void create(string file)
{
Expand Down Expand Up @@ -86,36 +86,25 @@ public List<GameInfo> getAllEsInfo()
}
}

public bool update(string[] line)
public void update(List<GameInfo> infoList)
{
try
using (SQLiteCommand insertRngCmd = (SQLiteCommand)conn.CreateCommand())
{
using (SQLiteCommand insertRngCmd = (SQLiteCommand)conn.CreateCommand())
insertRngCmd.CommandText = @"INSERT or REPLACE INTO erogamescape VALUES(@ID,@TITLE,@SALEDAY,@BRAND)";
conn.Open();
using (var transaction = conn.BeginTransaction())
{
insertRngCmd.CommandText = @"INSERT or REPLACE INTO erogamescape VALUES(@ID,@TITLE,@SALEDAY,@BRAND)";
conn.Open();
using (var transaction = conn.BeginTransaction())
foreach (GameInfo info in infoList)
{
foreach (string i in line)
{
string[] values = i.Split('\t');
if (i.Count() < 4) continue;

insertRngCmd.Parameters.AddWithValue("@ID", values[0]);
insertRngCmd.Parameters.AddWithValue("@TITLE", values[1]);
insertRngCmd.Parameters.AddWithValue("@SALEDAY", values[2]);
insertRngCmd.Parameters.AddWithValue("@BRAND", values[3]);
insertRngCmd.ExecuteNonQuery();
}
transaction.Commit();
insertRngCmd.Parameters.AddWithValue("@ID", info.ErogameScapeID);
insertRngCmd.Parameters.AddWithValue("@TITLE", info.Title);
insertRngCmd.Parameters.AddWithValue("@SALEDAY", info.SaleDay.ToString("yyyy-MM-dd"));
insertRngCmd.Parameters.AddWithValue("@BRAND", info.Brand);
insertRngCmd.ExecuteNonQuery();
}
conn.Close();
transaction.Commit();
}
return true;
}
catch
{
return false;
conn.Close();
}
}
}
Expand Down
Loading

0 comments on commit 4be266d

Please sign in to comment.