Commit graph

521 commits

Author SHA1 Message Date
Fabrice Laporte
a64d277bae Merge branch 'master' of https://github.com/sampsyo/beets 2013-06-12 00:09:44 +02:00
Fabrice Laporte
b3747189e5 lyrics: google backend should turn up more results
bs4 scraping routine has been made more generic,
relying less on specific markup tags.
Better algorithm to detect which url titles match
song titles: domain names are now removed from url
titles.
Use regex to decimate \n in fetched lyrics.
2013-06-12 00:07:01 +02:00
Adrian Sampson
2f053b0ecd scrub: handle IOError
Mutagen can raise this error when trying to truncate a file.
2013-06-10 16:06:43 -07:00
Adrian Sampson
f6faf72328 move Distance class to hooks module 2013-06-10 15:21:32 -07:00
Fabrice Laporte
7f62db7327 Merge branch 'master' of https://github.com/sampsyo/beets 2013-06-08 16:36:56 +02:00
Adrian Sampson
d1ebe423c9 changelog/thanks/style for #319 2013-06-07 20:53:53 -07:00
Timothy Appnel
847edcd6cc Fix bug where a null value for lengthMS would crash an import. Added a fallback to parse the standard min:sec length field. 2013-06-07 23:43:21 -04:00
Tai Lee
42efd2a761 Change log for #316 and code style tweaks. 2013-06-08 00:32:40 +10:00
Wessie
0009c51577 Made formatting strings compatible with python 2.6
Also fixed styling according to pep8
2013-06-07 15:58:36 +02:00
Adrian Sampson
fa40fd9108 beatport: use new Distance objects (#302)
This also brought to light the fact that the distance calculations for tracks
was incorrect because there's no source field on TrackInfo objects yet. This
needs to be fixed.
2013-06-06 10:34:20 -07:00
Tai Lee
4cfd1a874f Merge branch 'master' of github.com:sampsyo/beets into distance-refactor
Conflicts:
	beets/autotag/match.py
	beets/config_default.yaml
	docs/changelog.rst
	docs/reference/config.rst
2013-06-06 23:28:25 +10:00
Tai Lee
898254ed6a Merge branch 'master' into distance-refactor
Conflicts:
	docs/changelog.rst
2013-06-06 11:09:36 +10:00
John Hawthorn
1bf8ae0a01 mpdupdate: Allow UNIX domain socket for MPD server
If the host configuration begins with a '/', it is assumed to reference
a UNIX domain socket. This is similar to libmpdclient's behaviour.
2013-06-05 13:20:27 -07:00
Adrian Sampson
dfda5a311d beatport (#301): more Unicode literals
Avoids warnings in the unidecode module.
2013-06-03 14:06:51 -07:00
Adrian Sampson
dc75935b89 Merge pull request #301 from jbaiter/beatport
Plugin for Beatport Metadata in Autotagger
2013-06-03 13:53:05 -07:00
Johannes Baiter
edd0efcb87 Fix unicode bug in Beatport plugin 2013-06-03 17:22:29 +02:00
Fabrice Laporte
09e721efe6 rename "section" markup 2013-06-02 22:35:36 +02:00
Johannes Baiter
f2a924fb56 Bugfixes in Beatport plugin 2013-06-02 11:55:44 +02:00
Tai Lee
e6ac8e1646 Use a Distance object instead of floats for distance calculations.
The new Distance object knows how to perform various types of distance
calculations (expression, equality, number, priority, string).

It will keep track of each individual penalty that has been applied so
that we can utilise that information in the UI and when making decisions
about the recommendation level.

We now display the top 3 penalties (sorted by weight) on the release
list (and "..." if there are more than 3), and we display all penalties
on the album info line and track change line.

The implementation of the `max_rec` setting has been simplified by
removing duplicate validation and instead looking at the penalties that
have been applied to a distance. As a result, we can now configure a
maximum recommendation for any penalty that might be applied.

We have a few new checks when calculating album distance:

`match: preferred: countries` and `match: preferred: media` can each be
set to a list of countries and media in order of your preference. These
are empty by default. A value that matches the first item will have no
penalty, and a value that doesn't match any item will have an unweighted
penalty of 1.0.

If `match: preferred: original_year` is set to "yes", beets will apply
an unweighted penalty of 1.0 for each year of difference between the
release year and the original year.

We now configure individual weights for `mediums` (disctotal), `label`,
`catalognum`, `country` and `albumdisambig` instead of a single generic
`minor` weight. This gives more control, but more importantly separates
and names the applied penalties so that the UI can convey exactly which
fields have contributed to the overall distance penalty.

Likewise, `missing tracks` and `unmatched tracks` are penalised and
displayed in the UI separately, instead of a combined `partial` penalty.

Display non-MusicBrainz source in the disambiguation string, and
"source" in the list of penalties if a release is penalised for being
a non-MusicBrainz.
2013-06-02 18:25:10 +10:00
Adrian Sampson
9a6b6240d0 zero: fix nulling fields containing None 2013-06-01 17:28:59 -07:00
Adrian Sampson
4624f65ce3 fix interface to ID matching
As outlined in #299, we broke many places in the code that were expecting
_album_for_id and _track_for_id to return a single item rather than a list. I
took this opportunity to divide up the interface: there's now one function for
MBIDs (returning a single object or None) and one for generic IDs (returning a
list).
2013-06-01 17:22:39 -07:00
Johannes Baiter
eb20d77c69 Implement BeetsPlugin API for Beatport plugin 2013-06-01 18:45:54 +02:00
Johannes Baiter
bbd50c65cd Fix Beatport source weight 2013-06-01 15:50:59 +02:00
Johannes Baiter
af81b67c0c Implement Beatport API wrapper 2013-06-01 15:23:18 +02:00
Johannes Baiter
1a8f54fd51 Lay out beatport plugin based on discogs plugin 2013-06-01 15:20:58 +02:00
Adrian Sampson
18bbe9f645 Merge pull request #298 from jayme-github/python26-resub
Fix Python 2.6 compatibility
2013-05-30 09:48:50 -07:00
Tai Lee
ee0c00708b Quick fix for a couple other places that were expecting hooks._album_for_id()` to return a single result.
It's possible that these plugins might require a little more thought
into how they should work (or not work) with potentially multiple albums
matching an idea, and potentially those those albums being an incorrect
match (e.g. if two data source plugins share a simple numerical ID
format).
2013-05-31 00:05:24 +10:00
Jayme
5bb0881cdd Replace two more flag arguments 2013-05-30 10:09:39 +02:00
Jayme
32e1c13510 Fix Python 2.6 compatibility 2013-05-30 09:30:00 +02:00
Adrian Sampson
303cd9ba00 Merge pull request #291 from jbaiter/discogs_albumid
Support for manually entered IDs in plugins
2013-05-29 14:43:59 -07:00
Johannes Baiter
3df635eca2 Make regex for Discogs ID more specific 2013-05-29 20:31:58 +02:00
Johannes Baiter
2d4ea4e49b Fix bug in discogs.album_for_id for ID-Strings that end in a bracket 2013-05-29 10:59:04 +02:00
Johannes Baiter
40a6e03ba6 Improve regular expression for Discogs IDs 2013-05-29 10:54:15 +02:00
Adrian Sampson
3b438b7778 inline: rename "pathfields" to "item_fields" 2013-05-28 23:20:19 -07:00
Adrian Sampson
0176e10ccf inline: allow album field definitions
Under the album_field heading.
2013-05-28 23:10:47 -07:00
Adrian Sampson
a0cb31956d distinguish Album and Item template fields
An earlier change (due to @pedros) added the ability for plugins to define
template fields that work with Albums as well as Items. This enables some
cool new use cases but required that every template field definition check the
type of its arguments. Instead, this iteration on the idea distinguishes
between fields meant for Items and those meant for Albums.

In addition to simplifying the implementation of these functions, this also
enables the creation of album fields with identical names to item fields.
(For example, a user contacted me recently about adding a $bitrate field for
albums, which would be the average bitrate of the items. They can do this now
using a plugin.)

I also changed the docs to stop using the decorator approach to registering
template fields. We're moving toward removing those.
2013-05-28 22:30:23 -07:00
Adrian Sampson
9f927438ca fix some dumb mistakes from most recent flurry 2013-05-28 22:04:20 -07:00
Adrian Sampson
72449caccf discogs: move config default into constructor
Such is the new convention for plugin configuratino defaults.
2013-05-28 21:45:31 -07:00
Adrian Sampson
480fa80e47 discogs: penalty only for matches from discogs
Otherwise, this was penalizing all album matches.

This also applies the same treatment as the previous commit: only load the
config at run time (at the expense of code clutter).
2013-05-28 21:25:28 -07:00
Johannes Baiter
f17e8550ca Determine IDs from MusicBrainz and Discogs URLs 2013-05-28 13:49:34 +02:00
Johannes Baiter
e3418be75d Add support for manually entered release ID in Discogs 2013-05-28 12:58:05 +02:00
Tai Lee
35e926a51b Add Discogs and general source weight penalty (configurable, undocumented).
Discogs (and other individual plugins) should return a penalty between
0.0 and 0.1, which will be multiplied by the general source weight. This
allows individual plugins to be weighted against relative to each other,
and amplified together against other penalty categories (track, title,
etc.)
2013-05-27 01:28:40 +10:00
Tai Lee
a6b1bb1bbc Move articles to the front of Discogs artist names. 2013-05-25 14:05:03 +10:00
Tai Lee
e3fa403ad2 Only execute pathfields expressions and functions if they are called with an Item argument. Otherwise, return an empty string. 2013-05-25 12:28:52 +10:00
Tai Lee
3f4e194c41 We only need to strip the disambiguation from artist names, not the join strings. 2013-05-25 12:19:48 +10:00
Adrian Sampson
72f0505744 discogs: extra space in ambiguous artists (#289) 2013-05-24 12:31:18 -07:00
Adrian Sampson
d877f5e3e8 Merge pull request #289 from Smyds/master
Remove discogs artist disambiguation number
2013-05-24 12:28:50 -07:00
César Prouté
726c84674b remove discogs artist disambiguation number 2013-05-24 20:15:24 +01:00
Tai Lee
835a3c2a73 Improved parsing of Discogs' position field.
Some albums have a single disc with positions like I, II, III, IV, etc.
Previously beets thought each track on these albums was a new medium.

Now we assume that if there is no explicit medium index and the ordinal
of an alpha medium does not appear to be sequential (e.g. A, B, C) that
the medium is actually the medium index.
2013-05-25 01:36:12 +10:00
Tai Lee
4c06c96630 Extract disc titles from Discogs' "index tracks". 2013-05-25 01:32:06 +10:00