Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ Desktop.ini
/IF.Lastfm.sln.ide
project.lock.json
.claude
.idea
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override async Task<PageResponse<LastStation>> HandleResponse(HttpRespons

var stations = stationsToken.Children().Select(LastStation.ParseJToken).ToList();

var pageresponse = PageResponse<LastStation>.CreateSuccessResponse(stations);
var pageresponse = new PageResponse<LastStation>(stations);

var attrToken = jtoken.SelectToken("@attr");
pageresponse.AddPageInfoFromJToken(attrToken);
Expand Down
18 changes: 3 additions & 15 deletions src/IF.Lastfm.Core/Api/Helpers/PageResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public PageResponse() : this(Enumerable.Empty<T>())

public PageResponse(IEnumerable<T> content)
{
Status = LastResponseStatus.Successful;
Page = 1;
TotalPages = 1;
Content = new ReadOnlyCollection<T>(content.ToList());
Expand Down Expand Up @@ -92,9 +93,7 @@ public static PageResponse<T> CreateErrorResponse(LastResponseStatus status)

internal static PageResponse<T> CreateErrorResponse(string json, HttpResponseMessage httpResponse)
{
LastResponseStatus status;
string message;
LastFm.IsResponseValid(json, out status, out message);
LastFm.IsResponseValid(json, out var status, out var message);
var r = new PageResponse<T>
{
Status = status,
Expand All @@ -120,17 +119,6 @@ internal static PageResponse<T> CreateErrorResponse(string json, HttpResponseMes
return r;
}

[Obsolete]
public static PageResponse<T> CreateSuccessResponse(IEnumerable<T> content)
{
var r = new PageResponse<T>(content)
{
Status = LastResponseStatus.Successful
};

return r;
}

public static PageResponse<T> CreateSuccessResponse(JToken itemsToken, Func<JToken, T> parseToken)
{
return CreateSuccessResponse(itemsToken, null, parseToken, LastPageResultsType.None);
Expand Down Expand Up @@ -162,7 +150,7 @@ public static IEnumerable<T> ParseItemsToken(JToken itemsToken, Func<JToken, T>

return items;
}

public static PageResponse<T> CreateSuccessResponse(JToken itemsToken, JToken pageInfoToken, Func<JToken, T> parseToken, LastPageResultsType pageResultsType)
{
var items = ParseItemsToken(itemsToken, parseToken);
Expand Down
2 changes: 1 addition & 1 deletion src/IF.Lastfm.Core/IF.Lastfm.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>Lastream.Lastfm</PackageId>
<VersionPrefix>1.0.0</VersionPrefix> <!-- https://stackoverflow.com/a/42615574/268555 -->
<VersionPrefix>1.0.1</VersionPrefix> <!-- https://stackoverflow.com/a/42615574/268555 -->

<Title>Lastream Last.fm SDK</Title>
<Description>Last.fm SDK for modern .NET platforms. Maintained fork of Inflatable.Lastfm.</Description>
Expand Down
Loading