Skip to content

Commit

Permalink
Update Spotify.API.Web to 7.1.1. Update Microsoft ConfigurationManage…
Browse files Browse the repository at this point in the history
…r to latest. Fix VXMusic library reference in VXMusicDesktop
  • Loading branch information
Soapwood committed May 23, 2024
1 parent 1ce8b5a commit 8d8240f
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 20 deletions.
2 changes: 1 addition & 1 deletion VXMusic/Connections/Spotify/SpotifyPlaylistManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static async Task<SpotifyPlaylistReponse> AddTrackToPlaylist(string playl
return SpotifyPlaylistReponse.TrackAdded;
}

public static string GetPlaylistIdByNameIfExists(string playlistName, IList<SimplePlaylist> playlists)
public static string GetPlaylistIdByNameIfExists(string playlistName, IList<FullPlaylist> playlists)
{
if (SpotifyClientBuilder.Instance == null)
throw new Exception("Not authenticated with Spotify API."); // TODO Handle this, and output to UI
Expand Down
17 changes: 10 additions & 7 deletions VXMusic/VXMusic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>none</DebugType>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="com.csutil.cscore" Version="1.8.10" />
<PackageReference Include="Inflatable.Lastfm" Version="1.2.0" />
<PackageReference Include="Inflatable.Lastfm.SQLite" Version="1.1.0.351" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0-preview.6.23329.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0-preview.6.23329.7" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0-preview.7.23375.6" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0-preview.4.24266.19" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0-preview.4.24266.19" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0-preview.4.24266.19" />
<PackageReference Include="NAudio" Version="2.1.0" />
<PackageReference Include="NAudio.Lame" Version="2.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="OscCore" Version="1.0.5" />
<PackageReference Include="OVRSharp" Version="1.2.0" />
<PackageReference Include="SharpDX" Version="4.2.0" />
<PackageReference Include="SharpDX.Direct3D11" Version="4.2.0" />
<PackageReference Include="SpotifyAPI.Web" Version="7.0.0" />
<PackageReference Include="SpotifyAPI.Web.Auth" Version="7.0.0" />
<PackageReference Include="SpotifyAPI.Web" Version="7.1.1" />
<PackageReference Include="SpotifyAPI.Web.Auth" Version="7.1.1" />
<PackageReference Include="ToastNotifications" Version="2.5.1" />
<PackageReference Include="ToastNotifications.Messages" Version="2.5.1" />
</ItemGroup>
Expand All @@ -54,5 +54,8 @@
</Reference>
</ItemGroup>


<ItemGroup>
<Folder Include="Games\VRChat\VRChatOSCLib\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
using System;
using System.Windows;
using System.Xml;
using ToastNotifications;
using ToastNotifications.Lifetime;
using ToastNotifications.Position;
using ToastNotifications.Messages;
using VXMusic;

namespace VXMusic.Windows;
namespace VXMusicDesktop.Toast;

public class ToastNotificationClient : INotificationClient
{
private readonly Window _window;
public bool ShouldToastNotificationsBeShown;

private readonly Notifier _longNotifier;
private readonly Notifier _shortNotifier;

Expand All @@ -17,6 +21,7 @@ public class ToastNotificationClient : INotificationClient

public ToastNotificationClient(Window window)
{
_window = window;
_longNotifier = CreateNotifier(window, TimeSpan.FromSeconds(LongNotifierTimeout));
_shortNotifier = CreateNotifier(window, TimeSpan.FromSeconds(ShortNotifierTimeout));
}
Expand All @@ -41,18 +46,20 @@ private Notifier CreateNotifier(Window window, TimeSpan lifeTime)

public void SendNotification(NotificationLevel level, string title, string content, int timeout, string image)
{
GetToastCall(level, title, content, timeout);
if(ShouldToastNotificationsBeShown)
GetToastCall(level, title, content, timeout);
}

public void SendNotification(NotificationLevel level, string title, string content, int timeout)
{
GetToastCall(level, title, content, timeout);
if(ShouldToastNotificationsBeShown)
GetToastCall(level, title, content, timeout);
}

private void GetToastCall(NotificationLevel level, string title, string content, int timeout)
{
Notifier toastNotifier = timeout <= ShortNotifierTimeout ? _shortNotifier : _longNotifier;

switch (level)
{
case NotificationLevel.Warning:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace VXMusic.Windows;
using VXMusic;

namespace VXMusicDesktop.Toast;

public class ToastNotificationDecorator
{
Expand Down
24 changes: 18 additions & 6 deletions VXMusicDesktop/VXMusicDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageIcon>VXLogo.png</PackageIcon>
<ApplicationIcon>Images\VXLogoIcon.ico</ApplicationIcon>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<Version>0.5.1</Version>
<Version>0.5.3</Version>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down Expand Up @@ -134,14 +134,16 @@

<ItemGroup>
<PackageReference Include="Inflatable.Lastfm.SQLite" Version="1.1.0.351" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0-preview.4.24266.19" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0-preview.4.24266.19" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.0-preview.4.24266.19" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0-preview.4.24266.19" />
<PackageReference Include="NLog" Version="5.2.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.3" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
<PackageReference Include="SpotifyAPI.Web" Version="7.1.1" />
<PackageReference Include="System.Windows.Interactivity.WPF" Version="2.0.20525" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\VXMusic\VXMusic.csproj" />
<PackageReference Include="ToastNotifications" Version="2.5.1" />
<PackageReference Include="ToastNotifications.Messages" Version="2.5.1" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -196,6 +198,16 @@
</AdditionalFiles>
</ItemGroup>

<ItemGroup>
<Reference Include="VXMusic">
<HintPath>bin\Debug\net7.0-windows\VXMusic.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\VXMusic\VXMusic.csproj" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(ProjectDir)\Overlay\bin&quot; &quot;$(OutDir)\Overlay&quot; /E /H /Y" />
</Target>
Expand Down

0 comments on commit 8d8240f

Please sign in to comment.