Commit graph

330 commits

Author SHA1 Message Date
Adrian Sampson
1253cb695d move show_model_changes to ui package
This makes it more naturally reusable for plugins.
2014-02-22 15:06:16 -08:00
Adrian Sampson
645279e022 remove old _showdiff
Totally replaced now, including tests! Woohoo.
2014-02-22 14:52:33 -08:00
Adrian Sampson
ace34a8654 _show_model_changes: silence by default
This lets the first line of output be suppressed (as it was previously in
update and write) when no changes at all need to be printed.
2014-02-22 14:32:34 -08:00
Adrian Sampson
1413a842f7 update: restore "deleted" indication 2014-02-22 00:51:05 -05:00
Adrian Sampson
e42fcd973c use _show_model_change in update 2014-02-22 00:41:28 -05:00
Adrian Sampson
f6c19adc55 use _show_model_changes for write command 2014-02-22 00:24:43 -05:00
Adrian Sampson
8303c71b38 robust difference display for modify
This new alternative to _showdiff takes care of formatting and is better at
highlighting differences for non-string fields. This takes care of the issue
where "True -> False" would have everything but the "e" highlighted.
2014-02-22 00:14:18 -05:00
Adrian Sampson
a2075d31e5 modify: use formatted values in _showdiff()
Perhaps we should use this for other commands also. One outstanding issue is
strange highlighting (e.g., "True -> False" helpfully shows that the "e" did
not change).
2014-02-13 21:33:58 -08:00
Adrian Sampson
be31ac683a Model._parse() class method 2014-02-13 21:29:17 -08:00
Adrian Sampson
b1d70eee39 modify: remove special parsing logic
This could be nicer, but at least we now use standard type-based parsing.
2014-02-13 21:22:23 -08:00
Adrian Sampson
cb783d11c3 style and changelog for #525 2014-02-04 23:19:34 -08:00
Bruno Tournay
1f46ff4604 In beet modify: don't ask for confirmation if there is nothing to do 2014-02-03 22:17:57 +01:00
Thomas Scholtes
6a872ae560 Add --group-albums cli option 2014-02-01 15:36:11 +01:00
Thomas Scholtes
736835ce72 Rename as aLbums option (#518) 2014-02-01 12:56:17 +01:00
Adrian Sampson
5a35d93b22 tiny option-choosing fixes for #518
* 'L' check needs to be lower-case
* letter for 'More candidates' is M, not C
2014-01-31 16:57:07 -08:00
Thomas Scholtes
af522e2416 Use L as shortcut 2014-01-28 23:37:05 +01:00
Thomas Scholtes
d12a4b20da Import multiple albums from single directory
If a directory contains multiple albums we can select the ALBUMS action to group
the tracks by album artist and album name and import those seperately.
2014-01-28 23:22:00 +01:00
Adrian Sampson
8ca997bd36 avoid repeating diff check, use changed set (#511)
This way, _showdiff returns the information that _different used to provide
(since _showdiff needs to calculate it anyway). Using a `changed` set also
makes it easier to avoid unnecessary work.
2014-01-28 09:46:53 -08:00
Bruno Tournay
68bb0ca5ee Removed duplicated code: modified showdiff() so it uses also different() 2014-01-28 14:21:45 +01:00
Bruno Tournay
e7c8b16480 Removed dont_write_if_unchanged config option: now files tags are never updated unless db tags are changed (with beet modify) 2014-01-28 14:00:51 +01:00
Bruno Tournay
0889052831 Added option for not writing tags to file, when tags in db are not modified when running beet modify 2014-01-27 22:05:55 +01:00
Thomas Scholtes
1f53b658bb Use default beets logger 2014-01-20 19:25:55 +01:00
Adrian Sampson
a9faa9bf74 restore correct formatting of paths
- don't sanitize paths (this is already done separately)
- album.path (or album['path']) is now an alias for album.item_dir(), which
  restores the formatting of $path in templates
2013-12-25 00:00:12 -08:00
Adrian Sampson
314438b8fa slightly simpler "write" command (#328, #448) 2013-11-25 15:26:11 -08:00
Heinz Wiesinger
d1a7408ecf Add raw version of a write command. 2013-11-06 21:39:12 +01:00
Adrian Sampson
733c633674 clean up some string formatting 2013-10-06 10:07:28 -07:00
Adrian Sampson
6d07b7e4b5 use _dirty.discard, not _dirty.remove
In the case where the field has not actually changed, don't throw a KeyError;
just proceed silently.
2013-10-06 10:03:24 -07:00
Adrian Sampson
25b77b1518 per_disc_numbering: fix tracktotal (close #163) 2013-09-21 19:12:18 -07:00
Adrian Sampson
22d5e564c6 move move method to model objects 2013-09-16 22:12:26 -07:00
Adrian Sampson
76b1ee434e move remove method to model objects
--HG--
extra : amend_source : 31d3ccbdde816b82bb5ec943ecb870e0df699dd0
2013-09-16 21:30:55 -07:00
Adrian Sampson
267f5a9be1 link to new FAQ location 2013-09-16 20:17:03 -07:00
Adrian Sampson
c7fe017752 remove Library.{move,store} methods
These methods are now provided by LibModel, which makes dealing with items and
albums symmetric.
2013-08-21 15:34:45 -07:00
Adrian Sampson
deef7f9d20 a few more necessary album.store()s 2013-08-21 11:23:09 -07:00
Adrian Sampson
6677cea036 fix uses of item.dirty and item.record 2013-08-21 10:57:52 -07:00
Adrian Sampson
276ce14dd2 flexattrs work for Albums
A second base class, LibModel, maintains a reference to the Library and should
take care of database-related tasks like load and store. This is the beginning
of the end of the terrible incongruity between Item and Album objects (only
the latter had a library reference). More refactoring to come.

One large side effect: Album objects no longer automatically store
modifications. You have to call album.store(). Several places in the code
assume otherwise; they need cleaning up.

ResultIterator is now polymorphic (it takes a type parameter, which must be a
subclass of LibModel).
2013-08-16 18:36:30 -07:00
Adrian Sampson
1a0d9c507d drop flexattr namespaces
Namespaces were a worthy idea, but they added a lot of complexity to both the
library code itself and every client of the flexattrs interfaces. Getting rid
of them, and having one flat namespace of both traditional fields and
flexattrs, has one huge benefit: we can "promote" flexattrs to real attributes
(and vice versa) without code changes in every client.

This frees us to have a somewhat less efficient implementation of flexattrs
because we have a smooth upgrade path for making attributes more efficient via
promotion.
2013-08-16 11:18:05 -07:00
Adrian Sampson
3b9b39e5c9 merge with master 2013-08-15 18:14:33 -07:00
Adrian Sampson
d32e13a63e show data URL for track matches
That should be the last one.
2013-06-12 16:42:15 -07:00
Adrian Sampson
829626d757 show penalties/disambig in track listing
This is the second step in bringing parity between the album and item
displays. Fortunately, we get to reuse most of the code.
2013-06-12 16:39:43 -07:00
Adrian Sampson
94aebd6bca show penalties and disambig for tracks
This makes the UI for track match display match that for album display.
2013-06-12 16:31:42 -07:00
Adrian Sampson
7983c94ef8 add keys() method to Distance 2013-06-10 15:40:51 -07:00
Adrian Sampson
c818663539 replace Distance.sorted() with .items()
This is an effort to make the distance object feel slightly more dict-like.
The name changed and order of tuples is reversed: we now yield (key, value)
instead of (value, key), which I think is a little more intuitive.
2013-06-10 15:31:25 -07: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
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
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
809ea8c7f9 Exclude zero value penalties from Distance.sorted. 2013-06-03 00:20:19 +10:00
Tai Lee
f6492e68ee Doc string update. 2013-06-02 23:16:28 +10: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