Skip to content

Commit db77363

Browse files
committed
Removed Teknik, Updated to Legacy API, Basic Fix For Unfound Dependency Issues
1 parent 75daf23 commit db77363

File tree

5 files changed

+11
-82
lines changed

5 files changed

+11
-82
lines changed

ModAssistant/Classes/Utils.cs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ public class Utils
2626
public class Constants
2727
{
2828
public const string BeatSaberAPPID = "620980";
29-
public const string BeatModsAPIUrl = "https://beatmods.com/api/v1/";
30-
public const string TeknikAPIUrl = "https://api.teknik.io/v1/";
3129
public const string BeatModsURL = "https://beatmods.com";
32-
public const string BeatModsVersions = "https://versions.beatmods.com/versions.json";
33-
public const string BeatModsAlias = "https://alias.beatmods.com/aliases.json";
30+
public const string BeatModsAPIUrl = BeatModsURL + "/api/beatmods/";
31+
public const string BeatModsVersions = BeatModsURL + "/api/beatmods/versions";
32+
public const string BeatModsAlias = BeatModsURL + "/api/beatmods/aliases";
3433
public const string WeebCDNAPIURL = "https://waifu.pics/api/sfw/";
3534
public const string BeatModsModsOptions = "mod?status=approved";
3635
public const string MD5Spacer = " ";
@@ -44,20 +43,6 @@ public class Constants
4443
};
4544
}
4645

47-
public class TeknikPasteResponse
48-
{
49-
public Result result;
50-
public class Result
51-
{
52-
public string id;
53-
public string url;
54-
public string title;
55-
public string syntax;
56-
public DateTime? expiration;
57-
public string password;
58-
}
59-
}
60-
6146
public class WeebCDNRandomResponse
6247
{
6348
public string url;

ModAssistant/Pages/Mods.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,12 @@ private void ResolveDependencies(Mod dependent)
562562
{
563563
foreach (Mod.Dependency dependency in dependent.dependencies)
564564
{
565+
if(dependency.Mod == null)
566+
{
567+
dependent.ListItem.IsEnabled = false;
568+
continue;
569+
}
570+
565571
if (dependency.Mod.ListItem.IsEnabled)
566572
{
567573
dependency.Mod.ListItem.PreviousState = dependency.Mod.ListItem.IsSelected;

ModAssistant/Pages/Options.xaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,6 @@
345345
Margin="0"
346346
HorizontalAlignment="Left"
347347
Orientation="Horizontal">
348-
<Button
349-
Height="30"
350-
Margin="5"
351-
Padding="5"
352-
Click="OpenLogsDirButton_Click"
353-
Content="{DynamicResource Options:OpenLogsButton}" />
354348
<Button
355349
x:Name="OpenAppData"
356350
Height="30"

ModAssistant/Pages/Options.xaml.cs

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -196,62 +196,6 @@ private void ReinstallInstalled_Unchecked(object sender, RoutedEventArgs e)
196196
Properties.Settings.Default.Save();
197197
}
198198

199-
private async void OpenLogsDirButton_Click(object sender, RoutedEventArgs e)
200-
{
201-
try
202-
{
203-
MainWindow.Instance.MainText = $"{Application.Current.FindResource("Options:UploadingLog")}...";
204-
await Task.Run(async () => await UploadLog());
205-
206-
Process.Start(LogURL);
207-
Utils.SetClipboard(LogURL);
208-
MainWindow.Instance.MainText = (string)Application.Current.FindResource("Options:LogUrlCopied");
209-
}
210-
catch (Exception exception)
211-
{
212-
MainWindow.Instance.MainText = $"{Application.Current.FindResource("Options:LogUploadFailed")}.";
213-
214-
string title = (string)Application.Current.FindResource("Options:LogUploadFailed:Title");
215-
string body = (string)Application.Current.FindResource("Options:LogUploadFailed:Body");
216-
MessageBox.Show($"{body}\n ================= \n" + exception, title);
217-
Utils.OpenFolder(Path.Combine(InstallDirectory, "Logs"));
218-
}
219-
}
220-
221-
private async Task UploadLog()
222-
{
223-
const string DateFormat = "yyyy-mm-dd HH:mm:ss";
224-
DateTime now = DateTime.Now;
225-
string logPath = Path.GetDirectoryName(ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath);
226-
string Log = Path.Combine(logPath, "log.log");
227-
string GameLog = File.ReadAllText(Path.Combine(InstallDirectory, "Logs", "_latest.log"));
228-
string Separator = File.Exists(Log) ? $"\n\n=============================================\n============= Mod Assistant Log =============\n=============================================\n\n" : string.Empty;
229-
string ModAssistantLog = File.Exists(Log) ? File.ReadAllText(Log) : string.Empty;
230-
231-
var nvc = new List<KeyValuePair<string, string>>()
232-
{
233-
new KeyValuePair<string, string>("title", $"_latest.log ({now.ToString(DateFormat)})"),
234-
new KeyValuePair<string, string>("expireUnit", "hour"),
235-
new KeyValuePair<string, string>("expireLength", "5"),
236-
new KeyValuePair<string, string>("code", $"{GameLog}{Separator}{ModAssistantLog}"),
237-
};
238-
239-
string[] items = new string[nvc.Count];
240-
241-
for (int i = 0; i < nvc.Count; i++)
242-
{
243-
KeyValuePair<string, string> item = nvc[i];
244-
items[i] = WebUtility.UrlEncode(item.Key) + "=" + WebUtility.UrlEncode(item.Value);
245-
}
246-
247-
StringContent content = new StringContent(string.Join("&", items), null, "application/x-www-form-urlencoded");
248-
HttpResponseMessage resp = await Http.HttpClient.PostAsync(Utils.Constants.TeknikAPIUrl + "Paste", content);
249-
string body = await resp.Content.ReadAsStringAsync();
250-
251-
Utils.TeknikPasteResponse TeknikResponse = Http.JsonSerializer.Deserialize<Utils.TeknikPasteResponse>(body);
252-
LogURL = TeknikResponse.result.url;
253-
}
254-
255199
private void OpenAppDataButton_Click(object sender, RoutedEventArgs e)
256200
{
257201
string location = Path.Combine(

ModAssistant/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.1.34.0")]
55-
[assembly: AssemblyFileVersion("1.1.34.0")]
54+
[assembly: AssemblyVersion("1.1.35.0")]
55+
[assembly: AssemblyFileVersion("1.1.35.0")]

0 commit comments

Comments
 (0)