Skip to content

Commit

Permalink
- [x] logs 目录小写
Browse files Browse the repository at this point in the history
- [x] 全局 messagebox
- [x] 插件提示需要代理
- [x] 打印刮削器
- [x] startup 搜索字体太大
- [x] 资源管理左侧排版
- [x] supercontrols 设置窗口大小不可变
- [x] 编辑-类别-边框有点小
- [x] 扫描时导出为 csv
- [x] 扫描结果路径超长时显示 ...
- [x] 主界面需要显示扫描中
- [x] 标记前景色失效
- [x] 某个电影标记删除后,侧边栏标记全选了
- [x] gif截图失败,给定关键字不在字典中、当图片模式为相对于影片的时候,提示截图存在的问题
  • Loading branch information
chao committed Mar 26, 2023
1 parent 74d6ac0 commit 961b6ec
Show file tree
Hide file tree
Showing 22 changed files with 114 additions and 108 deletions.
2 changes: 1 addition & 1 deletion Jvedio-WPF/Jvedio/Core/Config/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Jvedio
{
public static class ConfigManager
{
public const string RELEASE_DATE = "2023-03-20";
public const string RELEASE_DATE = "2023-03-26";
public static StartUp StartUp = StartUp.createInstance();
public static Core.WindowConfig.Main Main = Core.WindowConfig.Main.createInstance();
public static Filter Filter = Core.WindowConfig.Filter.createInstance();
Expand Down
5 changes: 3 additions & 2 deletions Jvedio-WPF/Jvedio/Core/Config/PathManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using SuperControls.Style.Windows;
using System;
using System.IO;
using System.Windows;

Expand Down Expand Up @@ -60,7 +61,7 @@ public static void Init()
}
catch (Exception ex2)
{
MessageBox.Show("数据目录创建失败 => " + ex2.Message);
MsgBox.Show("数据目录创建失败 => " + ex2.Message);
App.Current.Shutdown();
}
}
Expand Down
5 changes: 3 additions & 2 deletions Jvedio-WPF/Jvedio/Core/FFmpeg/ScreenShot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,12 @@ public async Task<string> AsyncGenrateGif()
if (!File.Exists(originPath))
throw new NotFoundException(originPath);

string[] cutoffArray = MediaParse.GetCutOffArray(originPath, ConfigManager.FFmpegConfig.ScreenShotNum, ConfigManager.FFmpegConfig.ScreenShotIgnoreStart, ConfigManager.FFmpegConfig.ScreenShotIgnoreEnd); // 获得需要截图的视频进度
string[] cutoffArray = MediaParse.GetCutOffArray(originPath, ConfigManager.FFmpegConfig.ScreenShotNum,
ConfigManager.FFmpegConfig.ScreenShotIgnoreStart, ConfigManager.FFmpegConfig.ScreenShotIgnoreEnd); // 获得需要截图的视频进度
if (cutoffArray.Length == 0)
throw new MediaCutOutOfRangeException();

string saveFileName = CurrentVideo.getGifPath();
string saveFileName = CurrentVideo.GetGifPath();
if (string.IsNullOrEmpty(saveFileName))
throw new NotFoundException(saveFileName);

Expand Down
4 changes: 2 additions & 2 deletions Jvedio-WPF/Jvedio/Core/Logs/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static void Error(Exception e)
content += $"{Environment.NewLine}[StackTrace] {Environment.NewLine} {GetAllFootprints(e)}";
Console.WriteLine(content);

string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log", "Error");
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs", "error");
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
string filepath = path + "/" + DateTime.Now.ToString("yyyy-MM-dd") + ".log";
Expand All @@ -112,7 +112,7 @@ private static void Log(LogType logType, string content)
{
string output = $"{DateHelper.Now()} => [{logType}] {content} {Environment.NewLine}";
Console.WriteLine(output);
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log");
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
Expand Down
3 changes: 3 additions & 0 deletions Jvedio-WPF/Jvedio/Core/Net/DownLoadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ public override void DoWork()
FinalizeWithCancel();
return;
}
if (dict != null && dict.ContainsKey("PluginID") && dict["PluginID"] is string PluginID)
logger?.Info($"使用刮削器:{PluginID}");

bool success = true;
Progress = 10f;
StatusText = "2. 校验信息";
Expand Down
1 change: 1 addition & 0 deletions Jvedio-WPF/Jvedio/Core/Net/VideoDownLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public async Task<Dictionary<string, object>> GetInfo(Action<RequestHeader> head
Header.Headers = dict;
}
headerCallBack?.Invoke(Header);
d.Add("PluginID", server.PluginID);
return d;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Jvedio-WPF/Jvedio/Entity/Data/Video.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public string GetScreenShot()
return imagePath;
}

