Skip to content

Commit

Permalink
Revert "修改配置项的默认值"
Browse files Browse the repository at this point in the history
This reverts commit a7947a9.
  • Loading branch information
chao committed May 8, 2023
1 parent 415fe9c commit f9e9b46
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 110 deletions.
15 changes: 6 additions & 9 deletions Jvedio-WPF/Jvedio/Core/Config/Common/DownloadConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using SuperUtils.NetWork;
using System;
using System.Net;
using System.ComponentModel;

namespace Jvedio.Core.Config
{
Expand All @@ -14,7 +13,11 @@ public class DownloadConfig : AbstractConfig

private DownloadConfig() : base("DownloadConfig")
{

DownloadInfo = true;
DownloadThumbNail = true;
DownloadPoster = true;
DownloadPreviewImage = false;
DownloadActor = true;
}

private static DownloadConfig _instance = null;
Expand All @@ -25,17 +28,11 @@ public static DownloadConfig CreateInstance()

return _instance;
}
[DefaultValue(true)]

public bool DownloadInfo { get; set; }
[DefaultValue(true)]
public bool DownloadThumbNail { get; set; }
[DefaultValue(true)]
public bool DownloadPoster { get; set; }

[DefaultValue(false)]
public bool DownloadPreviewImage { get; set; }

[DefaultValue(true)]
public bool DownloadActor { get; set; }

}
Expand Down
29 changes: 8 additions & 21 deletions Jvedio-WPF/Jvedio/Core/Config/Common/FFmpegConfig.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
using Jvedio.Core.Config.Base;
using System.ComponentModel;

namespace Jvedio.Core.Config
{
public class FFmpegConfig : AbstractConfig
{

public const int DEFAULT_THREAD_NUM = 2;
public const int DEFAULT_SCREEN_SHOT_NUM = 5;
public const int DEFAULT_SCREEN_SHOT_IGNORE_START = 1;
public const int DEFAULT_SCREEN_SHOT_IGNORE_END = 1;
public const int DEFAULT_GIF_WIDTH = 300;
public const int DEFAULT_GIF_HEIGHT = 168;
public const int DEFAULT_GIF_DURATION = 3;

private FFmpegConfig() : base("FFmpegConfig")
{
ThreadNum = 2;
ScreenShotNum = 5;
ScreenShotIgnoreStart = 1;
ScreenShotIgnoreEnd = 1;
GifAutoHeight = true;
GifWidth = 300;
SkipExistScreenShot = true;
ScreenShotAfterImport = true;
}

private static FFmpegConfig _instance = null;
Expand All @@ -29,38 +27,27 @@ public static FFmpegConfig CreateInstance()

public string Path { get; set; }

[DefaultValue(DEFAULT_THREAD_NUM)]
public long ThreadNum { get; set; }

public long TimeOut { get; set; }

[DefaultValue(DEFAULT_SCREEN_SHOT_NUM)]
public long ScreenShotNum { get; set; }

[DefaultValue(DEFAULT_SCREEN_SHOT_IGNORE_START)]
public long ScreenShotIgnoreStart { get; set; }

[DefaultValue(DEFAULT_SCREEN_SHOT_IGNORE_END)]
public long ScreenShotIgnoreEnd { get; set; }

[DefaultValue(true)]
public bool SkipExistScreenShot { get; set; }

[DefaultValue(true)]
public bool ScreenShotAfterImport { get; set; }

public bool SkipExistGif { get; set; }

[DefaultValue(true)]
public bool GifAutoHeight { get; set; }

[DefaultValue(DEFAULT_GIF_WIDTH)]
public long GifWidth { get; set; }

[DefaultValue(DEFAULT_GIF_HEIGHT)]
public long GifHeight { get; set; }

[DefaultValue(DEFAULT_GIF_DURATION)]
public long GifDuration { get; set; }
}
}
43 changes: 8 additions & 35 deletions Jvedio-WPF/Jvedio/Core/Config/Common/ProxyConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,17 @@
using SuperUtils.NetWork;
using System;
using System.Net;
using System.ComponentModel;

