Giter Site home page Giter Site logo

musicbrainz's Introduction

MuzicBrainz

Implementation MuzicBrainze API 2.0 (C#). Current version: 1.0.1

Build Status NuGet Issues

##Examples:

######Get Artist by Id.

 static void Main(string[] args)
 {
   var artist = Hqub.MusicBrainze.API.Entities.Artist.Get("c3cceeed-3332-4cf0-8c4c-bbde425147b6");

   Console.WriteLine(artist.Name);
 }

######Search artist by query.

 static void Main(string[] args)
 {
   var artists = Hqub.MusicBrainze.API.Entities.Artist.Search("scorpions");
   
   foreach(var artist in artists)
   {
      Console.WriteLine(artist.Name);
   }
   
   Console.ReadKey();
 }
Get Artist with Tags.
using Hqub.MusicBrainze.API.Entities;

static void Main(string[] args)
{
  var artist = Artist.Get("c3cceeed-3332-4cf0-8c4c-bbde425147b6", API.Entities.Include.ArtistIncludeEntityHelper.Tags);

  Console.WriteLine(artist.Name);
	
  foreach (var tag in artist.Tags)
  {
    Console.WriteLine("\t{0}", tag.Name);
  }

  Console.ReadKey();
}
Show Artist -> Album -> Tracks.
private static void Main(string[] args)
{
	try
	{
		var task = ShowAlbumTracks("The Rolling Stones", "Beggars Banquet");

		// The synchronous Wait() will wrap any exception in an AggregateException,
		// so be sure to catch it properly.
		task.Wait();
	}
	catch (AggregateException e)
	{
		Console.WriteLine(e.InnerException.Message);
	}

	Console.ReadKey();
}

private static async Task ShowAlbumTracks(string artistName, string albumName)
{
	var artist = (await Artist.SearchAsync(artistName)).First();

	Console.WriteLine(artist.Name);

	var query = string.Format("aid=({0}) release=({1})", artist.Id, albumName);
	var album = (await Release.SearchAsync(Uri.EscapeUriString(query), 10)).First();

	Console.WriteLine("\t{0}", album.Title);

	var release = await Release.GetAsync(album.Id, "recordings");

	int i = 1;

	foreach (var medium in release.MediumList)
	{
		foreach (var track in medium.Tracks)
		{
			var recording = track.Recordring;
			var length = TimeSpan.FromMilliseconds(recording.Length).ToString("m\\:ss");

			Console.WriteLine("\t\t{0,3:##} {1,6}  {2}", i++, length, recording.Title);
		}
	}
}

Also support next entities:

  • Release (Get, Search, Subqueries)
  • Recording (Get, Search, Subqueries)

More information about MuzicBrainz Service I here.

musicbrainz's People

Contributors

avatar29a avatar wo80 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.