diff --git a/PluginManager/Online/Updates/PluginUpdater.cs b/PluginManager/Online/Updates/PluginUpdater.cs index 7f76cc6..cd0d790 100644 --- a/PluginManager/Online/Updates/PluginUpdater.cs +++ b/PluginManager/Online/Updates/PluginUpdater.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; + using PluginManager.Items; using PluginManager.Others; @@ -11,7 +12,7 @@ public class PluginUpdater { try { - var webV = await ServerCom.GetVersionOfPackageFromWeb(pakName); + var webV = await ServerCom.GetVersionOfPackageFromWeb(pakName); var local = ServerCom.GetVersionOfPackage(pakName); if (local is null) return true; @@ -29,17 +30,6 @@ public class PluginUpdater return false; } - public static async Task DownloadUpdateInfo(string pakName) - { - var url = "https://raw.githubusercontent.com/Wizzy69/installer/discord-bot-files/Versions"; - var info = await ServerCom.ReadTextFromURL(url); - var version = await ServerCom.GetVersionOfPackageFromWeb(pakName); - - if (version is null) return Update.Empty; - var update = new Update(pakName, string.Join('\n', info), version); - return update; - } - public static async Task Download(string pakName) { Utilities.WriteColorText("An update was found for &g" + pakName + "&c. Version: &r" + diff --git a/PluginManager/Online/Updates/Update.cs b/PluginManager/Online/Updates/Update.cs deleted file mode 100644 index 2cdde6b..0000000 --- a/PluginManager/Online/Updates/Update.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using PluginManager.Online.Helpers; - -namespace PluginManager.Online.Updates; - -public class Update -{ - public static Update Empty = new(null, null, null); - - private readonly bool isEmpty; - - public VersionString newVersion; - public string pakName; - public string UpdateMessage; - - public Update(string pakName, string updateMessage, VersionString newVersion) - { - this.pakName = pakName; - UpdateMessage = updateMessage; - this.newVersion = newVersion; - - if (pakName is null && updateMessage is null && newVersion is null) - isEmpty = true; - } - - public override string ToString() - { - if (isEmpty) - throw new Exception("The update is EMPTY. Can not print information about an empty update !"); - return $"Package Name: {pakName}\n" + - $"Update Message: {UpdateMessage}\n" + - $"Version: {newVersion}"; - } -} \ No newline at end of file