Skip to content

Commit

Permalink
Major Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Nov 9, 2024
1 parent 476784b commit a95e6d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
2 changes: 2 additions & 0 deletions src/Library/Sucrose.Memory/Manage/Readonly/Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public static class Content

public static readonly string MpvPlayerConfig = "MpvPlayer.config";

public static readonly string uMpvPlayerConfig = "uMpvPlayer.config";

public static readonly string SucroseCompatible = "SucroseCompatible.json";

public static readonly string SucroseProperties = "SucroseProperties.json";
Expand Down
30 changes: 6 additions & 24 deletions src/Shared/Engine/Sucrose.Shared.Engine.MpvPlayer/Helper/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ public static void Start()
Directory.CreateDirectory(SSEMPMI.MpvPath);
}

SSEMPMI.MpvConfig = Path.Combine(SSEMPMI.MpvPath, SMMRC.MpvPlayerConfig);
SSEMPMI.MpvConfig = Path.Combine(SSEMPMI.MpvPath, SMMRC.uMpvPlayerConfig);

string Content = string.Join(Environment.NewLine, SSEMI.MpvConfig);

if (File.Exists(SSEMPMI.MpvConfig))
if (!File.Exists(SSEMPMI.MpvConfig))
{
Content = SSSHF.Read(SSEMPMI.MpvConfig);
}
SSEMPMI.MpvConfig = Path.Combine(SSEMPMI.MpvPath, SMMRC.MpvPlayerConfig);

string Content = string.Join(Environment.NewLine, SSEMI.MpvConfig);

if (SSSHR.IsMatch(Content, @"^hwdec=", RegexOptions.Multiline))
{
if (SMME.HardwareAcceleration)
{
Content = SSSHR.Replace(Content, @"^hwdec=.*$", "hwdec=auto-safe", RegexOptions.Multiline);
Expand All @@ -37,24 +34,9 @@ public static void Start()
{
Content = SSSHR.Replace(Content, @"^hwdec=.*$", "hwdec=no", RegexOptions.Multiline);
}
}
else
{
Content += Environment.NewLine + Environment.NewLine + "# Auto Generated by Sucrose #";

if (SMME.HardwareAcceleration)
{
Content += Environment.NewLine + "hwdec=auto-safe";
}
else
{
Content += Environment.NewLine + "hwdec=no";
}

Content += Environment.NewLine + "# Auto Generated by Sucrose #";
SSSHF.Write(SSEMPMI.MpvConfig, Content);
}

SSSHF.Write(SSEMPMI.MpvConfig, Content);
}
}
}
2 changes: 1 addition & 1 deletion src/Shared/Engine/Sucrose.Shared.Engine/Manage/Internal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ internal static class Internal

public static readonly DispatcherTimer GeneralTimer = new();

