Skip to content

Commit

Permalink
chore: Remove unused store details
Browse files Browse the repository at this point in the history
  • Loading branch information
svrooij committed May 2, 2024
1 parent 399ee04 commit f13ddbd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 245 deletions.
223 changes: 0 additions & 223 deletions src/WingetIntune/Internal/MsStore/MicrosoftStoreDetails.cs

This file was deleted.

21 changes: 0 additions & 21 deletions src/WingetIntune/Internal/MsStore/StoreClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,6 @@ public MicrosoftStoreClient(HttpClient httpClient, ILogger<MicrosoftStoreClient>
return await response.Content.ReadFromJsonAsync<MicrosoftStoreManifest>(cancellationToken: cancellation);
}

public async Task<MicrosoftStoreDetails?> GetStoreDetailsAsync(string packageId, CancellationToken cancellation)
{
LogGetDetails(packageId);
var url = $"https://apps.microsoft.com/store/api/ProductsDetails/GetProductDetailsById/{packageId}?hl=en-US&gl=US";
//var url = $"https://storeedgefd.dsx.mp.microsoft.com/v9.0/productDetails/{packageId}?hl=en-US&gl=US";
try
{
var response = await _httpClient.GetAsync(url, cancellation);
response.EnsureSuccessStatusCode();
var text = await response.Content.ReadAsStringAsync(cancellation);
return await response.Content.ReadFromJsonAsync<MicrosoftStoreDetails>(cancellationToken: cancellation);
}
catch (Exception ex)
{
_logger.LogError(ex, "Failed to get details for {packageId} from Microsoft Store", packageId);
return null;
}
}

public async Task<MicrosoftStoreSearchResult?> Search(string searchString, CancellationToken cancellationToken)
{
var url = "https://storeedgefd.dsx.mp.microsoft.com/v9.0/manifestSearch";
Expand Down Expand Up @@ -94,6 +75,4 @@ public MicrosoftStoreClient(HttpClient httpClient, ILogger<MicrosoftStoreClient>
[LoggerMessage(EventId = 2, Level = LogLevel.Information, Message = "Getting manifest for {packageId} from Microsoft Store")]
private partial void LogGetManifest(string packageId);

[LoggerMessage(EventId = 3, Level = LogLevel.Information, Message = "Getting details for {packageId} from Microsoft Store")]
private partial void LogGetDetails(string packageId);
}
2 changes: 1 addition & 1 deletion src/WingetIntune/Internal/MsStore/store-requests.http
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ GET https://displaycatalog.mp.microsoft.com/v7.0/products?bigIds=9NZVDKPMR9RD&ma
###

GET https://storeedgefd.dsx.mp.microsoft.com/v9.0/packageManifests/9NZVDKPMR9RD
Accept: application/json
Accept: application/json

0 comments on commit f13ddbd

Please sign in to comment.