Commit graph

6487 commits

Author SHA1 Message Date
Tai Lee
c1ebae83bc Decouple color_diff() UI function from string_dist() matcher function.
These are separate issues. We're still colorising case changes in light gray
because these characters are effectively equivalent, but symbol and
transliteration edits will continue to be colorised in red.
2013-06-06 10:44:24 +10:00
Tai Lee
5ce996df0d Revert "Don't bypass candidate selection in timid mode. Always show all candidates."
This reverts commit b02974f68f.
2013-06-06 10:18:01 +10:00
Tai Lee
ea1becfea1 Add Distance.__iter__() and Distance.__len__(), for convenience. 2013-06-06 09:51:17 +10:00
Adrian Sampson
9542a292ed write more connective text in changelog 2013-06-05 15:51:19 -07:00
Adrian Sampson
7fca25fba6 1.1.1 -> 1.2.0 2013-06-05 15:21:43 -07:00
Adrian Sampson
1364e6ba37 organize 1.1.1 changelog into sections 2013-06-05 15:20:36 -07: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
975f5bd818 changelog/doc links for Beatport plugin (#301) 2013-06-03 14:01:16 -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
Adrian Sampson
4e016f1913 fix MediaFile exception test 2013-06-03 13:39:52 -07:00
Adrian Sampson
c276cfecc9 mediafile: pass through base IOErrors
This also tries to be a bit more thorough about capturing all the
Mutagen-originated exceptions.
2013-06-03 12:11:28 -07:00
Adrian Sampson
e093d76e21 handle FLACVorbisError exceptions from Mutagen 2013-06-03 12:01:06 -07:00
Adrian Sampson
7c430a791c possibly fix error for some Mutagen exceptions 2013-06-03 10:06:54 -07:00
Johannes Baiter
edd0efcb87 Fix unicode bug in Beatport plugin 2013-06-03 17:22:29 +02:00
Tai Lee
e92b8bb8fb Fix add_priority() calculation.
We were incorrectly adding 1 to the length of options to avoid a divide
by zero, when we should instead default the length to 1. Otherwise we
skew the penalty towards zero.
2013-06-03 14:49:39 +10:00
Tai Lee
0c27d275f3 Improve preferred media/country and original year distance calculation.
Check only preferred media/country, if specified. Don't apply penalty
for preferred AND tagged mismatch.

Assume original year is 1889 (first gramophone discs) when we don't
know the original year.

Allow single values to be specified in configuration, instead of
requiring a list (e.g. use `as_str_seq()`).
2013-06-03 14:31:53 +10:00
Tai Lee
c12abb74ab Look at track penalties as well when downgrading recommendations for albums. 2013-06-03 12:49:55 +10:00
Adrian Sampson
5904959b8a item templates now expand all fields
A user noticed that $id wasn't being expanded. There's no good reason for
that.
2013-06-02 16:49:10 -07:00
Fabrice Laporte
09e721efe6 rename "section" markup 2013-06-02 22:35:36 +02:00
Tai Lee
b02974f68f Don't bypass candidate selection in timid mode. Always show all candidates.
Saves paranoid and interested users from having to either force all max
recommendations to none or constantly go back to candidate selection
from a recommendation to see if there is another slightly less similar
but more preferred (by the user) candidate.
2013-06-03 01:20:32 +10:00
Tai Lee
2c175faa46 Colorise no-penalty text differences in a secondary colour, light grey. 2013-06-03 01:08:35 +10:00
Tai Lee
461c3c047c Colour benign track index changes in light gray, consistent with non-penalty supplementary information. 2013-06-03 00:46:40 +10:00
Tai Lee
ad52ede736 Code style. Use "_" when expanding variables we don't need. 2013-06-03 00:36:01 +10:00
Tai Lee
f3545860da Add ignored setting. Don't show matches with specified penalties applied, e.g. missing tracks or unmatched tracks.
If you know you never want these, they can clutter up the interface
especially now that we have multiple data sources.
2013-06-03 00:35:32 +10:00
Tai Lee
45dc99f1a9 Group preferred media patterns, in case they contain "|" to keep them separate from the number of media. 2013-06-03 00:25:31 +10:00
Tai Lee
809ea8c7f9 Exclude zero value penalties from Distance.sorted. 2013-06-03 00:20:19 +10:00
Tai Lee
ac4e86981f Add Distance.raw_distance, to compliment max_distance. 2013-06-03 00:07:20 +10:00
Tai Lee
51f40d26dc Rename Distance.penalties to Distance._penalties. It should be private. 2013-06-03 00:04:45 +10:00
Tai Lee
f6492e68ee Doc string update. 2013-06-02 23:16:28 +10:00
Tai Lee
1b5d3c057f Code style. 2013-06-02 22:54:48 +10:00
Tai Lee
3254f2f3b0 Don't assume all releases know the original year. Use add_ratio() if they do, otherwise apply full penalty with add(). 2013-06-02 22:53:53 +10:00
Tai Lee
083575314d Remove redundant max/min calculations for track length distance. add_ratio() already does this. 2013-06-02 22:31:28 +10:00
Tai Lee
4de5d36b71 Use add_ratio() for year penalties, with the difference between now and the original year as the max. 2013-06-02 22:29:48 +10:00
Johannes Baiter
6c3e38863b Add documentation for Beatport plugin 2013-06-02 11:55:57 +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
cff06431cc add tests for ALAC (#295) 2013-06-01 17:44:21 -07:00
Adrian Sampson
3a715a6703 changelog/thanks for ALAC (#295) 2013-06-01 17:33:06 -07:00
Adrian Sampson
d8a39b6725 merge 2013-06-01 17:30:30 -07:00
Adrian Sampson
3e95c52db8 Merge pull request #295 from simonluijk/alac-support
Initial support for ALAC encoded audio files
2013-06-01 17:29:49 -07: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
Tai Lee
0a448a2380 Display album disambiguation information in order of common importance. Media, year, country, label, albumdisambig. 2013-05-30 23:28:33 +10:00