Portable .Net library for Last.fm
Go to file
andy 902b6e6a8c
fix: ci build of PRs, ignore failing charts tests, updating tests version to .NET 6 (#175)
* fixed failing integration tests, upgraded test projects to .NET Core 3.1

added more nulled properties for those that can be altered on the API
closes #146

* bumping test projects up to .NET 6

* adding specific solution to dotnet commands (was breaking after adding second sln)

* solution name in title instead of command!

* dummy commit to test push for actions

* another dummy commit

* adding pull_request trigger
2023-01-04 14:55:21 +00:00
.github/workflows fix: ci build of PRs, ignore failing charts tests, updating tests version to .NET 6 (#175) 2023-01-04 14:55:21 +00:00
doc Update docs to ref .NET Core SDK 2020-06-28 01:17:53 +01:00
res Add logo to readme 2016-12-05 02:58:01 +00:00
src fix: ci build of PRs, ignore failing charts tests, updating tests version to .NET 6 (#175) 2023-01-04 14:55:21 +00:00
.gitattributes Initial commit 2013-06-08 18:49:21 +01:00
.gitignore fix: ci build of PRs, ignore failing charts tests, updating tests version to .NET 6 (#175) 2023-01-04 14:55:21 +00:00
coverage.ps1 Include integration tests in code coverage report 2015-01-04 04:04:58 +00:00
IF.Lastfm.sln Add core tests project to sln + upgrade deps 2020-06-28 02:14:54 +01:00
IF.Lastfm.Testing.sln fix: ci build of PRs, ignore failing charts tests, updating tests version to .NET 6 (#175) 2023-01-04 14:55:21 +00:00
LICENCE.md Update LICENCE.md 2014-09-16 18:29:54 +01:00
PROGRESS.md Add library.getArtists 2016-11-30 04:30:03 +00:00
README.md docs: add maintenence help note 2021-05-18 12:00:50 +01:00

Inflatable Last.fm .NET SDK

Project logo

Code licence

Maintenence help wanted

Hi there! The maintainer of this library @rikkit is now mostly a TypeScript + React dev, and has been for the last several years. Since this is a .Net library, the maintainer will probably not be able to keep it up-to-date to the latest .Net standards. If you spot something wrong, please file and issue or better yet, a pull request. Thanks!

Project Goals

  • To provide complete .NET bindings for the Last.fm REST API
  • To build useful components for Last.fm applications
  • To be the very best, like no-one ever was

Contributing

Input is always welcome! Raise an issue on GitHub, or send a message to the Gitter chatroom if you need help with the library.

If you're interested in contributing code or documentation, this short introduction to the library will help you get started.

Quickstart

Installing

NuGet

Install Inflatable.Lastfm from NuGet.

NuGet - prerelease code

  1. Install the .NET Core SDK
  2. Clone this repo and checkout to the commit you need
  3. Run dotnet pack
  4. Reference the built NuGet package file in your project

Examples

First, sign up for Last.fm API access if you haven't already.

Create a LastfmClient:

var client = new LastfmClient("apikey", "apisecret");

Get information about an album:

var response = await client.Album.GetInfoAsync("Grimes", "Visions");

LastAlbum visions = response.Content;

For methods that return several items, you can iterate over the response:

var pageResponse = await client.Artist.GetTopTracksAsync("Ben Frost", page: 5, itemsPerPage: 100);

var trackNames = pageResponse.Select(track => track.Name);

Several API methods require user authentication. Once you have your user's Last.fm username and password, you can authenticate your instance of LastfmClient:

var response = await client.Auth.GetSessionTokenAsync("username", "pass");

// or load an existing session
UserSession cachedSession;
var succesful = client.Auth.LoadSession(cachedSession);

Authenticated methods then work like any other

if (client.Auth.HasAuthenticated) {
	var response = await client.Track.LoveAsync("Ibi Dreams of Pavement (A Better Day)", "Broken Social Scene");
}

Documentation

Platform Compatibility

The main package targets netstandard1.1. Development is on the master branch.

Dependencies

  • Newtonsoft.Json 9.0.1 =<
  • System.Net.Http 4.3.0 =<

Supported platforms

Check this table for supported platforms.

Other platforms

If you need support for a .NET platform that doesn't support .Net Standard 1.1, first see if the feature you need is available in v0.3 or earlier - that version targeted PCL profile 259, and so is compatible with e.g. Windows 8.0 and Windows Phone 7.

If you need a feature for these older platforms, please raise an issue.

Credits

Maintained by @rikkilt. Thanks to all contributors!