GitXplorerGitXplorer
a

metadata-filter-service

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
abd2dd32849bad6a913dac8bd49be7f23dc1500e

Don't format package.json and package-lock.json files

aalexesprit committed 4 years ago
Unverified
25e6cdc7b38590dc58de3c43f8cb67b8a0aaff8b

Use unified script name to check formatting

aalexesprit committed 4 years ago
Unverified
de6decce4a07a70ab1f98558528a6483fbe279dd

Remove redundant query from URLs

aalexesprit committed 4 years ago
Unverified
64bf25a5696dcc033db9aac7a7c6ace70397da3a

Move type cast to another file

aalexesprit committed 4 years ago
Unverified
43c00f05c6f7a281cfb7b27c5557b54e23441b62

Simplify code

aalexesprit committed 4 years ago
Unverified
e3c277c34d22046185b146a4f7df38d21ef1517d

Lint all TS and JS files

aalexesprit committed 4 years ago

README

The README file for this repository.

metadata-filter-service

metadata-filter as a service.

Usage

An online instance is available at https://metadata-filter.vercel.app/.

API

The format of request URL is /api/:filter?query, where

  • filter is a name of any available filters
  • query is a filter query string containing fields to filter and their values

For example, query for filtering track field is track=TrackName. You can put multiple fields as well - join them with ampersand.

The response is a JSON in the following format:

interface SuccessResponse {
	status: 'success';
	data: {
		[field: string]: string;
	};
}

interface ErrorResponse {
	status: 'error';
	message: string;
}

Available filters

The service uses predefined filters from metadata-filter:

  • Amazon (/api/amazon)
  • Remastered (/api/remastered)
  • Spotify (/api/spotify)
  • Tidal (/api/tidal)
  • YouTube (/api/youtube)

Each filter can process different fields. See src/filters.ts of metadata-filter for details.

Example

For example, we want to filter "If I Get High (Official Video)" track name with YouTube filter.

Requesting /api/youtube?track=If%20I%20Get%20High%20(Official%20Video) will return a response with filter result in JSON format.

{
	"status": "success",
	"data": {
		"track": "If I Get High"
	}
}

Development

# Install dependencies
> npm install

# Run dev server
> npx vercel dev

# Run linter
> npm run lint

# Run tests
> npm test

# Format files
> npm run format

License

Licensed under the MIT License.