Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/qedsd/omdb
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzhiqin committed Jul 18, 2023
2 parents 3b80faf + 45abf63 commit 52357af
Show file tree
Hide file tree
Showing 32 changed files with 299 additions and 310 deletions.
14 changes: 5 additions & 9 deletions OMDb.Core/Helpers/ImageHelper.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using ImageMagick;
using OMDb.Core.Const;
using OMDb.Core.Const;
using OMDb.Core.Models;
using OMDb.Core.Services;
using OMDb.Core.Utils.Extensions;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors;
using System.Net;
using ImageInfo = OMDb.Core.Models.ImageInfo;

namespace OMDb.Core.Helpers
{
Expand All @@ -17,12 +13,12 @@ public static void GetImageSize(string path, out double Wpx, out double Hpx)
{
try
{
MagickImageInfo image = new MagickImageInfo(path);
ImageMagick.MagickImageInfo image = new ImageMagick.MagickImageInfo(path);
int w = image.Width;//宽
int h = image.Height;//高
Wpx = image.Density.X;//分辨率
Hpx = image.Density.Y;//分辨率
if (image.Density.Units == DensityUnit.PixelsPerCentimeter)//判断分辨率单位
if (image.Density.Units == ImageMagick.DensityUnit.PixelsPerCentimeter)//判断分辨率单位
{
Wpx *= 2.54;
Hpx *= 2.54;
Expand All @@ -38,7 +34,7 @@ public static ImageInfo GetImageInfo(string path)
try
{
ImageInfo imageInfo = new ImageInfo();
MagickImageInfo image = new MagickImageInfo(path);
ImageMagick.MagickImageInfo image = new ImageMagick.MagickImageInfo(path);
imageInfo.Width = image.Width;
imageInfo.Height = image.Height;
imageInfo.FullPath = path;
Expand Down
4 changes: 1 addition & 3 deletions OMDb.Core/Helpers/RandomHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Google.Protobuf.WellKnownTypes;
using Org.BouncyCastle.Utilities;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
Expand Down
18 changes: 9 additions & 9 deletions OMDb.Core/OMDb.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

<ItemGroup>
<PackageReference Include="DotNetCore.NPOI" Version="1.2.3" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="12.2.1" />
<PackageReference Include="Magick.NET.Core" Version="12.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NLog" Version="5.1.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="SqlSugarCore" Version="5.1.3.34" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.49" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="13.1.3" />
<PackageReference Include="Magick.NET.Core" Version="13.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.2.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.91" />
<PackageReference Include="System.Composition.AttributedModel" Version="7.0.0" />
<PackageReference Include="System.Composition.Convention" Version="7.0.0" />
<PackageReference Include="System.Composition.TypedParts" Version="7.0.0" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.117" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.0" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.118" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.6" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion OMDb.Core/Services/DbService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Org.BouncyCastle.Math.EC.ECCurve;

namespace OMDb.Core.Services
{
Expand Down
4 changes: 1 addition & 3 deletions OMDb.Core/Utils/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Google.Protobuf.WellKnownTypes;
using Org.BouncyCastle.Utilities;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
Expand Down
4 changes: 2 additions & 2 deletions OMDb.Douban/OMDb.Douban.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
<PackageReference Include="NLog" Version="5.1.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.49" />
<PackageReference Include="NLog" Version="5.2.2" />
<PackageReference Include="System.Composition.AttributedModel" Version="7.0.0" />
</ItemGroup>

Expand Down
4 changes: 4 additions & 0 deletions OMDb.WinUI3/OMDb.WinUI3/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
x:Class="OMDb.WinUI3.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:OMDb.WinUI3.Converters"
xmlns:local="using:OMDb.WinUI3">
<Application.Resources>
<ResourceDictionary>
Expand All @@ -18,6 +19,9 @@
<x:Double x:Key="ContentDialogMaxWidth">1000</x:Double>
<x:Double x:Key="ContentDialogMinWidth">10</x:Double>
<x:Double x:Key="ContentDialogMinHeight">10</x:Double>
<converters:BoolToVisibilityConverter x:Key="TrueToVisibleConverter" />
<converters:BoolToVisibilityConverter x:Key="FalseToVisibleConverter" IsReverse="True" />
<converters:BoolReverseConverte x:Key="BoolReverseConverte" />
</ResourceDictionary>
</Application.Resources>
</Application>
Binary file modified OMDb.WinUI3/OMDb.WinUI3/Assets/Img/logo_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public object ConvertBack(object value, Type targetType, object parameter, strin
{
return Visibility.Collapsed;
}
if ((bool)value)
if (value.GetType() == typeof(bool) && (bool)value)
{
return IsReverse ? Visibility.Collapsed : Visibility.Visible;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using OMDb.WinUI3.Services;
using OMDb.WinUI3.Services.Settings;
using OMDb.WinUI3.ViewModels;
using Org.BouncyCastle.Utilities;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down
12 changes: 11 additions & 1 deletion OMDb.WinUI3/OMDb.WinUI3/Helpers/WindowHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.UI.Xaml;
using System;
using System.Collections.Generic;

namespace OMDb.WinUI3.Helpers
Expand Down Expand Up @@ -45,6 +46,15 @@ public static void SetMainWindow(Window window)
{
MainWindow = window;
}

public static IntPtr GetWindowHandle(Window window)
{
return WinRT.Interop.WindowNative.GetWindowHandle(window);
}
public static Microsoft.UI.Windowing.AppWindow GetAppWindow(Window window)
{
var hWnd = GetWindowHandle(window);
Microsoft.UI.WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd);
return Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);
}
}
}
1 change: 0 additions & 1 deletion OMDb.WinUI3/OMDb.WinUI3/MyControls/StorageCard.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using OMDb.WinUI3.Helpers;
using OMDb.WinUI3.Models;
using OMDb.WinUI3.ViewModels;
using Org.BouncyCastle.Asn1.X509;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down
26 changes: 22 additions & 4 deletions OMDb.WinUI3/OMDb.WinUI3/OMDb.WinUI3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>
<BaseOutputPath>bin\</BaseOutputPath>
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
<!--package需注释掉-->
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<WindowsPackageType>None</WindowsPackageType>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyName>OMDb</AssemblyName>
<!--package需注释掉-->
</PropertyGroup>
<ItemGroup>
<Compile Remove="Enums\**" />
Expand Down Expand Up @@ -94,13 +102,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
<PackageReference Include="DotNetCore.NPOI" Version="1.2.3" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.3.230602002" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.0" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.6" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

Expand Down Expand Up @@ -372,10 +380,20 @@
<Folder Include="Assets\FFmpeg\" />
</ItemGroup>

<ItemGroup>
<None Include="Properties\PublishProfiles\win10-x64.pubxml.user" />
</ItemGroup>

<ItemGroup>
<Page Update="MyControls\ExplorerControl.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<None Update="Assets\Img\logo_32.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="logo_32.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="nlog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
7 changes: 7 additions & 0 deletions OMDb.WinUI3/OMDb.WinUI3/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"profiles": {
"OMDb": {
"commandName": "Project"
}
}
}
2 changes: 1 addition & 1 deletion OMDb.WinUI3/OMDb.WinUI3/Services/ActivationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static class ActivationService
{
public static void Init()
{
Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "zh-CN";
//Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "zh-CN";
ConfigService.Load();
//SettingService.Load();
RecentFileService.Init();
Expand Down
1 change: 0 additions & 1 deletion OMDb.WinUI3/OMDb.WinUI3/Services/ConfigService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Newtonsoft.Json;
using OMDb.WinUI3.Models;
using OMDb.WinUI3.Services.Settings;
using Org.BouncyCastle.Utilities;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down
3 changes: 1 addition & 2 deletions OMDb.WinUI3/OMDb.WinUI3/Services/ExcelService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Google.Protobuf.WellKnownTypes;
using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.Core;
using NPOI.OpenXmlFormats.Vml;
using NPOI.POIFS.FileSystem;
using NPOI.SS.Formula;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using CommunityToolkit.Mvvm.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
using MySqlX.XDevAPI.Common;
using OMDb.Core.Enums;
using OMDb.Core.Helpers;
using OMDb.Core.Models;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Google.Protobuf.WellKnownTypes;
using Microsoft.UI.Xaml.Controls;
using OMDb.Core.DbModels;
using OMDb.Core.Models;
Expand Down
3 changes: 0 additions & 3 deletions OMDb.WinUI3/OMDb.WinUI3/ViewModels/LabelPropertyViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.UI.Xaml.Media;
using MySqlX.XDevAPI.Common;
using Newtonsoft.Json;
using OMDb.WinUI3.Models;
using OMDb.WinUI3.Services;
Expand All @@ -14,7 +13,6 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
//using Microsoft.UI.Xaml.Media;
using Microsoft.UI;
using System.Xml.Linq;
using Microsoft.UI.Xaml;
Expand All @@ -24,7 +22,6 @@
using OMDb.WinUI3.Services.Settings;
using System.ComponentModel.Design;
using OMDb.Core.DbModels;
using Org.BouncyCastle.Crypto;

namespace OMDb.WinUI3.ViewModels
{
Expand Down
2 changes: 0 additions & 2 deletions OMDb.WinUI3/OMDb.WinUI3/ViewModels/LabelViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.UI.Xaml.Media;
using MySqlX.XDevAPI.Common;
using Newtonsoft.Json;
using OMDb.WinUI3.Models;
using OMDb.WinUI3.Services;
Expand All @@ -14,7 +13,6 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
//using Microsoft.UI.Xaml.Media;
using Microsoft.UI;
using System.Xml.Linq;
using Microsoft.UI.Xaml;
Expand Down
18 changes: 9 additions & 9 deletions OMDb.WinUI3/OMDb.WinUI3/ViewModels/ShellViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ public ShellViewModel()
{
Current = this;
}

private bool isInTabView;
public bool IsInTabView
{
get => isInTabView;
set => SetProperty(ref isInTabView, value);
}

private string selectedPage;
public string SelectedPage
{
Expand All @@ -34,12 +42,6 @@ public string SelectedPage
}
}

private bool canGoBack;
public bool CanGoBack
{
get => canGoBack;
set => SetProperty(ref canGoBack, value);
}
public void Init(Frame frame)
{
NavigationService.Frame = frame;
Expand All @@ -48,13 +50,11 @@ public void Init(Frame frame)
public void GoBack()
{
NavigationService.GoBack();
CanGoBack = NavigationService.CanGoBack;
}

public void SetSelected(Type type)
{
SelectedPage = type.Name;
CanGoBack = NavigationService.CanGoBack;
}

public ICommand NavClickCommand => new RelayCommand<Button>((item) =>
Expand All @@ -63,7 +63,7 @@ public void SetSelected(Type type)
if (pageType != null)
{
NavigationService.Navigate(pageType, null);
CanGoBack = NavigationService.CanGoBack;
IsInTabView = false;
}
});
}
Expand Down
1 change: 0 additions & 1 deletion OMDb.WinUI3/OMDb.WinUI3/ViewModels/StorageViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Google.Protobuf.WellKnownTypes;
using Newtonsoft.Json;
using OMDb.Core.DbModels;
using OMDb.Core.Models;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using MySqlX.XDevAPI.Common;
using OMDb.Core.Services;
using OMDb.Core.Utils;
using OMDb.Core.Utils.Extensions;
Expand Down
Loading

0 comments on commit 52357af

Please sign in to comment.