public static readonly string MpvProperties = "ew0KICAiUHJvcGVydHlMaXN0ZW5lciI6ICJTdWNyb3NlUHJvcGVydHlMaXN0ZW5lcignezB9JywgezF9KTsiLA0KICAiUHJvcGVydHlMaXN0Ijogew0KICAgICJvbmx5TXB2Ijogew0KICAgICAgInR5cGUiOiAibGFiZWwiLA0KICAgICAgInZhbHVlIjogIlByb3BlcnR5LkxvY2FsaXphdGlvbi5NcHZQbGF5ZXIiDQogICAgfSwNCiAgICAidmlkZW8tem9vbSI6IHsNCiAgICAgICJtYXgiOiA1LA0KICAgICAgIm1pbiI6IC01LA0KICAgICAgInN0ZXAiOiAwLjUsDQogICAgICAidGV4dCI6ICJQcm9wZXJ0eS5Mb2NhbGl6YXRpb24uWm9vbSIsDQogICAgICAidHlwZSI6ICJzbGlkZXIiLA0KICAgICAgInZhbHVlIjogMA0KICAgIH0sDQogICAgInNhdHVyYXRpb24iOiB7DQogICAgICAibWF4IjogMTAwLA0KICAgICAgIm1pbiI6IC0xMDAsDQogICAgICAic3RlcCI6IDEsDQogICAgICAidGV4dCI6ICJQcm9wZXJ0eS5Mb2NhbGl6YXRpb24uU2F0dXJhdGlvbiIsDQogICAgICAidHlwZSI6ICJzbGlkZXIiLA0KICAgICAgInZhbHVlIjogMA0KICAgIH0sDQogICAgImh1ZSI6IHsNCiAgICAgICJtYXgiOiAxMDAsDQogICAgICAibWluIjogLTEwMCwNCiAgICAgICJzdGVwIjogMSwNCiAgICAgICJ0ZXh0IjogIlByb3BlcnR5LkxvY2FsaXphdGlvbi5IdWUiLA0KICAgICAgInR5cGUiOiAic2xpZGVyIiwNCiAgICAgICJ2YWx1ZSI6IDANCiAgICB9LA0KICAgICJzaGFycGVuIjogew0KICAgICAgIm1heCI6IDEwMCwNCiAgICAgICJtaW4iOiAwLA0KICAgICAgInN0ZXAiOiAxLA0KICAgICAgInRleHQiOiAiS2Vza2lubGlrIiwNCiAgICAgICJ0eXBlIjogInNsaWRlciIsDQogICAgICAidmFsdWUiOiAwDQogICAgfSwNCiAgICAiYnJpZ2h0bmVzcyI6IHsNCiAgICAgICJtYXgiOiAxMDAsDQogICAgICAibWluIjogLTEwMCwNCiAgICAgICJzdGVwIjogMSwNCiAgICAgICJ0ZXh0IjogIlByb3BlcnR5LkxvY2FsaXphdGlvbi5CcmlnaHRuZXNzIiwNCiAgICAgICJ0eXBlIjogInNsaWRlciIsDQogICAgICAidmFsdWUiOiAwDQogICAgfSwNCiAgICAiY29udHJhc3QiOiB7DQogICAgICAibWF4IjogMTAwLA0KICAgICAgIm1pbiI6IC0xMDAsDQogICAgICAic3RlcCI6IDEsDQogICAgICAidGV4dCI6ICJQcm9wZXJ0eS5Mb2NhbGl6YXRpb24uQ29udHJhc3QiLA0KICAgICAgInR5cGUiOiAic2xpZGVyIiwNCiAgICAgICJ2YWx1ZSI6IDANCiAgICB9LA0KICAgICJnYW1tYSI6IHsNCiAgICAgICJtYXgiOiAxMDAsDQogICAgICAibWluIjogLTEwMCwNCiAgICAgICJzdGVwIjogMSwNCiAgICAgICJ0ZXh0IjogIlByb3BlcnR5LkxvY2FsaXphdGlvbi5HYW1tYSIsDQogICAgICAidHlwZSI6ICJzbGlkZXIiLA0KICAgICAgInZhbHVlIjogMA0KICAgIH0sDQogICAgInNwZWVkIjogew0KICAgICAgIm1heCI6IDIuNSwNCiAgICAgICJtaW4iOiAwLjI1LA0KICAgICAgInN0ZXAiOiAwLjEsDQogICAgICAidGV4dCI6ICJQcm9wZXJ0eS5Mb2NhbGl6YXRpb24uU3BlZWQiLA0KICAgICAgInR5cGUiOiAic2xpZGVyIiwNCiAgICAgICJ2YWx1ZSI6IDENCiAgICB9LA0KICAgICJtdXRlIjogew0KICAgICAgInRleHQiOiAiUHJvcGVydHkuTG9jYWxpemF0aW9uLk11dGUiLA0KICAgICAgInR5cGUiOiAiY2hlY2tib3giLA0KICAgICAgInZhbHVlIjogZmFsc2UNCiAgICB9DQogIH0NCn0=";
public static readonly string MpvProperties = "ew0KICAiUHJvcGVydHlMaXN0ZW5lciI6ICJTdWNyb3NlUHJvcGVydHlMaXN0ZW5lcignezB9JywgezF9KTsiLA0KICAiUHJvcGVydHlMaXN0Ijogew0KICAgICJvbmx5TXB2Ijogew0KICAgICAgInR5cGUiOiAibGFiZWwiLA0KICAgICAgInZhbHVlIjogIlByb3BlcnR5LkxvY2FsaXphdGlvbi5NcHZQbGF5ZXIiDQogICAgfSwNCiAgICAidmlkZW8tem9vbSI6IHsNCiAgICAgICJtYXgiOiA1LA0KICAgICAgIm1pbiI6IC01LA0KICAgICAgInN0ZXAiOiAwLjUsDQogICAgICAidGV4dCI6ICJQcm9wZXJ0eS5Mb2NhbGl6YXRpb24uWm9vbSIsDQogICAgICAidHlwZSI6ICJzbGlkZXIiLA0KICAgICAgInZhbHVlIjogMA0KICAgIH0sDQogICAgInNhdHVyYXRpb24iOiB7DQogICAgICAibWF4IjogMTAwLA0KICAgICAgIm1pbiI6IC0xMDAsDQogICAgICAic3RlcCI6IDEsDQogICAgICAidGV4dCI6ICJQcm9wZXJ0eS5Mb2NhbGl6YXRpb24uU2F0dXJhdGlvbiIsDQogICAgICAidHlwZSI6ICJzbGlkZXIiLA0KICAgICAgInZhbHVlIjogMA0KICAgIH0sDQogICAgImh1ZSI6IHsNCiAgICAgICJtYXgiOiAxMDAsDQogICAgICAibWluIjogLTEwMCwNCiAgICAgICJzdGVwIjogMSwNCiAgICAgICJ0ZXh0IjogIlByb3BlcnR5LkxvY2FsaXphdGlvbi5IdWUiLA0KICAgICAgInR5cGUiOiAic2xpZGVyIiwNCiAgICAgICJ2YWx1ZSI6IDANCiAgICB9LA0KICAgICJzaGFycGVuIjogew0KICAgICAgIm1heCI6IDEwMCwNCiAgICAgICJtaW4iOiAwLA0KICAgICAgInN0ZXAiOiAxLA0KICAgICAgInRleHQiOiAiUHJvcGVydHkuTG9jYWxpemF0aW9uLlNoYXJwbmVzcyIsDQogICAgICAidHlwZSI6ICJzbGlkZXIiLA0KICAgICAgInZhbHVlIjogMA0KICAgIH0sDQogICAgImJyaWdodG5lc3MiOiB7DQogICAgICAibWF4IjogMTAwLA0KICAgICAgIm1pbiI6IC0xMDAsDQogICAgICAic3RlcCI6IDEsDQogICAgICAidGV4dCI6ICJQcm9wZXJ0eS5Mb2NhbGl6YXRpb24uQnJpZ2h0bmVzcyIsDQogICAgICAidHlwZSI6ICJzbGlkZXIiLA0KICAgICAgInZhbHVlIjogMA0KICAgIH0sDQogICAgImNvbnRyYXN0Ijogew0KICAgICAgIm1heCI6IDEwMCwNCiAgICAgICJtaW4iOiAtMTAwLA0KICAgICAgInN0ZXAiOiAxLA0KICAgICAgInRleHQiOiAiUHJvcGVydHkuTG9jYWxpemF0aW9uLkNvbnRyYXN0IiwNCiAgICAgICJ0eXBlIjogInNsaWRlciIsDQogICAgICAidmFsdWUiOiAwDQogICAgfSwNCiAgICAiZ2FtbWEiOiB7DQogICAgICAibWF4IjogMTAwLA0KICAgICAgIm1pbiI6IC0xMDAsDQogICAgICAic3RlcCI6IDEsDQogICAgICAidGV4dCI6ICJQcm9wZXJ0eS5Mb2NhbGl6YXRpb24uR2FtbWEiLA0KICAgICAgInR5cGUiOiAic2xpZGVyIiwNCiAgICAgICJ2YWx1ZSI6IDANCiAgICB9LA0KICAgICJzcGVlZCI6IHsNCiAgICAgICJtYXgiOiAyLjUsDQogICAgICAibWluIjogMC4yNSwNCiAgICAgICJzdGVwIjogMC4xLA0KICAgICAgInRleHQiOiAiUHJvcGVydHkuTG9jYWxpemF0aW9uLlNwZWVkIiwNCiAgICAgICJ0eXBlIjogInNsaWRlciIsDQogICAgICAidmFsdWUiOiAxDQogICAgfSwNCiAgICAibXV0ZSI6IHsNCiAgICAgICJ0ZXh0IjogIlByb3BlcnR5LkxvY2FsaXphdGlvbi5NdXRlIiwNCiAgICAgICJ0eXBlIjogImNoZWNrYm94IiwNCiAgICAgICJ2YWx1ZSI6IGZhbHNlDQogICAgfQ0KICB9DQp9";

public static SSESB BrowserSettings = new()
{
Expand Down

0 comments on commit a95e6d6

Please sign in to comment.