Skip to content

Commit

Permalink
修复一些错误
Browse files Browse the repository at this point in the history
  • Loading branch information
chao committed Oct 7, 2022
1 parent 9fbe52e commit 550252d
Show file tree
Hide file tree
Showing 14 changed files with 293 additions and 284 deletions.
Binary file modified Jvedio-WPF/Jvedio.Test/测试用例.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion Jvedio-WPF/Jvedio/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</Jvedio.Jvedio>
<Jvedio.Properties.Settings>
<setting name="ShowImageMode" serializeAs="String">
<value>0</value>
<value>1</value>
</setting>
<setting name="DisplayNumber" serializeAs="String">
<value>50</value>
Expand Down
4 changes: 2 additions & 2 deletions Jvedio-WPF/Jvedio/Core/Config/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public static void EnsurePicPaths()
dict.Add(PathType.RelativeToApp.ToString(), "./Pic");

Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("BigImagePath", "./.fanart");
d.Add("SmallImagePath", "./.poster");
d.Add("BigImagePath", "./fanart");
d.Add("SmallImagePath", "./poster");
d.Add("PreviewImagePath", "./.preview");
d.Add("ScreenShotPath", "./.screenshot");
d.Add("ActorImagePath", "./.actor");
Expand Down
2 changes: 1 addition & 1 deletion Jvedio-WPF/Jvedio/Core/Logs/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static void Error(Exception e)
string content;
content = $"{Environment.NewLine}[{DateTime.Now.ToString()}]";
content += $"{Environment.NewLine}[Message] {e.Message}";
content += $"{Environment.NewLine}[StackTrace] {GetAllFootprints(e)}";
content += $"{Environment.NewLine}[StackTrace] {Environment.NewLine} {GetAllFootprints(e)}";
Console.WriteLine(content);