namespace Jvedio.Core.Config
{

public enum ProxyModeEnum
{
/// <summary>
/// 无代理
/// </summary>
None,

/// <summary>
/// 系统代理
/// </summary>
System,

/// <summary>
/// 自定义代理
/// </summary>
Custom
}


public enum ProxyTypeEnum
{
HTTP,
SOCKS,
}


public class ProxyConfig : AbstractConfig
{
public const int DEFAULT_TIMEOUT = 10;

public const ProxyModeEnum DEFAULT_PROXY_MODE = ProxyModeEnum.System;
public const ProxyTypeEnum DEFAULT_PROXY_TYPE = ProxyTypeEnum.SOCKS;
private const int DEFAULT_TIMEOUT = 10;

private ProxyConfig() : base("ProxyConfig")
{
ProxyMode = 1;
ProxyType = 1;
HttpTimeout = DEFAULT_TIMEOUT;
}

Expand All @@ -57,11 +28,13 @@ public static ProxyConfig CreateInstance()
return _instance;
}

[DefaultValue((int)DEFAULT_PROXY_MODE)]
/// <summary>
/// 0-无代理 1-系统代理 2-自定义代理
/// </summary>
public long ProxyMode { get; set; }

[DefaultValue((int)DEFAULT_PROXY_TYPE)]
public long ProxyType { get; set; }
// 自定义代理配置
public long ProxyType { get; set; } // 0-HTTP 1-SOCKS

public string Server { get; set; }

Expand Down
10 changes: 2 additions & 8 deletions Jvedio-WPF/Jvedio/Core/Config/Common/RenameConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Jvedio.Core.Config.Base;
using System.ComponentModel;

namespace Jvedio.Core.Config
{
Expand All @@ -12,11 +11,10 @@ static RenameConfig()
DEFAULT_NULL_STRING = "NULL";
}

public const string DEFAULT_OUT_SPLIT = "[null]";
public const string DEFAULT_IN_SPLIT = DEFAULT_OUT_SPLIT;

private RenameConfig() : base("RenameConfig")
{
OutSplit = "[null]";
InSplit = "[null]";
FormatString = string.Empty;
}

Expand All @@ -33,12 +31,8 @@ public static RenameConfig CreateInstance()

public bool AddRenameTag { get; set; }

[DefaultValue(DEFAULT_OUT_SPLIT)]

public string OutSplit { get; set; }


[DefaultValue(DEFAULT_IN_SPLIT)]
public string InSplit { get; set; }

public string FormatString { get; set; }
Expand Down
39 changes: 14 additions & 25 deletions Jvedio-WPF/Jvedio/Core/Config/Common/ScanConfig.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
using Jvedio.Core.Config.Base;
using System.ComponentModel;

namespace Jvedio.Core.Config
{
public class ScanConfig : AbstractConfig
{
public const double DEFAULT_MIN_FILE_SIZE = 1; // 1 MB
private const double DEFAULT_MIN_FILE_SIZE = 1; // 1 MB

private ScanConfig() : base("ScanConfig")
{
CopyNFOPicture = true;
CopyNFOPreview = true;
CopyNFOActorPicture = true;
CopyNFOScreenShot = true;

CopyNFOActorPath = ".actor";
CopyNFOPreviewPath = ".preview";
CopyNFOScreenShotPath = ".screenshot";

FetchVID = true;
LoadDataAfterScan = true;
DataExistsIndexAfterScan = true;
ImageExistsIndexAfterScan = true;
}

private static ScanConfig _instance = null;
Expand Down Expand Up @@ -41,40 +53,17 @@ public double MinFileSize
public bool ScanOnStartUp { get; set; }

public bool CopyNFOOverwriteImage { get; set; }

[DefaultValue(true)]
public bool CopyNFOPicture { get; set; }

[DefaultValue(true)]
public bool CopyNFOActorPicture { get; set; }

[DefaultValue(true)]
public bool CopyNFOPreview { get; set; }

[DefaultValue(true)]
public bool CopyNFOScreenShot { get; set; }

[DefaultValue(".actor")]
public string CopyNFOActorPath { get; set; }


[DefaultValue(".screenshot")]
public string CopyNFOScreenShotPath { get; set; }

[DefaultValue(".preview")]
public string CopyNFOPreviewPath { get; set; }

[DefaultValue(true)]
public bool FetchVID { get; set; }

[DefaultValue(true)]
public bool LoadDataAfterScan { get; set; }

[DefaultValue(true)]
public bool DataExistsIndexAfterScan { get; set; }

[DefaultValue(true)]
public bool ImageExistsIndexAfterScan { get; set; }
public string NFOParseConfig { get; set; }
}
}
18 changes: 6 additions & 12 deletions Jvedio-WPF/Jvedio/Core/Config/WindowConfig/Settings.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using Jvedio.Core.Config.Base;
using System.Collections.Generic;
using System.ComponentModel;

namespace Jvedio.Core.WindowConfig
{
public class Settings : AbstractConfig
{
public const int DEFAULT_BACKUP_PERIOD_INDEX = 1;


private Settings() : base($"WindowConfig.Settings")
{
PicPathMode = 1; // 相对路径
Expand All @@ -18,10 +14,12 @@ private Settings() : base($"WindowConfig.Settings")
TeenMode = true;
AutoAddPrefix = true;
Prefix = string.Empty;
AutoBackupPeriodIndex = 0;
AutoBackup = true;
DetailShowBg = true;
CurrentLanguage = "zh-CN";


DownloadWhenTitleNull = true;
IgnoreCertVal = true;
}

public static List<int> BackUpPeriods = new List<int> { 1, 3, 7, 15, 30 };
Expand All @@ -41,7 +39,7 @@ public static Settings CreateInstance()

public string PicPathJson { get; set; }

public Dictionary<string, object> PicPaths { get; set; }
public Dictionary<string, object> PicPaths;

public string PluginEnabledJson { get; set; }

Expand All @@ -50,13 +48,10 @@ public static Settings CreateInstance()
public bool DownloadPreviewImage { get; set; }

public bool SkipExistImage { get; set; }

[DefaultValue(true)]
public bool DownloadWhenTitleNull { get; set; }

public bool OverrideInfo { get; set; }

[DefaultValue(true)]
public bool IgnoreCertVal { get; set; }

public bool AutoHandleHeader { get; set; }
Expand Down Expand Up @@ -97,15 +92,14 @@ public bool CloseToTaskBar

public bool AutoBackup { get; set; }

[DefaultValue(DEFAULT_BACKUP_PERIOD_INDEX)]
public long AutoBackupPeriodIndex { get; set; }

// 是否建立可播放索引
public bool PlayableIndexCreated { get; set; }

public bool PictureIndexCreated { get; set; }

[DefaultValue(true)]

public bool DetailShowBg { get; set; }

// 端口
Expand Down

0 comments on commit f9e9b46

Please sign in to comment.