Skip to content

Commit

Permalink
Major Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Nov 26, 2024
1 parent 4674f2a commit 54738de
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 20 deletions.
9 changes: 7 additions & 2 deletions src/Live/Sucrose.Live.CefSharp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using SRER = Sucrose.Resources.Extension.Resources;
using SRHR = Sucrose.Resources.Helper.Resources;
using SSDEDT = Sucrose.Shared.Dependency.Enum.DialogType;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSDMMG = Sucrose.Shared.Dependency.Manage.Manager.General;
using SSECSHP = Sucrose.Shared.Engine.CefSharp.Helper.Properties;
Expand Down Expand Up @@ -417,12 +418,16 @@ protected void Configure()
{
SSECSHP.Start();
}
else
{
SSEMI.PropertiesType = SSDEPT.Other;
}

if (File.Exists(SSEMI.PropertiesPath))
{
SSEMI.PropertiesCache = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.Properties);
SSEMI.PropertiesFile = Path.Combine(SSEMI.PropertiesCache, $"{SSEMI.LibrarySelected}.json");
SSEMI.WatcherFile = Path.Combine(SSEMI.PropertiesCache, $"*.{SSEMI.LibrarySelected}.json");
SSEMI.PropertiesFile = Path.Combine(SSEMI.PropertiesCache, $"{SSEMI.LibrarySelected}{SSEMI.PropertiesType}");
SSEMI.WatcherFile = Path.Combine(SSEMI.PropertiesCache, $"*.{SSEMI.LibrarySelected}{SSEMI.PropertiesType}");