public string getGifPath()
public string GetGifPath()
{
string imagePath = GetImagePath(ImageType.Gif, ".gif");

Expand Down
Binary file modified Jvedio-WPF/Jvedio/Reference/SuperControls.Style.dll
Binary file not shown.
Binary file modified Jvedio-WPF/Jvedio/Reference/SuperUtils.dll
Binary file not shown.
3 changes: 2 additions & 1 deletion Jvedio-WPF/Jvedio/Upgrade/Jvedio4ToJvedio5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Jvedio.Mapper;
using Jvedio.Windows;
using Newtonsoft.Json;
using SuperControls.Style.Windows;
using SuperUtils.Framework.ORM.Attributes;
using SuperUtils.Framework.ORM.Utils;
using SuperUtils.Framework.ORM.Wrapper;
Expand Down Expand Up @@ -142,7 +143,7 @@ public static async Task<bool> MoveDatabases(string[] files)
if (!File.Exists(file)) continue;
result = await MoveOldData(file, (err) =>
{
MessageBox.Show(err);
MsgBox.Show(err);
});
setProgress((100 * (float)i + 1) / (float)files.Length, $"迁移数据:{Path.GetFileName(file)}");
}
Expand Down
12 changes: 12 additions & 0 deletions Jvedio-WPF/Jvedio/ViewModels/VieModel_Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1960,8 +1960,20 @@ public void toLimit<T>(IWrapper<T> wrapper)
{ "RecentWatch", " " },
};


static bool g_showRelativeScreen = false;


