2.1.0 • Published 5 years ago

album-cleantag v2.1.0

Weekly downloads
4
License
GPL-3.0-or-later
Repository
github
Last release
5 years ago

Album CleanTag

CleanTag is an npm/python module that uses regex to remove common unnecessary words from album and song tags, such as '(remastered)', 'deluxe edition', etc.

This can be used to help make Last.fm scrobbling and library management more organized.

Pattern Matching

The program looks at the input string and detects any common unnecessary words (red flags) that are in the suffix of the string, formatted as such:

The "red flags" it searches for include: 'anniversary', 'bonus', 'deluxe', 'edition', 'expanded', 'explicit', 'reissue', 'remaster', 'version'. If a suffix contains one or more of these, the entire suffix is deleted.

For example, if you give it Swans - Filth (Deluxe Version), it will return Swans - Filth.

Usage

Node

Install using npm:

npm i album-cleantag
const cleantag = require('album-cleantag');

let albumName = 'Godflesh - Post Self (Remastered)';
albumName = cleantag.clean(albumName);

console.log(albumName); // Godflesh - Post Self

Python

Python users can download the cleantag.py file and use it in your code:

import cleantag

print(cleantag.clean('Yeezus (Explicit Version)')) # Yeezus

Options

The options object can be passed to the second parameter. It can contain the following parameters:

const options = {
    addRedFlags: // add red flags to the list
    excludeRedFlags: // remove red flags from the list
    customRedFlags: // replace my red flags with your own list (don't use with the other two options)
}

cleantag.clean(albumName, options);
2.1.0

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.5.0

5 years ago