if (!Directory.Exists(SSEMI.PropertiesCache))
{
Expand Down
9 changes: 7 additions & 2 deletions src/Live/Sucrose.Live.WebView/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using SRER = Sucrose.Resources.Extension.Resources;
using SRHR = Sucrose.Resources.Helper.Resources;
using SSDEDT = Sucrose.Shared.Dependency.Enum.DialogType;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSDMMG = Sucrose.Shared.Dependency.Manage.Manager.General;
using SSEHC = Sucrose.Shared.Engine.Helper.Cycyling;
Expand Down Expand Up @@ -349,12 +350,16 @@ protected void Configure()
{
SSEWVHP.Start();
}
else
{
SSEMI.PropertiesType = SSDEPT.Other;
}

if (File.Exists(SSEMI.PropertiesPath))
{
SSEMI.PropertiesCache = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.Properties);
SSEMI.PropertiesFile = Path.Combine(SSEMI.PropertiesCache, $"{SSEMI.LibrarySelected}.json");
SSEMI.WatcherFile = Path.Combine(SSEMI.PropertiesCache, $"*.{SSEMI.LibrarySelected}.json");
SSEMI.PropertiesFile = Path.Combine(SSEMI.PropertiesCache, $"{SSEMI.LibrarySelected}{SSEMI.PropertiesType}");
SSEMI.WatcherFile = Path.Combine(SSEMI.PropertiesCache, $"*.{SSEMI.LibrarySelected}{SSEMI.PropertiesType}");

if (!Directory.Exists(SSEMI.PropertiesCache))
{
Expand Down
8 changes: 0 additions & 8 deletions src/Localizer/Sucrose.Localizer/Helper/Against.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ public static void ReindexCsv(string csvDirectory, string reindexerLang)

csvFiles.Remove(reindexerSource);

//reindexerLines'deki tüm satırları , ile parçalara böl ve File,Key,Value olarak ata
//daha sonra csvFilesi döngüye alıp satırları , ile parçalara böl ve File,Key,Value olarak ata
//csvFile'daki satırların File ve Key'leri reindexerLines'daki File ve Key'in bulunduğu satırla eşleşmezse eğer reindexerLines'deki Key ve Value ile eşleşen satıra koy
//yine eşit olmayan satırları da bilgi olarak ekrana yazdır (Console.WriteLine)
//dosyayı kaydet

foreach (string csvFile in csvFiles)
{
Console.WriteLine($"-- Reindexing {Path.GetFileName(csvFile)} with {Path.GetFileName(reindexerSource)} --");
Expand All @@ -42,8 +36,6 @@ public static void ReindexCsv(string csvDirectory, string reindexerLang)
string hash = fields[0];
bool found = false;

//Console.WriteLine($"Hash: {hash}");

foreach (KeyValuePair<int, string> reindexerPair in reindexerLines)
{
string[] reindexerFields = reindexerPair.Value.Split(',');
Expand Down
8 changes: 5 additions & 3 deletions src/Portal/Sucrose.Portal/Views/Controls/LibraryCard.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,13 @@ private async void MenuDelete_Click(object sender, RoutedEventArgs e)
await Task.Run(() =>
{
string PropertiesCache = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.Properties);
string PropertiesFile = Path.Combine(PropertiesCache, $"{Path.GetFileName(Theme)}.json");

if (File.Exists(PropertiesFile))
foreach (string Record in Directory.GetFiles(PropertiesCache, ""))
{
File.Delete(PropertiesFile);
if (File.Exists(Record) && Record.Contains(Path.GetFileName(Theme)))
{
File.Delete(Record);
}
}
});

Expand Down
23 changes: 20 additions & 3 deletions src/Project/Sucrose.Property/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using SPVMW = Sucrose.Property.View.MainWindow;
using SRHR = Sucrose.Resources.Helper.Resources;
using SSDEET = Sucrose.Shared.Dependency.Enum.EngineType;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSDMME = Sucrose.Shared.Dependency.Manage.Manager.Engine;
using SSSHI = Sucrose.Shared.Space.Helper.Instance;
Expand Down Expand Up @@ -136,7 +137,7 @@ protected void Configure(string[] Args)
{
if (SPMI.Info.Type == SSDEWT.Web && File.Exists(SPMI.PropertiesPath))
{
//
SPMI.PropertiesType = SSDEPT.Other;
}
else if (SPMI.Info.Type is SSDEWT.Gif or SSDEWT.Video or SSDEWT.YouTube)
{
Expand All @@ -146,35 +147,47 @@ protected void Configure(string[] Args)
{
if (SSDMME.Gif == SSDEET.MpvPlayerLive && (File.Exists(SPMI.PropertiesPath) || File.Exists(Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.MpvPlayer, SMMRC.SucroseProperties))))
{
SPMI.PropertiesType = SSDEPT.MpvPlayer;

if (!File.Exists(SPMI.PropertiesPath))
{
SPMI.PropertiesPath = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.MpvPlayer, SMMRC.SucroseProperties);
}
}
else if (SSDMME.Gif == SSDEET.CefSharpLive && File.Exists(Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.CefSharp, SMMRC.SucroseProperties)))
{
SPMI.PropertiesType = SSDEPT.CefSharp;

SPMI.PropertiesPath = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.CefSharp, SMMRC.SucroseProperties);
}
else if (SSDMME.Gif == SSDEET.WebViewLive && File.Exists(Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.WebView2, SMMRC.SucroseProperties)))
{
SPMI.PropertiesType = SSDEPT.WebView;

SPMI.PropertiesPath = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.WebView2, SMMRC.SucroseProperties);
}
}
else if (SPMI.Info.Type == SSDEWT.Video)
{
if (SSDMME.Video == SSDEET.MpvPlayerLive && (File.Exists(SPMI.PropertiesPath) || File.Exists(Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.MpvPlayer, SMMRC.SucroseProperties))))
{
SPMI.PropertiesType = SSDEPT.MpvPlayer;

if (!File.Exists(SPMI.PropertiesPath))
{
SPMI.PropertiesPath = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.MpvPlayer, SMMRC.SucroseProperties);
}
}
else if (SSDMME.Video == SSDEET.CefSharpLive && File.Exists(Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.CefSharp, SMMRC.SucroseProperties)))
{
SPMI.PropertiesType = SSDEPT.CefSharp;

SPMI.PropertiesPath = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.CefSharp, SMMRC.SucroseProperties);
}
else if (SSDMME.Video == SSDEET.WebViewLive && File.Exists(Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.WebView2, SMMRC.SucroseProperties)))
{
SPMI.PropertiesType = SSDEPT.WebView;

SPMI.PropertiesPath = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.WebView2, SMMRC.SucroseProperties);
}
}
Expand All @@ -183,10 +196,14 @@ protected void Configure(string[] Args)
{
if (SSDMME.YouTube == SSDEET.CefSharpLive && File.Exists(Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.CefSharp, SMMRC.SucroseProperties)))
{
SPMI.PropertiesType = SSDEPT.CefSharp;

SPMI.PropertiesPath = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.CefSharp, SMMRC.SucroseProperties);
}
else if (SSDMME.YouTube == SSDEET.WebViewLive && File.Exists(Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.WebView2, SMMRC.SucroseProperties)))
{
SPMI.PropertiesType = SSDEPT.WebView;

SPMI.PropertiesPath = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.WebView2, SMMRC.SucroseProperties);
}
}
Expand All @@ -195,8 +212,8 @@ protected void Configure(string[] Args)
if (File.Exists(SPMI.PropertiesPath))
{
SPMI.PropertiesCache = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.Properties);
SPMI.PropertiesFile = Path.Combine(SPMI.PropertiesCache, $"{SPMI.LibrarySelected}.json");
SPMI.WatcherFile = Path.Combine(SPMI.PropertiesCache, $"*.{SPMI.LibrarySelected}.json");
SPMI.PropertiesFile = Path.Combine(SPMI.PropertiesCache, $"{SPMI.LibrarySelected}{SPMI.PropertiesType}");
SPMI.WatcherFile = Path.Combine(SPMI.PropertiesCache, $"*.{SPMI.LibrarySelected}{SPMI.PropertiesType}");

