Skip to content

Commit

Permalink
Update version, URLs, and add update check feature
Browse files Browse the repository at this point in the history
Incremented assembly and file version in AssemblyInfo.cs. Updated BaseUrl and AuthUrl in GlobalObjects.cs. Corrected typo in TokenSwapAuth.cs. Added "Check For Updates" menu item in MainWindow.xaml and implemented related methods and event handlers in MainWindow.xaml.cs. Included minor formatting changes and a try-catch block around GetCurrentSongAsync method call.
  • Loading branch information
Inzaniity committed Aug 28, 2024
1 parent 70f51b2 commit f0caea3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Songify Slim/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.5.0")]
[assembly: AssemblyFileVersion("1.6.5.0")]
[assembly: AssemblyVersion("1.6.5.1")]
[assembly: AssemblyFileVersion("1.6.5.1")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: Guid("442379e3-32d8-42d1-ab09-cba229672453")]
4 changes: 2 additions & 2 deletions Songify Slim/Util/General/GlobalObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ namespace Songify_Slim.Util.General
public static class GlobalObjects
{
public const string ApiUrl = "https://api.songify.rocks/v2";
public const string BaseUrl = "https://songify.overcode.tv";
public const string AuthUrl = "https://songify.overcode.tv";
public const string BaseUrl = "https://songify.bloemacher.com";
public const string AuthUrl = "https://songify.bloemacher.com";
public const string AltAuthUrl = "https://songify.bloemacher.com";
public static string ApiResponse;
public static string AppVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async Task<Token> GetToken(string grantType, string authorizationCode = "", stri
if (siteResponse.StatusCode == HttpStatusCode.ServiceUnavailable)
{
if (!siteResponse.RequestMessage.RequestUri.ToString().Contains(GlobalObjects.AuthUrl)) return null;
General.Logger.LogStr("SPOTIFY: Isses Authentication, trying alternate url");
General.Logger.LogStr("SPOTIFY: Issues Authentication, trying alternate url");
await SpotifyApiHandler.DoAuthAsync(true);
return null;
}
Expand Down
5 changes: 5 additions & 0 deletions Songify Slim/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@
<MenuItem Click="BtnLogFolderClick" Header="{x:Static local:Resources.mw_menu_Help_LogFolder}" />
<MenuItem Click="BtnAboutClick" Header="{x:Static local:Resources.mw_menu_Help_About}" />
</MenuItem>
<MenuItem
x:Name="mi_Update"
Click="Mi_Update_OnClick"
Header="Check For Updates">
</MenuItem>
<MenuItem
x:Name="mi_Exit"
Click="Mi_Exit_Click"
Expand Down
16 changes: 14 additions & 2 deletions Songify Slim/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ private async Task FinalSetupAndUpdatesAsync()
}

CheckForUpdates();

}


Expand Down Expand Up @@ -656,12 +657,18 @@ private static void CheckForUpdates()
AutoUpdater.AppTitle = "Songify";
AutoUpdater.RunUpdateAsAdmin = false;
AutoUpdater.ApplicationExitEvent += AutoUpdater_ApplicationExitEvent;
AutoUpdater.ReportErrors = false;
AutoUpdater.ReportErrors = true;
AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent;
AutoUpdater.Start(Settings.BetaUpdates
? $"{GlobalObjects.BaseUrl}/update-beta.xml"
: $"{GlobalObjects.BaseUrl}/update.xml");
}

private static void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args)
{
Debug.Write(args);
}

private void CreateSystrayIcon()
{
_contextMenu.MenuItems.AddRange([
Expand Down Expand Up @@ -820,7 +827,7 @@ private async void OnTimedEvent(object source, ElapsedEventArgs e)
{
img_cover.Visibility = _selectedSource == PlayerType.SpotifyWeb && Settings.DownloadCover ? Visibility.Visible : Visibility.Collapsed;
}));

try
{
_sCts.CancelAfter(3500);
Expand Down Expand Up @@ -1016,5 +1023,10 @@ public void SetTextPreview(string replace)
TxtblockLiveoutput.Text = replace;
}));
}

private void Mi_Update_OnClick(object sender, RoutedEventArgs e)
{
CheckForUpdates();
}
}
}

0 comments on commit f0caea3

Please sign in to comment.