Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Nuget package #72

Merged
merged 5 commits into from
May 16, 2024
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
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
MusicBrainz
============
# MusicBrainz

[![Build Status](https://img.shields.io/github/actions/workflow/status/avatar29A/MusicBrainz/dotnet.yml?style=flat-square)](https://github.com/avatar29A/MusicBrainz/actions/workflows/dotnet.yml)
[![Issues](https://img.shields.io/github/issues/avatar29A/MusicBrainz.svg?style=flat-square)](https://github.com/avatar29A/MusicBrainz/issues)
Expand All @@ -11,18 +10,12 @@ Implementation of the [MusicBrainz](https://musicbrainz.org/) API version 2 for
## Features

- First class MusicBrainz entities `Artist`, `ReleaseGroup`, `Release` and `Recording` supporting asynchronous `Get` (lookup by MBID), `Search` and `Browse`.
- Advanced `Search` using Lucene query syntax (see [search documentation](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search) for supported fields).
- Advanced `Search` using Lucene query syntax (see [search documentation](https://musicbrainz.org/doc/MusicBrainz_API/Search) for supported fields).
- Support for sub-queries in lookup requests (see [MusicBrainz wiki](https://wiki.musicbrainz.org/User:Nikki/ws/2) for a list of supported `inc` parameters).
- Limited support for entity relationships.

More information about the MusicBrainz webservice can be found [here](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2).
More information about the MusicBrainz API can be found [here](https://musicbrainz.org/doc/MusicBrainz_API).

## Examples

Take a look at the [wiki](https://github.com/avatar29A/MusicBrainz/wiki) or the [Hqub.MusicBrainz.Client](https://github.com/avatar29A/MusicBrainz/tree/master/Hqub.MusicBrainz/Hqub.MusicBrainz.Client) example project.

## Breaking changes in v3

Version 3 removes all code that was marked obsolete in previous versions, specifically the static API and configuration. You should now use the [MusicBrainzClient](https://github.com/avatar29A/MusicBrainz/blob/master/src/Hqub.MusicBrainz/MusicBrainzClient.cs) class instead. Take a look at the wiki or the examples!

Additionally, the `.API` suffix was removed from the assembly and all namespaces. Fix the namespace change by removing the `.API` suffix in your using statements, for example `using Hqub.MusicBrainz.API` now becomes `using Hqub.MusicBrainz`. The name change of the assembly should be automatically picked up if you are using Nuget to manage package dependencies. Otherwise, you will have to manually fix the reference in your project files.
Take a look at the [wiki](https://github.com/avatar29A/MusicBrainz/wiki) or the [Hqub.MusicBrainz.Client](https://github.com/avatar29A/MusicBrainz/tree/master/src/Hqub.MusicBrainz.Client) example project.
Binary file added assets/brain-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/brain-128.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Source: https://www.iconsdb.com/tropical-blue-icons/brain-icon.html

The icon is provided as CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
16 changes: 16 additions & 0 deletions assets/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Hqub.MusicBrainz

Implementation of the [MusicBrainz](https://musicbrainz.org/) API version 2 for .NET

## Features

- First class MusicBrainz entities `Artist`, `ReleaseGroup`, `Release` and `Recording` supporting asynchronous `Get` (lookup by MBID), `Search` and `Browse`.
- Advanced `Search` using Lucene query syntax (see [search documentation](https://musicbrainz.org/doc/MusicBrainz_API/Search) for supported fields).
- Support for sub-queries in lookup requests (see [MusicBrainz wiki](https://wiki.musicbrainz.org/User:Nikki/ws/2) for a list of supported `inc` parameters).
- Limited support for entity relationships.

More information about the MusicBrainz API can be found [here](https://musicbrainz.org/doc/MusicBrainz_API).

## Examples

Take a look at the [wiki](https://github.com/avatar29A/MusicBrainz/wiki) or the [Hqub.MusicBrainz.Client](https://github.com/avatar29A/MusicBrainz/tree/master/src/Hqub.MusicBrainz.Client) example project.
4 changes: 0 additions & 4 deletions src/Hqub.MusicBrainz.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Hqub.MusicBrainz;
using System;
using System.IO;
using System.Net;
using System.Reflection;
using System.Threading.Tasks;

Expand Down Expand Up @@ -42,9 +41,6 @@ private static void Main(string[] args)

private static async Task RunExamples()
{
// Make sure that TLS 1.2 is available.
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;

// Get path for local file cache.
var location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

Expand Down
9 changes: 7 additions & 2 deletions src/Hqub.MusicBrainz/Entities/CoverArtArchive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,22 @@ public class CoverArtArchive
public int Count { get; set; }

/// <summary>
/// Gets or sets a value indicating whether a front crover is available or not.
/// Gets or sets a value indicating whether a front cover is available or not.
/// </summary>
[DataMember(Name = "front")]
public bool Front { get; set; }

/// <summary>
/// Gets or sets a value indicating whether a back crover is available or not.
/// Gets or sets a value indicating whether a back cover is available or not.
/// </summary>
[DataMember(Name = "back")]
public bool Back { get; set; }

/// <summary>
/// Gets the cover art uri.
/// </summary>
/// <param name="releaseId">The MBID of the release.</param>
/// <returns></returns>
public static Uri GetCoverArtUri(string releaseId)
{
string url = "https://coverartarchive.org/release/" + releaseId + "/front-250.jpg";
Expand Down
16 changes: 11 additions & 5 deletions src/Hqub.MusicBrainz/Hqub.MusicBrainz.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageId>MusicBrainzAPI</PackageId>
<Description>Implementation of the MuzicBrainz API v2.</Description>
<Description>Implementation of the MusicBrainz API v2.</Description>
<Product>Hqub.MusicBrainz</Product>
<Company>h-qub.ru</Company>
<Copyright>Copyright h-qub.ru © 2014-2024</Copyright>
<Authors>Boris Glebov, Christian Woltering</Authors>
<PackageProjectUrl>https://github.com/avatar29A/MusicBrainz</PackageProjectUrl>
<RepositoryUrl>https://github.com/avatar29A/MusicBrainz</RepositoryUrl>
<AssemblyVersion>3.1.0.0</AssemblyVersion>
<FileVersion>3.1.0.0</FileVersion>
<AssemblyVersion>3.1.1.0</AssemblyVersion>
<FileVersion>3.1.1.0</FileVersion>
<PackageTags>music musicbrainz brainz</PackageTags>
<Version>3.1.0</Version>
<Version>3.1.1</Version>
<AssemblyName>Hqub.MusicBrainz</AssemblyName>
<RootNamespace>Hqub.MusicBrainz</RootNamespace>
<Configurations>Debug;Release</Configurations>
<PackageIconUrl>http://rhythmsforliving.com/wp-content/uploads/2014/11/brain-256.png</PackageIconUrl>
<PackageIconUrl>https://raw.githubusercontent.com/avatar29A/MusicBrainz/master/assets/brain-128.png</PackageIconUrl>
<PackageIcon>brain-128.png</PackageIcon>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
Expand All @@ -38,4 +40,8 @@
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\assets\brain-128.png" Pack="true" PackagePath="\" />
<None Include="..\..\assets\readme.md" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Hqub.MusicBrainz/MusicBrainzClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@
[DataContract]
class ResponseError
{
/// <summary>The error message.</summary>
[DataMember(Name = "error")]
public string Message;

Check warning on line 128 in src/Hqub.MusicBrainz/MusicBrainzClient.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

Field 'MusicBrainzClient.ResponseError.Message' is never assigned to, and will always have its default value null

Check warning on line 128 in src/Hqub.MusicBrainz/MusicBrainzClient.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

Field 'MusicBrainzClient.ResponseError.Message' is never assigned to, and will always have its default value null

Check warning on line 128 in src/Hqub.MusicBrainz/MusicBrainzClient.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

Field 'MusicBrainzClient.ResponseError.Message' is never assigned to, and will always have its default value null

Check warning on line 128 in src/Hqub.MusicBrainz/MusicBrainzClient.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

Field 'MusicBrainzClient.ResponseError.Message' is never assigned to, and will always have its default value null
}

internal async Task<T> GetAsync<T>(string url, CancellationToken ct = default)
Expand Down
2 changes: 1 addition & 1 deletion src/Hqub.MusicBrainz/QueryParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public QueryParameters()
}

/// <summary>
/// Add a field to the query paramaters.
/// Add a field to the query parameters.
/// </summary>
/// <param name="key">The field key.</param>
/// <param name="value">The field value.</param>
Expand Down
2 changes: 1 addition & 1 deletion src/Hqub.MusicBrainz/UrlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private bool ValidateBrowseParam(string availableParams, string value)
{
if (string.IsNullOrEmpty(value))
{
return true; // Irgnore, if no value specified.
return true; // Ignore, if no value specified.
}

if (value.IndexOf('|') > 0)
Expand Down