Skip to content

Commit

Permalink
End beta mode, update versions, handle null SongId
Browse files Browse the repository at this point in the history
The `IsBeta` flag in `App.xaml.cs` was changed from `true` to `false`, indicating that the application is no longer in beta mode.

The assembly version and file version in `AssemblyInfo.cs` were updated from `1.6.6.6` to `1.6.7.1`.

In `SongFetcher.cs`, the assignment to `GlobalObjects.Canvas` was modified to handle the case where `songInfo.SongId` is `null`. If `songInfo.SongId` is `null`, `GlobalObjects.Canvas` is set to a new `Tuple` with `false` and an empty string.

In `WebHelper.cs`, a minor formatting change was made to the `catch` block to remove the space between `Exception` and the closing parenthesis.

A new check was added in the `GetCanvasAsync` method in `WebHelper.cs` to return a `Tuple` with `false` and an empty string if `songInfo.SongId` is `null` or empty.
  • Loading branch information
Inzaniity committed Nov 19, 2024
1 parent 2e524f0 commit 0a416b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Songify Slim/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Songify_Slim
public partial class App
{
private static Mutex _mutex;
public static bool IsBeta = true;
public static bool IsBeta = false;

private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
Expand Down
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.6.289.1634")]
[assembly: AssemblyVersion("1.6.6.6")]
[assembly: AssemblyFileVersion("1.6.6.6")]
[assembly: AssemblyVersion("1.6.7.1")]
[assembly: AssemblyFileVersion("1.6.7.1")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: Guid("442379e3-32d8-42d1-ab09-cba229672453")]
3 changes: 1 addition & 2 deletions Songify Slim/Util/Songify/SongFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,7 @@ public async Task FetchSpotifyWeb()

GlobalObjects.CurrentSong = songInfo;
_canvasResponse = await WebHelper.GetCanvasAsync(songInfo.SongId);
GlobalObjects.Canvas = _canvasResponse;

GlobalObjects.Canvas = songInfo.SongId != null ? _canvasResponse : new Tuple<bool, string>(false, "");
//if current track is on skiplist, skip it
if (GlobalObjects.SkipList.Find(o => o.Trackid == songInfo.SongId) != null)
{
Expand Down
6 changes: 5 additions & 1 deletion Songify Slim/Util/Songify/WebHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ await Application.Current.Dispatcher.BeginInvoke(new Action(() =>
throw new ArgumentOutOfRangeException(nameof(method), method, null);
}
}
catch (Exception )
catch (Exception)
{
//Console.WriteLine(e);
}
Expand Down Expand Up @@ -217,6 +217,10 @@ public static async Task<List<PSA>> GetPSA()

public static async Task<Tuple<bool, string>> GetCanvasAsync(string songInfoSongId)
{
if (string.IsNullOrEmpty(songInfoSongId))
{
return new Tuple<bool, string>(false, "");
}
string result = await ApiClient.GetCanvas(songInfoSongId);
result = result.Replace("\"", "");
return result != "No canvas found" ? new Tuple<bool, string>(true, result) : new Tuple<bool, string>(false, "");
Expand Down

0 comments on commit 0a416b7

Please sign in to comment.