Skip to content

Commit

Permalink
No API use if audio format is WAV #407
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallet committed Jun 21, 2022
1 parent 6a405d3 commit 306b161
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 71 deletions.
2 changes: 1 addition & 1 deletion EspionSpotify/API/ExternalAPI.cs
Expand Up @@ -2,6 +2,6 @@
{
public static class ExternalAPI
{
public static IExternalAPI Instance { get; set; } = new LastFMAPI();
public static IExternalAPI Instance { get; set; } = new NoneAPI();
}
}
25 changes: 25 additions & 0 deletions EspionSpotify/API/NoneAPI.cs
@@ -0,0 +1,25 @@
using System.Threading.Tasks;
using EspionSpotify.Enums;
using EspionSpotify.Models;

namespace EspionSpotify.API
{
public class NoneAPI: IExternalAPI
{
public ExternalAPIType GetTypeAPI => ExternalAPIType.None;
public bool IsAuthenticated => true;
public Task Authenticate()
{
return Task.CompletedTask;
}

public void Reset()
{
}

public Task<bool> UpdateTrack(Track track)
{
return Task.FromResult(true);
}
}
}
1 change: 1 addition & 0 deletions EspionSpotify/Enums/ExternalAPIType.cs
Expand Up @@ -2,6 +2,7 @@
{
public enum ExternalAPIType
{
None = - 1,
LastFM = 0,
Spotify
}
Expand Down
1 change: 1 addition & 0 deletions EspionSpotify/EspionSpotify.csproj
Expand Up @@ -176,6 +176,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Analytics.cs" />
<Compile Include="API\NoneAPI.cs" />
<Compile Include="AudioSessions\AudioLoopback.cs" />
<Compile Include="Native\Models\HRESULT.cs" />
<Compile Include="Router\AudioRouter.cs" />
Expand Down

0 comments on commit 306b161

Please sign in to comment.