Skip to content

Commit

Permalink
chg - Restored fix for .NET Framework
Browse files Browse the repository at this point in the history
---

Type: chg
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jul 28, 2024
1 parent 5a964a9 commit 51ead23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions BassBoom.Basolia/File/FileTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using BassBoom.Native.Interop.Play;
using System.Linq;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Threading.Tasks;

namespace BassBoom.Basolia.File
Expand Down Expand Up @@ -124,9 +125,8 @@ public static async Task OpenUrlAsync(string path)
throw new BasoliaException("Provide a path to a music file or a radio station", mpg123_errors.MPG123_BAD_FILE);

// Check to see if the radio station exists
#if NET48
RadioTools.client = new();
#endif
if (RuntimeInformation.FrameworkDescription.Contains("Framework"))
RadioTools.client = new();
RadioTools.client.DefaultRequestHeaders.Add("Icy-MetaData", "1");
var reply = await RadioTools.client.GetAsync(path, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
RadioTools.client.DefaultRequestHeaders.Remove("Icy-MetaData");
Expand Down
6 changes: 3 additions & 3 deletions BassBoom.Basolia/Radio/RadioTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using System;
using System.Linq;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Threading.Tasks;

namespace BassBoom.Basolia.Radio
Expand Down Expand Up @@ -52,9 +53,8 @@ public static async Task<IRadioServer> GetRadioInfoAsync(string radioUrl)
var uri = new Uri(radioUrl);

// Check to see if the radio station exists
#if NET48
client = new();
#endif
if (RuntimeInformation.FrameworkDescription.Contains("Framework"))
client = new();
client.DefaultRequestHeaders.Add("Icy-MetaData", "1");
var reply = await client.GetAsync(radioUrl, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
client.DefaultRequestHeaders.Remove("Icy-MetaData");
Expand Down

0 comments on commit 51ead23

Please sign in to comment.