string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log", "Error");
Expand Down
7 changes: 4 additions & 3 deletions Jvedio-WPF/Jvedio/Core/Scan/ScanTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,15 @@ private void CopyNfoImage(Dictionary<string, string> dict, List<Video> import, I
if (dict.ContainsKey("BigImagePath") && !string.IsNullOrEmpty(dict["BigImagePath"]))
{
string path = dict["BigImagePath"];
string dirname = Path.GetFileNameWithoutExtension(path).ToLower();
string dirname = path.ToLower();
CopyImage(import, dirname, imageType);
}
break;
case ImageType.Small:
if (dict.ContainsKey("SmallImagePath") && !string.IsNullOrEmpty(dict["SmallImagePath"]))
{
string path = dict["SmallImagePath"];
string dirname = Path.GetFileNameWithoutExtension(path).ToLower();
string dirname = path.ToLower();
CopyImage(import, dirname, imageType);
}
break;
Expand Down Expand Up @@ -385,7 +385,8 @@ private void CopyImage(List<Video> import, string dirName, ImageType imageType)
List<string> list = FileHelper.TryGetAllFiles(dir, "*.*").ToList();
if (list?.Count <= 0) continue;
list = list.Where(arg => ScanTask.PICTURE_EXTENSIONS_LIST.Contains(System.IO.Path.GetExtension(arg).ToLower())).ToList();
string originPath = list.Where(arg => Path.GetFileNameWithoutExtension(arg).ToLower().IndexOf(dirName) >= 0).FirstOrDefault();
string filename = Path.GetFileName(dirName);
string originPath = list.Where(arg => Path.GetFileNameWithoutExtension(arg).ToLower().IndexOf(filename) >= 0).FirstOrDefault();
if (File.Exists(originPath))
{
string targetImagePath = GetImagePathByType(item, imageType);
Expand Down
9 changes: 7 additions & 2 deletions Jvedio-WPF/Jvedio/Jvedio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,13 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PreBuildEvent>mkdir "$(ProjectDir)bin\Debug"

XCOPY "$(ProjectDir)Reference\JvedioLib.dll" "$(ProjectDir)bin\Debug" /E /Y /i

mkdir "$(ProjectDir)bin\Release"

XCOPY "$(ProjectDir)Reference\JvedioLib.dll" "$(ProjectDir)bin\Release" /E /Y /i</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>XCOPY "$(ProjectDir)bin\Debug" "$(SolutionDir)Release\public\File" /E /Y /i
Expand Down
2 changes: 1 addition & 1 deletion Jvedio-WPF/Jvedio/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Jvedio-WPF/Jvedio/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Profiles />
<Settings>
<Setting Name="ShowImageMode" Type="System.String" Scope="User">
<Value Profile="(Default)">0</Value>
<Value Profile="(Default)">1</Value>
</Setting>
<Setting Name="DisplayNumber" Type="System.Int32" Scope="User">
<Value Profile="(Default)">50</Value>
Expand Down
Binary file modified Jvedio-WPF/Jvedio/Reference/JvedioLib.dll
Binary file not shown.
8 changes: 0 additions & 8 deletions Jvedio-WPF/Jvedio/ViewModels/VieModel_Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,6 @@ public VieModel_Main()
refreshVideoRenderToken();
refreshActorRenderToken();

// 注册
// GenreList.CollectionChanged += (sender, eventArgs) =>
// {
// if (eventArgs..Cast<string>().Any(a => a.Equals("0005"))) resetEvent.Set();

// };
// resetEvent.WaitOne();

// 初始化皮肤
InitThemes();
}
Expand Down
12 changes: 8 additions & 4 deletions Jvedio-WPF/Jvedio/Windows/Window_EditActor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@
VerticalAlignment="Top"
Drop="ActorImage_Drop"
Style="{StaticResource DropBorderStyle}">
<Image
Width="125"
Height="auto"
Source="{Binding CurrentActorInfo.SmallImage}">
<Image Width="125" Height="auto">
<Image.Source>
<Binding Path="CurrentActorInfo.SmallImage">
<Binding.TargetNullValue>
<ImageSource>/Resources/Picture/NoPrinting_A.png</ImageSource>
</Binding.TargetNullValue>
</Binding>
</Image.Source>
<Image.ContextMenu>
<ContextMenu>
<MenuItem Click="SetActorImage" Header="{DynamicResource SetActorImage}" />
Expand Down
7 changes: 6 additions & 1 deletion Jvedio-WPF/Jvedio/Windows/Window_EditActor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ private void SaveActor(object sender, RoutedEventArgs e)

private void SetActorImage(object sender, RoutedEventArgs e)
{
if (CurrentActorInfo == null || string.IsNullOrEmpty(CurrentActorInfo.ActorName))
{
MessageBox.Show(LangManager.GetValueByKey("ActorCanNotBeNull"));
return;
}
string imageFileName = string.Empty;
System.Windows.Forms.OpenFileDialog openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
openFileDialog1.Title = SuperControls.Style.LangManager.GetValueByKey("ChooseFile");
Expand Down Expand Up @@ -171,7 +176,7 @@ private void ActorImage_Drop(object sender, DragEventArgs e)
if (FileHelper.IsFile(originPath))
{
// 设置演员头像
string targetFileName = System.IO.Path.Combine(saveDir, $"{name}{System.IO.Path.GetExtension(originPath).ToLower()}");
string targetFileName = CurrentActorInfo.GetImagePath(searchExt: false);
bool copy = true;
if (File.Exists(targetFileName) && new Msgbox(this, LangManager.GetValueByKey("ExistsToOverrite")).ShowDialog() != true)
{
Expand Down
1 change: 1 addition & 0 deletions Jvedio-WPF/Jvedio/Windows/Window_Main.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3077,6 +3077,7 @@ private void DatabaseComboBox_SelectionChanged(object sender, SelectionChangedEv
vieModel.Statistic();
vieModel.Reset();
vieModel.InitCurrentTagStamps();
vieModel.SetClassify(true);

// vieModel.InitLettersNavigation();
// vieModel.GetFilterInfo();
Expand Down
Loading

0 comments on commit 550252d

Please sign in to comment.