Thomas Scholtes
117a331091
Should infer *album artist* for albums from tag
2014-01-28 15:42:50 +01:00
Adrian Sampson
f29fbe47da
DBCore types: no functional-style Type constructor
...
This was getting more and more awkward. Also added a `parse` method (in
progress).
2014-01-26 21:12:48 -08:00
Adrian Sampson
83f981762c
fix #508 : crash when parsing empty query part
...
This is a regression created by my endeavor to have parse_query_part never
return None. Now the regular expression should really always match.
2014-01-26 10:51:58 -08:00
Adrian Sampson
f1a4ba815d
fix #503 : format untyped fields with bytes values
2014-01-23 15:06:24 -08:00
Thomas Scholtes
00e0664a94
Merge branch 'embedded_items_generators'
2014-01-22 12:04:41 +01:00
Adrian Sampson
7361e6b114
adjust tests to type-based formatting
2014-01-21 21:16:32 -08:00
Adrian Sampson
7aa4d1e5ba
begin type-based formatting
2014-01-21 21:02:40 -08:00
Adrian Sampson
342d5e1f8b
whitespace cleanup
2014-01-21 20:14:36 -08:00
Adrian Sampson
7d0dbf705a
fix tests for dbcore module reorg
2014-01-21 20:04:29 -08:00
Adrian Sampson
56bb642fe8
undo dumb file renaming mistake
2014-01-21 19:40:00 -08:00
Adrian Sampson
74d0dc8352
further paramaterize parse_query_part
2014-01-21 19:09:34 -08:00
Thomas Scholtes
aa07eb9551
Load development beetsplug in tests
...
See also a4b6976755
2014-01-21 22:45:51 +01:00
Thomas Scholtes
83e86241b8
Add JSON-API tests
2014-01-21 22:39:48 +01:00
Adrian Sampson
28d4b9320c
Merge pull request #499 from geigerzaehler/master
...
Make pluginpath configuration useable
2014-01-20 18:55:20 -08:00
Adrian Sampson
1cdb30fd56
remove superfluous py_type field from Type
2014-01-20 18:06:42 -08:00
Adrian Sampson
00829c1a6c
use PathQueries declaratively
...
Now PathQuery is just another type-based query, just like NumericQuery.
2014-01-20 18:01:29 -08:00
Adrian Sampson
4026c4b707
add query field to types
...
This is starting to get at the heart of the matter: now each type gets to
declare which Query subclass it wants to use, starting with NumericQuery.
2014-01-20 17:47:02 -08:00
Adrian Sampson
9ee4adc5e1
move remaining generic Query types to dbcore.query
...
NumericQuery is still broken. This, of course, is the whole reason for the
change.
2014-01-20 16:40:50 -08:00
Adrian Sampson
61b6f04036
tests: silence logging output
2014-01-20 15:58:33 -08:00
Thomas Scholtes
a4b6976755
Make plugin path configuration useable
2014-01-20 17:39:46 +01:00
Thomas Scholtes
3b39e0f193
Test plugin commands from plugin paths
2014-01-20 17:39:46 +01:00
Thomas Scholtes
34f113bbcf
Running ./setup.py test works again
2014-01-20 14:33:40 +01:00
Adrian Sampson
a0ffde7114
a bit more dbcore testing
2014-01-18 16:49:22 -08:00
Adrian Sampson
dcee7b6219
dbcore: terminology
...
Replace "library" and "lib" references in dbcore with "database" and "db" for
short.
2014-01-18 16:36:04 -08:00
Adrian Sampson
236de2be86
give test_db a better name: test_library
2014-01-18 16:28:17 -08:00
Adrian Sampson
72a1b9bafb
add tests for dbcore
...
Based on the old migration tests for Library.
2014-01-18 16:27:43 -08:00
Adrian Sampson
faa66dba0d
dbcore: subsume schema setup, add Type class
...
Type will also include fields for parsing, emitting, and querying a given
type.
2014-01-13 17:11:50 -08:00
Adrian Sampson
a9ef11c311
begin database refactor: move Model to new module
2014-01-13 14:37:04 -08:00
Adrian Sampson
cc5e3d489c
item templates can use album flexattrs ( fix #461 )
2013-12-25 15:49:51 -08:00
Adrian Sampson
925a6178ba
expunge pathmod parameter
...
I started using this a long time ago as a misguided attempt to make
path-related functions more testable. Harnessing is better.
2013-12-25 00:35:01 -08:00
Adrian Sampson
d6ff4308f9
fix tests for new path formatting
...
Slowly expunging the terrible idea that was `pathmod`...
2013-12-25 00:28:26 -08:00
Adrian Sampson
a9b4169ee2
zero out month & day when missing from match
2013-12-18 16:20:40 -08:00
Mathijs de Bruin
2bab3135b3
Fix for #411 : iHate fails with singletons.
2013-11-07 13:57:25 +01:00
Adrian Sampson
24227d6ef4
mediafile: optionally save ID3v2.3 tags
2013-10-06 19:53:34 -07:00
Adrian Sampson
787918fdc3
changelog, tests, slight reorg for #187
2013-09-30 11:13:13 -07:00
Adrian Sampson
98bfbad089
test_query: use base test classes
2013-09-23 15:09:39 -07:00
Adrian Sampson
5007d1571f
merge disk and memory query tests
2013-09-23 15:05:47 -07:00
Adrian Sampson
4d0db3fcb4
tests: obviate on-disk test library
2013-09-23 10:57:17 -07:00
Adrian Sampson
9993993cab
add base class to DB tests
2013-09-22 17:15:47 -07:00
Adrian Sampson
25b77b1518
per_disc_numbering: fix tracktotal ( close #163 )
2013-09-21 19:12:18 -07:00
Adrian Sampson
dd8c667ce9
remove magic strings from Library.__init___
...
We now pull the table names from the models.
2013-09-17 09:13:56 -07:00
Adrian Sampson
c5032f925e
move Destination method to Item class
2013-09-17 09:09:10 -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
a5422eeaf7
use track length over recording length
...
Closes #341 . Also, 666 tests! Woohoo!
--HG--
extra : amend_source : f00626f20e2475edcf220772223080ef62f46d84
2013-09-16 17:35:22 -07:00
Adrian Sampson
bbac4ba109
numeric query tests
2013-09-16 17:19:40 -07:00
Adrian Sampson
6857267cc7
opus: remove image from test file
...
The encoder that produced this file for some reason included an empty image as
the cover art and was confusing the tests.
I left the null check in place to deal with this situation in the future. I
think returning None is better than returning the empty string (which is of
course not a valid image).
2013-09-12 10:16:47 -07:00
Adrian Sampson
8dc1e223e9
opus: sample rate is always 48kHz
2013-09-12 10:05:22 -07:00
Rowan Lewis
be8325dfe5
Opus now passes basic tests.
2013-09-12 08:00:28 +10:00
Rowan Lewis
6f0261e5ff
Added opus support, maybe.
2013-09-12 07:17:32 +10: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
0176b9742f
tests: unknown fields silently match nothing
...
Previously, an unknown field would be ignored. Now, they're treated as
flexattrs that just haven't been set yet (and thus always hold None).
2013-08-21 09:46:30 -07:00
Adrian Sampson
9e61e49457
fix NumericQuery constructor
2013-08-21 09:42:16 -07:00
Adrian Sampson
9609e41cf8
store albums after moving art
2013-08-21 09:25:47 -07:00
Adrian Sampson
8bcbe1dea2
fix outdated SQL query
2013-08-20 16:22:24 -07:00
Adrian Sampson
8bdf2d0efe
fix dirtying when unchanged, artpath wrapping
...
Also some naming mistakes.
2013-08-20 16:05:45 -07:00
Adrian Sampson
4d20d3b296
album.store() now also affects tracks
2013-08-20 15:32:27 -07:00
Adrian Sampson
ec10f8c223
remove count() calls
...
I removed this method in an earlier commit.
2013-08-20 14:28:28 -07:00
Adrian Sampson
c1b66105dd
fix regex (and other) queries in path field
2013-08-04 13:12:25 -07:00
Adrian Sampson
b1ea90a724
don't duplicate penalty names in max_rec section
...
This is for maintanability: in the future, when we add new distance penalty
components, now we won't have to list them twice in the default config.
2013-06-10 15:59:41 -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
Adrian Sampson
c85e43ee2a
finish removing setUp from DistanceTest
...
I had to do this for the tests that use the config, so I thought I might as
well finish the job.
2013-06-10 15:24:25 -07:00
Adrian Sampson
f6faf72328
move Distance class to hooks module
2013-06-10 15:21:32 -07:00
Tai Lee
898254ed6a
Merge branch 'master' into distance-refactor
...
Conflicts:
docs/changelog.rst
2013-06-06 11:09:36 +10:00
Tai Lee
ea1becfea1
Add Distance.__iter__() and Distance.__len__(), for convenience.
2013-06-06 09:51:17 +10:00
Adrian Sampson
4e016f1913
fix MediaFile exception test
2013-06-03 13:39:52 -07: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
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
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
611dc44c46
fix tests for ID parsing ( #291 )
...
The previous tests accessed the network. This refactoring lets us test the ID
parsing in isolation.
2013-05-29 14:51:16 -07: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
Adrian Sampson
89e76b8e5a
simplify current_metadata return value
...
We now just return the underlying dicts instead of an increasingly long tuple.
2013-05-28 20:51:30 -07:00
Tai Lee
a5151bb32e
Look at many more metadata fields when calculating distance.
...
Produce slightly more varied similarity score to prioritise extremely
similar releases.
2013-05-29 10:18:55 +10:00
Johannes Baiter
ad66b8796a
Fix tests for albums from manual ID
2013-05-28 13:50:20 +02:00
Tai Lee
1a4dfa0c07
Fix tests.
2013-05-25 01:58:08 +10:00
Tai Lee
dc7e98fd22
extra_items and extra_tracks on AlbumInfo are now lists, sorted by track index and title.
2013-05-25 00:44:23 +10:00
Adrian Sampson
475228a5e8
fix #281 : album art filename respects replace
2013-05-19 10:34:46 -07:00
Adrian Sampson
c56ef31da0
remove art_filename Library field
...
This is the first of a handful of refactorings that take advantage of the new
confit system to simplify parameter passing boilerplate.
2013-05-19 10:18:41 -07:00
Adrian Sampson
4d62a83210
simplify materialization in LazyConfig
2013-05-17 19:10:44 -07:00
Adrian Sampson
42624eb745
use lazy config loader in confit
...
This lets you, for example, import beets in a library or the REPL and use it
immediately without calling "beets.config.read()" first.
2013-05-17 19:05:16 -07:00
Adrian Sampson
c1815a5d72
FIELDS lists use real types instead of SQL strings
...
This should enable some useful simplifications down the road.
2013-05-11 16:41:04 -07:00
Adrian Sampson
6f77169ad2
itime ( #264 ): name change
...
I changed the "itime" field to "added" and the %format function to %time.
2013-05-11 13:24:23 -07:00
Adrian Sampson
4904106a72
config option for time format string
2013-05-11 13:10:31 -07:00
Adrian Sampson
24c90b565a
move time formatting to format_for_path
...
This is where field value transformations belong.
2013-05-11 13:06:24 -07:00
Adrian Sampson
dd00fe0cff
fix stray character and tweak whitespace
2013-05-11 12:54:53 -07:00
Lucas Duailibe
c7c2b266cd
correcting identation
2013-05-11 10:58:19 -03:00
Lucas Duailibe
0a631bcda2
Using time.time() to store the import time
2013-05-11 10:53:43 -03:00
Lucas Duailibe
d907dd6b40
Preliminary support for "date added" fields
...
This isn't yet finished, it needs some input on how to organize the data, and actually where to implement the use of this data, but it already works in setting the date
2013-05-11 10:53:43 -03:00
Adrian Sampson
8781433f59
add tests for matching floating-point ranges
2013-05-09 15:49:38 -07:00
Adrian Sampson
ea0928c845
generalize YearQuery to NumericQuery
2013-05-09 15:47:25 -07:00
Michael Schuerig
ae807bccfc
Merge branch 'master' of git://github.com/sampsyo/beets
2013-05-01 14:07:05 +02:00
Adrian Sampson
374e043c3c
API/test enhancements for #257
...
Also, `cautious` defaults to False for backwards-compatibility.
2013-04-27 16:47:42 -07:00
Fabrice Laporte
ac14b7f2fb
Fix unit tests by constructing a FetchArtPlugin in the
...
fixture and using 'art.jpg' as default image filename so that
'cautious' option does not interfere with the tests.
2013-04-27 12:27:04 +02:00
Michael Schuerig
c102b3be90
Add error message and test for invalid years.
2013-04-25 00:45:05 +02:00
Michael Schuerig
fe41bba380
Add a query class for years with support for ranges.
2013-04-25 00:36:21 +02:00