Code Monkey home page Code Monkey logo

groovesdk's Introduction

Groove Music Service .NET Standard SDK

This repo contains a .NET Standard wrapper for the Groove Music Service REST API. This project is a porting of the same library I made available on NuGet some time ago (I've unpublished it). I decided to revive this side project since the service changed its name and a few other changes were made on the backed. I really like the service and I think that many app can benefit from using it.

Getting started

First thing you have to do is to register yor app and get a clientID and clientSecret code. You can do that by following this step by step how to. The SDK is able to handle authentication and automatic token refresh so basically you can forget about that. As the name of this project says, this library is a .NET Standard 1.4 library. The reason for that is because I wanted to make UWP apps able to use it. If you are not building an UWP app and you still wanna use this SDK take a look at this page to see if you can.

Backlog

Here's a list of stuff that still needs to be done from a release point of view

  • Publish a NuGet Package - NuGet Package
  • Set up the list of Up-For-Grabs

Features available

Here's a list of API endpoints that as of today are accessible with SDK:

Features not yet available

Here's a list of API endpoint that do are not accessible with this SDK:

Sample usage

Inside the .cs file "\groovesdk\test\GL.Sdk.Groove.Test\Program.cs" you can find some examples of usage. For those who are too lazy to browse to that file, here's a snippet of that file.

class Program
{
    static void Main(string[] args) => MainAsync(args).GetAwaiter().GetResult();

    static async Task MainAsync(string[] args)
    {
        var bastille_pompei = "music.8D6KGX7MCGQT";
        var m_client = new GrooveMusicClient(clientId: "", clientSecret: "");

        var search = await m_client.SearchAsync(keyword: "Bastille");
        var search_max = await m_client.SearchAsync(keyword: "Bastille", maxResults: 10);
        var search_filters = await m_client.SearchAsync(keyword: "Bastille", maxResults: 15, filters: new FilterType[] { FilterType.Tracks });
        var search_source = await m_client.SearchAsync(keyword: "Bastille", maxResults: 25, filters: new FilterType[] { FilterType.Tracks }, source: new SearchSource[] { SearchSource.Catalog });
        var continueSearch = await m_client.ContinueSearchAsync(search.Tracks.ContinuationToken);

        var lookup_ids = new string[] { bastille_pompei };
        var lookup = await m_client.LookupAsync(lookup_ids);
        var lookup_source = await m_client.LookupAsync(lookup_ids, new SearchSource[] { SearchSource.Catalog });
        var lookup_extra = await m_client.LookupAsync(lookup_ids, new SearchSource[] { SearchSource.Catalog }, new ExtrasParameters[] { ExtrasParameters.Albums });
        var continueLookup = await m_client.ContinueLookupAsync(lookup.Tracks.ContinuationToken, lookup_ids);

        var genres = await m_client.GetGenresAsync();
        var spotlight = await m_client.GetSpotlightAsync();
        var profile = await m_client.GetUserProfileAsync();

        var new_releases_all = await m_client.GetNewReleasesAsync();
        var new_releases = await m_client.GetNewReleasesAsync(genre: new GenreModel("Rock"));

        var preview_stream = await m_client.GetPreviewStreamAsync(songId: bastille_pompei, streamType: PlaybackType.Preview);
        var full_stream = await m_client.GetPreviewStreamAsync(songId: bastille_pompei, streamType: PlaybackType.Stream);

        var moods = await m_client.GetAvailableMoodsAsync();
        var activities = await m_client.GetAvailableActivitiesAsync();
    }
}

License & Contact

This project is distributed under MIT License. If you have any question or you'd like to get involved in the project write to [email protected]

groovesdk's People

Contributors

giancarlolelli 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.