if (!Directory.Exists(SPMI.PropertiesCache))
{
Expand Down
3 changes: 3 additions & 0 deletions src/Project/Sucrose.Property/Manage/Internal.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Wpf.Ui.Controls;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSTHI = Sucrose.Shared.Theme.Helper.Info;
using SSTHP = Sucrose.Shared.Theme.Helper.Properties;

Expand All @@ -18,6 +19,8 @@ internal static class Internal

public static string PropertiesPath;

public static SSDEPT PropertiesType;

public static string LibraryLocation;

public static string LibrarySelected;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.IO;
using SMMRC = Sucrose.Memory.Manage.Readonly.Content;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSECCE = Skylark.Standard.Extension.Cryptology.CryptologyExtension;
using SSECSMI = Sucrose.Shared.Engine.CefSharp.Manage.Internal;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
Expand All @@ -19,6 +20,8 @@ public static void Start()
SSEMI.PropertiesPath = Path.Combine(SSECSMI.CefPath, SMMRC.SucroseProperties);

SSSHF.Write(SSEMI.PropertiesPath, SSECCE.BaseToText(SSEMI.CefProperties));

SSEMI.PropertiesType = SSDEPT.CefSharp;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using SMMRF = Sucrose.Memory.Manage.Readonly.Folder;
using SMMRG = Sucrose.Memory.Manage.Readonly.General;
using SMMRP = Sucrose.Memory.Manage.Readonly.Path;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSECCE = Skylark.Standard.Extension.Cryptology.CryptologyExtension;
using SSEHP = Sucrose.Shared.Engine.Helper.Properties;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
Expand Down Expand Up @@ -33,8 +34,8 @@ public static void Start()
}

SSEMI.PropertiesCache = Path.Combine(SMMRP.ApplicationData, SMMRG.AppName, SMMRF.Cache, SMMRF.Properties);
SSEMI.PropertiesFile = Path.Combine(SSEMI.PropertiesCache, $"{SSEMI.LibrarySelected}.json");
SSEMI.WatcherFile = Path.Combine(SSEMI.PropertiesCache, $"*.{SSEMI.LibrarySelected}.json");
SSEMI.PropertiesFile = Path.Combine(SSEMI.PropertiesCache, $"{SSEMI.LibrarySelected}{SSDEPT.MpvPlayer}");
SSEMI.WatcherFile = Path.Combine(SSEMI.PropertiesCache, $"*.{SSEMI.LibrarySelected}{SSDEPT.MpvPlayer}");

if (!Directory.Exists(SSEMI.PropertiesCache))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.IO;
using SMMRC = Sucrose.Memory.Manage.Readonly.Content;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSECCE = Skylark.Standard.Extension.Cryptology.CryptologyExtension;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
using SSEWVMI = Sucrose.Shared.Engine.WebView.Manage.Internal;
Expand All @@ -19,6 +20,8 @@ public static void Start()
SSEMI.PropertiesPath = Path.Combine(SSEWVMI.WebPath, SMMRC.SucroseProperties);

SSSHF.Write(SSEMI.PropertiesPath, SSECCE.BaseToText(SSEMI.WebProperties));

SSEMI.PropertiesType = SSDEPT.WebView;
}
}
}
3 changes: 3 additions & 0 deletions src/Shared/Engine/Sucrose.Shared.Engine/Manage/Internal.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Net;
using System.Windows.Threading;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSDSHS = Sucrose.Shared.Dependency.Struct.HandleStruct;
using SSESB = Sucrose.Shared.Engine.Setting.Browser;
using SSTHC = Sucrose.Shared.Theme.Helper.Compatible;
Expand All @@ -14,6 +15,8 @@ internal static class Internal

public static bool IsDesktop = true;

public static SSDEPT PropertiesType;

public static bool Interaction = true;

public static SSTHC Compatible = new();
Expand Down
10 changes: 10 additions & 0 deletions src/Shared/Sucrose.Shared.Dependency/Enum/PropertiesType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Sucrose.Shared.Dependency.Enum
{
internal enum PropertiesType
{
Other,
WebView,
CefSharp,
MpvPlayer
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Enum\StoreType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Enum\StretchType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Enum\ArchitectureType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Enum\PropertiesType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Enum\WallpaperType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Manage\Internal.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Manage\Manager\General.cs" />
Expand Down

0 comments on commit 54738de

Please sign in to comment.