public void GenerateSelect(object o = null)
{
if (!g_showRelativeScreen &&
(PathType)ConfigManager.Settings.PicPathMode == PathType.RelativeToData)
{
g_showRelativeScreen = true;
MessageCard.Info("当前图片模式为相对于影片,如果影片都位于同一目录,图片将会重复/覆盖");
}


extraWrapper = new SelectWrapper<Video>();

// 侧边栏参数
Expand Down
16 changes: 13 additions & 3 deletions Jvedio-WPF/Jvedio/WindowStartUp.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,24 @@
Height="30"
Margin="0,20"
HorizontalAlignment="Center"
DotInterval="4"
Foreground="{DynamicResource Window.Foreground}" />
<TextBlock
Margin="10"
HorizontalAlignment="Center"
Style="{StaticResource BaseTextBlock}"
Text="{DynamicResource Scanning}" />

<TextBlock
Margin="10,0"
Margin="50,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
FontSize="15"
Style="{StaticResource BaseTextBlock}"
Text="{Binding LoadingText}"
TextAlignment="Center"
TextTrimming="WordEllipsis"
TextWrapping="NoWrap"
ToolTip="{Binding LoadingText}" />
<Button
Margin="20"
Expand Down Expand Up @@ -421,10 +430,11 @@
<super:SearchBox
Background="Transparent"
Clear="SearchText_Changed"
FontSize="15"
FontSize="12"
PlaceHolder="{DynamicResource Search}"
Search="SearchText_Changed"
SearchOnTextChanged="True" />
SearchOnTextChanged="True"
ShowSearchButton="True" />

<StackPanel
Grid.Column="1"
Expand Down
12 changes: 6 additions & 6 deletions Jvedio-WPF/Jvedio/WindowStartUp.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private async void Window_Loaded(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{
MessageBox.Show($"{LangManager.GetValueByKey("LibraryInitFailed")} {ex.Message}");
MsgBox.Show($"{LangManager.GetValueByKey("LibraryInitFailed")} {ex.Message}");
App.Current.Shutdown();
}

Expand Down Expand Up @@ -386,7 +386,7 @@ public void EnsureSettings()
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
MsgBox.Show(ex.Message);
Logger.Error(ex);
}

Expand Down Expand Up @@ -428,7 +428,7 @@ public void EnsureFileExists()
{
if (!File.Exists(@"x64\SQLite.Interop.dll") || !File.Exists(@"x86\SQLite.Interop.dll"))
{
MessageBox.Show($"{SuperControls.Style.LangManager.GetValueByKey("Missing")} SQLite.Interop.dll", "Jvedio");
MsgBox.Show($"{SuperControls.Style.LangManager.GetValueByKey("Missing")} SQLite.Interop.dll");
this.Close();
}
}
Expand Down Expand Up @@ -645,7 +645,7 @@ public async void LoadDataBase()
if (!string.IsNullOrEmpty(database.ScanPath))
{
tabControl.SelectedIndex = 0;
await Task.Delay(5000);
//await Task.Delay(1000);
//this.TitleHeight = 0;
List<string> toScan = JsonUtils.TryDeserializeObject<List<string>>(database.ScanPath);
try
Expand All @@ -668,7 +668,7 @@ public async void LoadDataBase()
catch (Exception ex)
{
Logger.Error(ex);
MessageBox.Show(ex.Message);
MsgBox.Show(ex.Message);
}

//this.TitleHeight = DEFAULT_TITLE_HEIGHT;
Expand Down Expand Up @@ -861,7 +861,7 @@ private async void RestoreDatabase(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{
MessageBox.Show($"{LangManager.GetValueByKey("LibraryInitFailed")} {ex.Message}");
MsgBox.Show($"{LangManager.GetValueByKey("LibraryInitFailed")} {ex.Message}");
App.Current.Shutdown();
}

Expand Down
26 changes: 4 additions & 22 deletions Jvedio-WPF/Jvedio/Windows/Dialog/Window_TagStamp.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<super:BaseWindow
<super:BaseDialog
x:Class="Jvedio.Window_TagStamp"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand All @@ -7,10 +7,9 @@
xmlns:super="https://github.com/SuperStudio/SuperControls"
Title="{DynamicResource TagStamp}"
Width="400"
Height="260"
Height="300"
MinHeight="0"
Background="{DynamicResource Window.InnerDialog.Background}"
CanMinimized="False"
CanResize="False"
ContentRendered="BaseWindow_ContentRendered"
Foreground="{DynamicResource Window.Foreground}"
Icon="pack://application:,,,/Resources/Jvedio.ico"
Expand Down Expand Up @@ -135,22 +134,5 @@
MouseLeftButtonDown="border2_MouseLeftButtonDown" />

</Grid>

<StackPanel
Grid.Row="3"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Orientation="Horizontal">
<Button
MinWidth="70"
Click="Confirm"
Content="{DynamicResource Confirm}"
Style="{StaticResource ButtonPrimary}" />
<Button
MinWidth="70"
Click="Cancel"
Content="{DynamicResource Cancel}"
Style="{StaticResource ButtonDanger}" />
</StackPanel>
</Grid>
</super:BaseWindow>
</super:BaseDialog>
12 changes: 1 addition & 11 deletions Jvedio-WPF/Jvedio/Windows/Dialog/Window_TagStamp.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Jvedio
/// <summary>
/// Window_TagStamp.xaml 的交互逻辑
/// </summary>
public partial class Window_TagStamp : BaseWindow
public partial class Window_TagStamp : BaseDialog
{
public SolidColorBrush _BackgroundBrush = Brushes.Orange;

Expand Down Expand Up @@ -47,16 +47,6 @@ public Window_TagStamp(string name, SolidColorBrush background, SolidColorBrush
ForegroundBrush = foreground;
}

private void Confirm(object sender, RoutedEventArgs e)
{
this.DialogResult = true;
}

private void Cancel(object sender, RoutedEventArgs e)
{
this.DialogResult = false;
}

private async void border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
await Task.Delay(100);
Expand Down
4 changes: 2 additions & 2 deletions Jvedio-WPF/Jvedio/Windows/Window_Details.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void RemoveNewAddTag()
{
string sql = $"delete from metadata_to_tagstamp where TagID='{TagStamp.TAGID_NEW_ADD}' and DataID='{DataID}'";
tagStampMapper.ExecuteNonQuery(sql);
windowMain?.vieModel.InitCurrentTagStamps();
windowMain?.InitTagStamp();
windowMain?.RefreshData(DataID);
}
}
Expand Down Expand Up @@ -1256,7 +1256,7 @@ private void OpenPath(object sender, RoutedEventArgs e)
}
else if (header.Equals("GIF"))
{
FileHelper.TryOpenSelectPath(video.getGifPath());
FileHelper.TryOpenSelectPath(video.GetGifPath());
}
}

Expand Down
6 changes: 3 additions & 3 deletions Jvedio-WPF/Jvedio/Windows/Window_EditActor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void SetActorImage(object sender, RoutedEventArgs e)
{
if (CurrentActorInfo == null || string.IsNullOrEmpty(CurrentActorInfo.ActorName))
{
MessageBox.Show(LangManager.GetValueByKey("ActorCanNotBeNull"));
MsgBox.Show(LangManager.GetValueByKey("ActorCanNotBeNull"));
return;
}
string imageFileName = string.Empty;
Expand Down Expand Up @@ -151,7 +151,7 @@ private void ActorImage_Drop(object sender, DragEventArgs e)
PathType pathType = (PathType)ConfigManager.Settings.PicPathMode;
if (pathType == PathType.RelativeToData)
{
MessageBox.Show(LangManager.GetValueByKey("ActorImageNotSupported"));
MsgBox.Show(LangManager.GetValueByKey("ActorImageNotSupported"));
return;
}

Expand All @@ -160,7 +160,7 @@ private void ActorImage_Drop(object sender, DragEventArgs e)

if (CurrentActorInfo == null || string.IsNullOrEmpty(CurrentActorInfo.ActorName))
{
MessageBox.Show(LangManager.GetValueByKey("ActorCanNotBeNull"));
MsgBox.Show(LangManager.GetValueByKey("ActorCanNotBeNull"));
return;
}

Expand Down
Loading

0 comments on commit 961b6ec

Please sign in to comment.