Commit graph

2998 commits

Author SHA1 Message Date
Thomas Scholtes
9a3963b58e Remove duplicate test
This is already tested by `ImportExistingTest.test_asis_updated_moves_file`
2014-01-28 20:28:38 +01:00
Thomas Scholtes
ae208f5f53 Use ImportSession sublass for tests 2014-01-28 20:13:02 +01:00
Thomas Scholtes
bb6adbfa11 add compilation tests 2014-01-28 20:08:42 +01:00
Thomas Scholtes
f8b899091b Migrate ApplyExistingItemsTest 2014-01-28 20:08:42 +01:00
Thomas Scholtes
aaefd023eb Extract choose tracks function 2014-01-28 20:08:42 +01:00
Thomas Scholtes
96e2d128c0 Revert old test cases 2014-01-28 20:08:42 +01:00
Thomas Scholtes
2a4c6d5bca Fixed typo makes tests pass 2014-01-28 20:08:42 +01:00
Thomas Scholtes
69a40593a0 Remove duplicate tests 2014-01-28 20:08:42 +01:00
Thomas Scholtes
910dc6a647 Add ImportCompliationTest 2014-01-28 20:08:42 +01:00
Thomas Scholtes
39f1b8c3d8 Refactor MusicBrainz stubs into helper class 2014-01-28 20:08:42 +01:00
Thomas Scholtes
9f4e227f96 More ImportTest refactoring 2014-01-28 20:08:41 +01:00
Thomas Scholtes
5535eddfaa Refactor Import Test 2014-01-28 20:08:41 +01:00
Thomas Scholtes
9b12d488e2 New Import test case 2014-01-28 20:07:20 +01:00
Thomas Scholtes
d302081cca ...and some refactoring again 2014-01-28 20:07:20 +01:00
Thomas Scholtes
bfaa56e5bd Stupid typo 2014-01-28 20:07:20 +01:00
Thomas Scholtes
42f54e36bd These tests are already in ImportNonAutotaggedTest 2014-01-28 20:07:20 +01:00
Thomas Scholtes
0cdb896003 Move prune and file tasks 2014-01-28 20:07:20 +01:00
Thomas Scholtes
33edb9a878 So this is how python works! ;) 2014-01-28 20:07:20 +01:00
Thomas Scholtes
c6654c5acf Make test strings more verbose 2014-01-28 20:07:19 +01:00
Thomas Scholtes
03f1879980 Extract library file assertions 2014-01-28 20:07:19 +01:00
Thomas Scholtes
49693f715c Use _setup_library() helper 2014-01-28 20:07:19 +01:00
Thomas Scholtes
e63ac27d1c Extract _run_import and expose config in tests 2014-01-28 20:07:19 +01:00
Thomas Scholtes
d65595c70b Extract ImportHelper for tests 2014-01-28 20:07:19 +01:00
Thomas Scholtes
f900f1e0c8 Refactor import test 2014-01-28 20:07:19 +01:00
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
Adrian Sampson
ca840acd5f Merge pull request #245 from sochotnicky/master
Update mutagen dependency to 0.21
2013-04-07 11:21:24 -07:00
Adrian Sampson
963b0d11d6 fix VFS tests
The configuration was not loaded for these tests because they didn't inherit
the common test harness. These failures were hidden on my system because of
some kind of dependency on another test.
2013-04-06 16:35:17 -07:00
Stanislav Ochotnicky
1666f883e3 Fix python namespaces for test runs
We need to make sure we don't use namespaced versions that are already installed
on the system but rather use local version from current sources
2013-04-07 01:32:47 +02:00
Adrian Sampson
fe8092139b fix construction of conditional path queries
I broke this in the last flurry of refactors but, as is usually the case, I
have no idea why it ever worked before.
2013-03-14 11:05:35 -07:00
Adrian Sampson
f005ec2de0 refactor: everything is like a plugin query (#214)
The initial idea for this refactor was motivated by the need to make
PluginQuery.match() have the same method signature as the match() methods on
other queries. That is, it needed to take an *item*, not the pattern and
value. (The pattern is supplied when the query is constructed.) So it made
sense to move the value-to-pattern code to a class method.

But then I realized that all the other FieldQuery subclasses needed to do
essentially the same thing. So I eliminated PluginQuery altogether and
refactored FieldQuery to subsume its functionality. I then changed all the
other FieldQuery subclasses to conform to the same pattern.

This has the side effect of allowing different kinds of queries (even
non-field queries) down the road.
2013-03-13 22:57:20 -07:00
Philippe Mongeau
685972bbc5 update query tests
fix escape colons in the query term
2013-03-10 20:26:45 -04:00
Adrian Sampson
d71737114a format None values as the empty string
Fix due to @pscn. Includes test. Closes #108.
2013-02-28 10:00:26 -08:00
Sam Doshi
8394619b99 add unit tests for aliases (#102) 2013-02-27 09:17:42 +00:00
Adrian Sampson
4a35be5724 fix crash when RG fields set to null
In general, we convert None values to type-based nulls in packed fields just
as we do for normal fields.
2013-02-24 16:10:18 -08:00
Adrian Sampson
c2a746562a fix Sound Check decode (GC-521)
Fixes the case when the gain number is negative.
2013-02-20 22:54:57 -08:00
Adrian Sampson
a7f0ad70ae test: move DummyIO initialization to harness
This makes it much harder to accidentally leave this I/O isolator installed.
2013-02-18 18:29:10 -08:00
Adrian Sampson
6c931faf1a tests: remove ad-hoc temporary directories
Now that we have a temporary directory in the shared harness, we can dispense
with the error-prone process of creating them for each test.
2013-02-18 18:23:32 -08:00
Adrian Sampson
8b4dca99e3 towards filesystem sandboxing of tests
The generic test harness now uses a temporary directory for beets' various
files as well as $HOME. As one packager pointed out, there were various test
failures when $HOME did not exist. This is no longer the case.
2013-02-18 17:52:37 -08:00
Adrian Sampson
e0bb3b5cd0 original_{year,month,day,date} fields (GC-441) 2013-02-08 13:28:51 -08:00
Adrian Sampson
b9cb3980c2 path_sep_replace config option
I also took this opportunity to move and rename util.santize_for_path to
library.format_for_path, which was long overdue.
2013-02-08 10:51:33 -08:00
Adrian Sampson
151177ab95 recommendation is now a "real" enumeration 2013-02-07 17:26:58 -08:00
steini
10758c487f Configurable list of patterns which will be ignored when pruning empty directories.
* util.prune_dirs modified to accept glob patterns as clutter to determine emptiness.
* config option, 'clutter' (a list of filenames/glob patterns)
* ImportTask.prune passes this option's value to prune_dirs.
2013-02-04 23:41:38 +00:00
Tai Lee
d9d2ddac23 Detect false positive markers in root/parent directories.
For example, catalogue numbers like "[REACT217]". This shouldn't bypass the
nested multi-disc detection and automatically include all subdirs.

Do nested multi-disc detection first, so that `collapse_pat` is only set for
flattened albums, and we can skip the ancestry check on subsequent folders.
2013-02-04 17:04:12 +11:00
Adrian Sampson
6ff1ba0474 break up multidisc collapsing tests
Now we can see which aspect fails in bite-sized pieces.
2013-02-03 12:06:10 -08:00
Adrian Sampson
99ed9e03de rename ImportTask.path to paths (#89) 2013-02-03 11:22:27 -08:00
Tai Lee
23cd5453d9 Improved multi-disc album detection.
- Remove "part", "volume", "vol." multi-disc markers. These are often
  part of album titles, and not necessarily indicative of a multi-disc
  album. Only look for "CD X" and "disc X" (case insensitive), ignoring
  white space and other non-word characters.

- Don't only expect each disc to be in a subdirectory of a common parent
  directory, with all siblings belonging to the same release. Also match
  any consecutive siblings (even when the parent contains other albums)
  that are named with the same prefix and multi-disc marker.

- The `albums_in_dir(path)` function now always yields a list of paths
  along with each list of items. `ItemTask.path` is now always a list of
  paths.

- The `displayable_path(path)` function now accepts a list of paths, and
  will join them with "; " by default. This can be changed with the
  `separator` argument.

- The `sorted_walk()` function now does a case insensitive sort on
  directories, but still returns case sensitive results. This allows
  better multi-disc album detection.

- The `art_for_album()` function now takes a list of paths as its second
  argument, instead of a single path.
2013-02-03 23:51:31 +11:00
Adrian Sampson
50a89e790c both release and release group disambig (#87)
This joins the two strings with a comma if both are present.
2013-02-02 12:42:53 -08:00
Adrian Sampson
5f5d3f13c5 Merge pull request #87 from pscn/master
Use release disambiguation not release-group disambiguation and more
2013-02-02 12:33:03 -08:00
Tai Lee
06976bb49d De-duplicate loop functionality. One logic loop and one display loop. 2013-02-02 09:11:12 +11:00
Peter Schnebel
663574c7ff Adapted test to pull request #87 2013-02-01 18:10:11 +01:00
Tai Lee
8afe1c71b1 Improved change alignment. Align "->" when possible, otherwise split across two lines. 2013-02-01 17:29:30 +11:00
Adrian Sampson
58d9a775cc remove singleton enforcement from plugins
The plugin system itself now enforces single instances.
2013-01-31 12:13:19 -08:00
Adrian Sampson
ebdbd69d8e fix test compatibility with mutagen 1.21
The new Mutagen release got a fix for the bitrate calculation in Musepack. The
tests now reflect that.
2013-01-31 10:16:22 -08:00
Adrian Sampson
486dd210ae trying out a multi-line track display (#78) 2013-01-30 19:23:53 -08:00
Adrian Sampson
ea2e263834 Merge pull request #78 from mrmachine/align-changes
Align LHS and RHS changes. Put track/duration differences on RHS.
2013-01-30 19:11:13 -08:00
Tai Lee
a6ee1f9e80 Fix tests. 2013-01-31 13:02:27 +11:00
Adrian Sampson
c14d9e4115 fix some tags in test WMA file 2013-01-29 21:51:40 -08:00
Adrian Sampson
10dfa780d1 fix crash when WMA is missing cover art (#75) 2013-01-29 21:46:58 -08:00
Adrian Sampson
e25b2ec740 add WMA test file (#75) 2013-01-29 21:44:02 -08:00
Adrian Sampson
38dee5af0f silence Unidecode warning due to byte string info
--HG--
extra : source : 6a023b1f3ace0ae3177afb382d0eebcb445bec05
2013-01-29 11:30:31 -08:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
fbcd1d1c18 merge fixes from master 2012-12-19 12:22:23 -08:00
Adrian Sampson
2023344019 Windows: fix relative paths in normpath()
The changes introduced in rc1 caused paths to be syspath-ified before they were
passed to os.path.abspath. The magic prefix caused them to be interpreted as
absolute paths even if they were relative. The fix is, in this *isolated*
case, to use Unicode but prefix-free paths in calls to the os.path.* functions.
Those functions need to act on Unicode objects but seem to be purely syntactic
-- nothing is tripped up by using long filenames without the magic prefix.
2012-12-19 12:19:23 -08:00
Adrian Sampson
2c45251db9 clean configuration for testing
This way, unit tests will never see a user's global beets configuration.
2012-12-18 20:27:36 -08:00
Adrian Sampson
55cac36d35 sync with latest confit
This includes Confit's shift to using OrderedDict, which needs some debugging.
2012-12-18 20:03:52 -08:00
Adrian Sampson
85600df2be remove outdated test 2012-12-15 13:22:18 -08:00
Adrian Sampson
cbd538de7b combine TempConfigTestCase and ExtraAsserts 2012-12-15 13:21:09 -08:00
Adrian Sampson
39cd1f6c63 switch from context manager to base class
Replaced temp_config context manager with TempConfigTestCase base class. This
lets us clean up even when a test fails.
2012-12-15 13:15:10 -08:00
Adrian Sampson
3e5ef375c8 confit-ify remaining tests except for ConfigTest 2012-12-14 15:23:47 -08:00
Adrian Sampson
ed3a3d1937 confit-ify a bunch more tests 2012-12-14 14:21:06 -08:00
Adrian Sampson
6f19f466fc tests: temporarily modify global configuration 2012-12-14 13:39:14 -08:00
Adrian Sampson
e84a41b550 start fixing up tests for confit overhaul 2012-12-14 13:18:06 -08:00
Adrian Sampson
e17cd6beba merge lots of work on the stable branch 2012-12-12 19:14:30 -08:00
Adrian Sampson
c499be05ea fix some tests under PyPy
In PyPy's pure-Python implementation of the sqlite3 module, sqlite3.Row has no
__len__ method. This works around calling len(row).
2012-11-27 21:47:15 -08:00
Adrian Sampson
f06c7dfbef modernize basic MediaFile tests
These tests were written when I knew almost nothing about Python and even less
about unittest. The class-generating magic never worked with nose for a crazy
reason I won't get into here. This has a bit more copypasta but the workings
are more obvious and we no longer generate enormous numbers of independent
tests. There should be a more representative number of dots in the test runner
output now.
2012-11-27 21:42:36 -08:00
Adrian Sampson
0a21d72a79 tolerate non-UTF8 locale in test 2012-11-27 20:38:47 -08:00
Adrian Sampson
9a4cda60cd autotag: use albumartist if available (GC-423) 2012-11-27 17:05:56 -08:00
Adrian Sampson
eef87c2189 truncation incorporates extension length (GC-461) 2012-11-27 16:54:50 -08:00
Adrian Sampson
6e889bb6d0 fix tests for new explicit urlretrieve() call 2012-11-03 12:47:35 -07:00
Adrian Sampson
a8383b03e9 merge with master 2012-11-01 14:28:25 -07:00
Adrian Sampson
ea128910c5 fix art tests for new URL interface (#64)
The various source helper functions now return URLs instead of calling
_fetch_image themselves.
2012-11-01 00:14:55 -07:00
Adrian Sampson
e3fe9712d5 fetchart fixes for image resizing (#64)
Fixed a number of issues with the changes to fetchart:
- Remove redundant fetches. This was making the Amazon source download every
  image twice even when art resizing was not enabled!
- Restore local_only switch in plugin hook, which got lost in the shuffle at
  some point.
- Don't replace the original image file in-place; use a temporary file instead.
  This would clobber the original source image on the filesystem with the
  downscaled version!
2012-11-01 00:09:35 -07:00
Adrian Sampson
7158c01ff8 clean up outdated FIXMEs 2012-10-27 18:47:04 -07:00
Adrian Sampson
16f207e927 make syspath/bytestring_path roundtrip on Windows
This is an alternative to #58 that makes bytestring_path perform more like the
inverse of syspath on Windows. This way, we can convert to syspath, operate on
the path, and then bring back to internal representation without data loss. This
involves looking for the magic prefix on the Unicode string and removing it
before encoding to the internal (UTF-8) representation.
2012-10-20 23:49:43 -07:00
Adrian Sampson
1f8fff7445 fix tests for recent API changes in commands 2012-10-20 21:19:50 -07:00
Adrian Sampson
3a4e1ca4f7 replaygain: add fields to Item
This has been a long time coming, but we now finally keep track of ReplayGain
values in the database. This is an intermediate step toward a refactoring of the
RG plugin; at the moment, these values are not actually saved!
2012-10-17 20:28:24 -07:00
Adrian Sampson
244ffd71e2 fix "beet modify" for date fields (GC-449)
This is fixed by allowing MediaFiles to convert strings to integers on
assignment. An eventual complete fix will perform these type conversions in the
Item interface.
2012-10-14 20:27:13 -07:00
Blemjhoo Tezoulbr
3eb11355cf ihate plugin: ver 1.0 - initial import 2012-10-05 02:37:21 +03:00
Blemjhoo Tezoulbr
c9fafb8379 plugin the: ver 1.1 - singleton mode, code cleanup 2012-10-05 02:04:51 +03:00
Adrian Sampson
2793af7d70 zero, the: Python 2.6-compatible format strings 2012-09-25 15:13:33 -07:00
Blemjhoo Tezoulbr
aff36fa694 zero plugin, version 0.9 2012-09-22 15:50:33 +03:00
Adrian Sampson
cdc833b8ab Merge pull request #47 from tezoulbr/master
new plugin: "the" (pattern moving in path formats)
2012-09-17 11:06:22 -07:00
Adrian Sampson
ef248576f0 bpd: fix crash w/ unicode extensions (GC-439) 2012-09-17 10:24:34 -07:00
Blemjhoo Tezoulbr
16aa842ccf plugin the: version 1.0 2012-09-16 04:42:39 +03:00
Adrian Sampson
dc054907d5 fix non-string value matching in SubstringQuery 2012-09-09 12:17:13 -07:00
Adrian Sampson
90b3dba085 fix match() on RegexpQuery for non-string values 2012-09-08 16:24:39 -07:00
Adrian Sampson
af2a329477 handle user-visible exceptions at top level
This makes error messages more friendly (i.e., traceback-free) when exceptions
occur during UI setup -- e.g., unopenable database.
2012-08-27 22:45:28 -07:00
Adrian Sampson
44459f88d0 Windows: represent paths as UTF-8 internally
When we store paths in the database, we always use bytestrings for consistency.
But on Windows, these paths are converted back to Unicode before they reach the
FS API. This means that the codec used internally is immaterial.

However, we were naively using sys.getfilesystemencoding() for this internal
representation. On Windows, this is MBCS, a broken encoding that can't represent
all of Unicode. This change replaces that with UTF-8, a "real" codec.

The decoding bit now tries UTF-8 and falls back to MBCS for compatibility with
existing databases. The reality, however, is that existing databases may not
work with this change -- a byte string may represent something different in
UTF-8 from what it represents in MBCS. So users should recreated their DBs if
anything goes wrong.
2012-07-17 10:54:47 -07:00
Jakob Borg
21cff66d08 Handle unicode in replacement config
The 'decode' call fails in what is already a unicode string. I'm not
sure under what circumstances the string is or isn't unicode (apparently
it varies), so I added a check. The test passes with the patch, at
least.
2012-07-05 23:12:36 +02:00
Adrian Sampson
ce166004cb use AlbumMatch/TrackMatch objects everywhere
This allows matches to indicate both missing and unmatched tracks in their
candidates and solves some of the spaghetti tuples that were passed around
during autotagging.
2012-07-01 16:33:48 -07:00
Adrian Sampson
7464b138cf fix tests broken by TrackInfo.index 2012-07-01 14:16:22 -07:00
Adrian Sampson
38b404240d merge 2012-06-29 15:27:05 -07:00
Adrian Sampson
ee3214e0f9 use TrackInfo.index in apply_metadata
enumerate() no longer necessary.
2012-06-29 15:18:10 -07:00
Adrian Sampson
d4c3ea74c6 match ordering without length assumptions
This replaces order_items with assign_items, the first step to allowing unequal
numbers of items on either side of the equation (user files and canonical
tracks). Rather than returning a "holey" list and assuming that the TrackInfo
objects stay static, the function returns a dictionary mapping Item objects to
TrackInfo objects. To indicate unmatched objects, two sets are also returned.

For the moment, some temporary code is included to turn the result from this
new function into the old format (a holey Item list). This allowed me to test
this change in isolation before plunging ahead with the necessary refactoring to
expose all of this to the importer workflow, etc.
2012-06-29 15:11:25 -07:00
Adrian Sampson
98d46be4a5 include global index in TrackInfo objects 2012-06-29 14:06:28 -07:00
Adrian Sampson
fbb5823541 fetchart: command to manually download art 2012-06-24 18:27:00 -07:00
Adrian Sampson
77cbb19564 fetchart: get local art for as-is imports (GC-339) 2012-06-24 17:41:37 -07:00
Adrian Sampson
d807b3fbf1 Cover Art Archive support (GC-71) 2012-06-24 16:57:04 -07:00
Adrian Sampson
11d4fb1abb move album art fetching to a plugin (fetchart) 2012-06-24 00:34:50 -07:00
Adrian Sampson
073ee14e56 fix broken matching of path format queries (#405)
A bug in the shlex module with Unicode strings made these queries unparseable
and thus match every track.
2012-06-23 17:18:28 -07:00
Adrian Sampson
d88afbad11 library maintains per-thread DB conns. (GC-399) 2012-06-08 10:49:47 -07:00
Adrian Sampson
e00f15175a prune is a no-op when file exists
i.e., when moving a file that's already at its destination.
2012-05-30 16:39:47 -07:00
Adrian Sampson
86f513d4ab split apply_choice coroutine
This essential import pipeline stage is now two: one that applies metadata
changes and one that manipulates the filesystem. This will eventually allow
lastgenere to apply its changes before destinations are calculated.
2012-05-22 23:22:34 -07:00
Adrian Sampson
c0da62c2b7 multi-artist sort names 2012-05-19 16:35:52 -07:00
Adrian Sampson
711a1c1113 apply artist credits & add to database (GC-286) 2012-05-19 16:13:15 -07:00
Adrian Sampson
e56ca46b75 add artist credit fields to MediaFile (GC-286) 2012-05-19 15:57:26 -07:00
Adrian Sampson
1387f30295 parse artist credits from MB responses (GC-286) 2012-05-19 15:42:08 -07:00
Adrian Sampson
13995201a1 human-readable filesystem errors (#387) 2012-05-18 15:16:38 -07:00
Adrian Sampson
2b000c47a2 per_disc_numbering config option (GC-335) 2012-05-17 12:44:48 -07:00
Adrian Sampson
a6c1ad2235 reimporting with copying: copy external files 2012-05-17 11:42:58 -07:00
Adrian Sampson
387a2dbc3c fix tests for GC-362 2012-05-16 17:13:01 -07:00
Adrian Sampson
429af42e14 use print_function __future__ import
All code should now use Python 3-style "print"s.
2012-05-13 21:08:27 -07:00
Adrian Sampson
b68e87b92c The Great Trailing Whitespace Purge of 2012
What can I say? I used to use TextMate!
2012-05-13 20:22:17 -07:00
Adrian Sampson
a28f930c52 transaction objects to control DB access
In an attempt to finally address the longstanding SQLite locking issues, I'm
introducing a way to explicitly, lexically scope transactions. The Transaction
class is a context manager that always fully fetches after SELECTs and
automatically commits on exit. No direct access to the library is allowed, so
all changes will eventually be committed and all queries will be completed. This
will also provide a debugging mechanism to show where concurrent transactions
are beginning and ending.

To support composition (transaction reentrancy), an internal, per-Library stack
of transactions is maintained. Commits only happen when the outermost
transaction exits. This means that, while it's possible to introduce atomicity
bugs by invoking Library methods outside of a transaction, you can conveniently
call them *without* a currently-active transaction to get a single atomic
action.

Note that this "transaction stack" concepts assumes a single Library object per
thread. Because we need to duplicate Library objects for concurrent access due
to sqlite3 limitation already, this is fine for now. Later, the interface should
provide one transaction stack per thread for shared Library objects.
2012-05-06 23:24:05 -07:00
Adrian Sampson
5ebb61bab7 moving import (#266): move album art files 2012-05-03 17:08:52 -07:00
Adrian Sampson
b327455fac prune empty directories when moving (#266) 2012-05-03 16:59:56 -07:00
Adrian Sampson
104aec3c2f cleanup and docs for regular expression queries 2012-05-01 20:03:01 -07:00
Adrian Sampson
a6e6da245a Merge branch 'upstream' of https://github.com/djrtl/beets-dj
Conflicts:
	beets/library.py
2012-05-01 19:17:05 -07:00
Adrian Sampson
d042bed27c pre-parse path format templates
Instead of parsing the template at each call to destination(), it's now possible
to parse them *once*, a priori, and re-use the resulting template object. This
is analogous to the re module's compiled expressions.
2012-04-29 15:30:43 -07:00
Matteo Mecucci
46ec5db3fe Added unit tests for regexps in query expressions. 2012-04-28 15:24:42 +02:00
Adrian Sampson
8f128876e2 %aunique: use a single field instead of a sequence
For a less cumbersome uniquifying string, only a single field value is now used
instead of a prefix of a list of fields. The old semantics had two problems that
made it both unnecessary and insufficient:
- In the vast majority of cases, a single field suffices (year OR label OR
  catalog number, for example) and forcing the string to include many identical
  fields is unnecessary.
- If the albums are very similar, a prefix may be insufficient; a better
  solution may be found with an arbitrary subset. (Of course, we can't afford to
  search the whole power set.)
So we're going with a single field for now. This should cause far less
confusion.
2012-04-24 21:15:50 -07:00
Adrian Sampson
8fe3738710 default arguments to %aunique{} (#190) 2012-04-24 20:34:51 -07:00
Adrian Sampson
f20fbede5e sanitize output of %unique 2012-04-20 10:17:19 -07:00
Adrian Sampson
6b696c842f cleanup and docs for import_move (GH-26, GC-266)
- Copying and moving are mutually exclusive. Moving overrides copying so the
  user only has to add one line ("import_move: true") to disable copying and
  enable moving in its place.
- Deleting is only possible when copying.
- Deprecating the "delete" option (moving is almost always better).
- Removed command-line switch for moving. It's somewhat "unsafe", so this
  removes some potential for accidental irreversible changes.
- Changelog & thanks.
- Update docs to refer to import_move instead of import_delete as the
  correct solution for ending up with only one copy of the file.
2012-04-10 13:41:24 -07:00
Adrian Sampson
d256aeb436 Merge pull request #26 from iElectric/master
import_move: move files (instead of copying & deleting)
2012-04-10 13:02:30 -07:00
Adrian Sampson
ed495765e2 tolerate missing language from MB (#373) 2012-04-10 11:38:45 -07:00
Domen Kožar
1af4f86c17 support move action when importing 2012-04-05 01:14:17 +02:00
Adrian Sampson
4fdebcff2d parse & apply new set of fields 2012-04-04 09:13:26 -07:00
Adrian Sampson
251026b759 add a new batch of metadata fields
The new fields are:
ALBUM: mb_releasegroupid asin catalognum script language country albumstatus
media albumdisambig
TRACK: disctitle encoder
These are not yet parsed from MusicBrainz responses (just added to MediaFile
and the database).
2012-04-04 00:52:57 -07:00
Adrian Sampson
ffa2402ff4 revamp default character substitutions
There's no longer a distinction between Unix and Windows substitutions. Enough
users reported problems with Windows-forbidden characters on Samba shares that
it seems appropriate to make all filenames Windows-safe, even on Unix. Users who
really want those additional characters (<>:"?*|\) can re-enable them via the
"replace" option. Nobody has complained about beets being *too* conservative.

This also adds sanitization of control characters, which is an all-around good
idea, and the substitution now runs in the Unicode (rather than byte) domain.
2012-04-03 14:22:38 -07:00
Adrian Sampson
de6530f4a5 acoustid ID and fingerprint stored/tracked (#332) 2012-04-01 18:22:42 -07:00
Adrian Sampson
781c26ffd0 normalize to NFC on non-Mac platforms (#367) 2012-03-27 10:44:11 -07:00
Adrian Sampson
823e36ad01 normalize new filenames to with NFD 2012-03-26 12:14:30 -07:00
Adrian Sampson
2f1ac61d4f track and album artist sort names (GH-25, GC-77)
Previously, there was just an "artist sort name" field -- now there's a
corresponding sort name for both track artists and album artists. I also made
the names shorter (artist_sort and albumartist_sort).
2012-03-25 17:02:52 -07:00
Adrian Sampson
06f137bff9 %unique path function
Generates disambiguating strings to distinguish albums from one another. To be
used as the basis for a simpler path field, $unique, as a default disambiguator.
2012-03-22 18:04:06 -07:00
Adrian Sampson
24cdf2a72e duplicate trumping: remove items & delete files
Based on the "remove_duplicates" flag on ImportTask, the apply_choices coroutine
now looks for duplicates (using an extended version of the _duplicate_check
functions) and removes items from the library. It also *deletes* files
associated with those items when they are located inside the beets library
directory. Files outside of the directory are left on disk (but their DB entry
is still removed). This should "do the right thing" in most cases -- again, this
is something we can add a config option for if it comes up.
2012-03-20 14:23:44 -07:00
Adrian Sampson
19b08f8e99 duplicate resolution callback function (#164) 2012-03-19 15:32:53 -07:00
Philippe Mongeau
200a98d4df add format option to list_items command
you can provide a custom format option to the list
command.
Example: $ beet ls -f '$title - $album'
2012-02-29 19:14:56 -05:00
Adrian Sampson
6d2df0e4bf import_delete: delete local album art (#242) 2012-02-15 16:46:23 -08:00
Adrian Sampson
ea95fa1373 album art fetcher tests 2012-02-15 16:35:28 -08:00
Adrian Sampson
153f52a6eb import_delete prunes empty imported directories (#243) 2012-02-09 15:06:33 -08:00
Adrian Sampson
7522468f0e set disc and disctotal when autotagging (#226) 2012-02-07 18:03:31 -08:00
Adrian Sampson
5a0105b12c fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
Adrian Sampson
bb4be3a303 lower case extensions in destination (#331) 2012-01-31 15:11:19 -08:00
Adrian Sampson
337e2556a6 sanitize path components from plugins (#315) 2012-01-30 16:53:05 -08:00
Adrian Sampson
b7c9d2caf5 prevent divide-by-zero in bitrate property (#319) 2012-01-29 14:08:23 -08:00
Adrian Sampson
fe33926038 add new audio properties to library/DB
$samplerate now expands to "##kHz" in path formats.
2012-01-27 16:04:51 -08:00
Adrian Sampson
9987ab47fd fixes & tests for new audio properties
For the recently-added samplerate, bitdepth, and channels properties on
MediaFile, a few things were fixed:
- tests in test_mediafile_basic
- never return None (zero when unavailable)
- make channels work with MP3 files (by looking at the codec "mode")

Also added some docstrings on all of the properties.
2012-01-27 15:51:14 -08:00
Adrian Sampson
4a1e8fdd6e merge 2012-01-27 12:04:44 -08:00
Adrian Sampson
f685bdd89a unicode in str MediaFile fields (#311, closes #15) 2012-01-27 12:02:26 -08:00
Adrian Sampson
3b37433005 no penalty for "various artists" track artist (#251) 2012-01-25 20:41:59 -08:00
Adrian Sampson
47891b00f7 tolerate per-medium track numbering (#283) 2012-01-25 20:12:04 -08:00
Adrian Sampson
0e81900675 mtime tests at integral second resolution (#298) 2012-01-18 14:08:15 -08:00
Adrian Sampson
c40081808a fix double-removal when re-importing with deletion
With import_delete enabled and performing a re-import (which moves files), the
former location of the file would be "deleted". This would lead to a "file does
not exist" error.
2012-01-06 21:58:17 -08:00
Adrian Sampson
d73c133a53 query-conditioned path formats (#210)
Also, Library.path_formats is now a list of pairs instead of a dictionary. (I
would have used an OrderedDict, but that was added in 2.7.)
2011-12-28 19:01:13 -08:00
Adrian Sampson
b44195853c zero-pad date values in path formats (#282) 2011-12-22 15:57:02 -08:00
Adrian Sampson
112d0f5452 uniquify conflicting filenames (#182) 2011-12-19 22:52:13 -08:00
Adrian Sampson
b493bc7004 configurable pathname substitution (#115) 2011-12-19 18:37:35 -08:00
Adrian Sampson
08b539a80e fix field inference w/ null first item (closes #14 on GitHub)
When a partial match is found, its first item (task.items[0]) may be None, and
_infer_album_fields would crash in this case. This solution walks through the
items list and finds the first non-None item.
2011-12-16 16:45:50 -08:00
Adrian Sampson
46a3bde5b5 fix empty function arguments
Previously, an empty argument was treated as "not an argument at all". Now,
every function call always has at least one argument -- i.e., %foo{} is a
function call whose only argument is "" -- and %foo{,bar} is valid syntax.
2011-12-16 12:08:39 -08:00
Adrian Sampson
255fbf6c41 add a small set of default path functions (#231) 2011-12-15 14:27:59 -08:00
Adrian Sampson
ae2f0db540 escape sequences now use $ instead of doubling
This was causing a problem with situation where }} would have semantic meaning
other than escaping a }. Specifically, %func{%func{arg}} contains a }} but
should not escape the }. $} seems to cover this situation. However, ${ is not
permitted as an escape sequence because it looks like the beginning of a symbol
(variable reference) like ${foo}. This is OK because { can be used anywhere as a
literal.
2011-12-15 00:11:57 -08:00
Adrian Sampson
829bd14993 template evaluation (#231) 2011-12-14 19:06:42 -08:00
Adrian Sampson
aa6008dbbc more thorough tests for function call parsing (#231) 2011-12-14 18:46:56 -08:00
Adrian Sampson
b6e75dacb1 function parsing in template string parser (#231) 2011-12-14 18:40:54 -08:00
Adrian Sampson
b5a76e9d1e beginnings of a template string parser (#231) 2011-12-14 17:30:53 -08:00
Adrian Sampson
9aef539e11 fix some ReplayGain fields (and tests) 2011-12-10 17:24:27 -08:00
Adrian Sampson
700c7cd9f8 albumart.org scraper art source (#272) 2011-12-07 11:11:35 -08:00
Adrian Sampson
b9d6928278 consistency policy for DB mtimes (#227) 2011-12-03 17:18:51 -08:00
Adrian Sampson
82367e9067 cleanup for partial match feature (#260)
- Plugins are sent the unadulterated, None-ridden ordered items lists. Changed
  the lastid plugin to accommodate this.
- Make colorization optional in partial album warnings.
- Fix some tests.
2011-12-01 14:03:32 -08:00
Adrian Sampson
0b5a47a745 Merge pull request #13 from laarmen/feature/incomplete_albums
Tag incomplete albums (#260 on Google Code)
2011-12-01 13:04:11 -08:00
Simon Chopin
bb964a7c47 autotag: Fill the blanks when ordering incomplete album
In the function order_items, instead of automatically reject the
canonical candidate if it has more tracks, the function still tries to
find matches for the tracks amongst the items, and otherwise uses None
to fill the void in order to keep the information about the track
numbers
2011-11-22 13:47:36 +01:00
Simon Chopin
4dc4025b5f autotag: Can now compute the distance for incomplete albums
If the user has some songs from a specific album, but not all of them,
the real solution is immediately discarded. This commit is the first of a
series that will implement support for these incomplete albums.

The point of this patch is to make sure missing commits are taken into
account when calculating the distance between an album and its canonical
data.

Note that in order not to break API compatibility, the album_distance
call for the plugins receives a purged version of both the items and the
album info, resulting in some potential accuracy if the plugin bases
itself on the index of a track in album_info.tracks.
2011-11-22 13:47:35 +01:00
Adrian Sampson
5965b37f51 skip (configurable) clutter filenames when importing 2011-11-13 17:14:40 -08:00
Adrian Sampson
02402545e0 get original release date for MB release group (#65) 2011-11-13 16:30:49 -08:00
Adrian Sampson
7e627c5e57 decode pathnames before formatting them (#232) 2011-11-13 10:10:19 -08:00
Adrian Sampson
bfb8b443ff beginning of ReplayGain fields in MediaFile 2011-11-12 21:23:54 -08:00
Adrian Sampson
adbfd06682 embed python-musicbrainz-ngs; beets is now on /ws/2 2011-10-23 18:20:01 -07:00
Adrian Sampson
95f38dbe52 "info dictionaries" replaced with AlbumInfo and TrackInfo 2011-10-23 14:12:13 -07:00
Adrian Sampson
ee78391f4f autotag refactoring in preparation for interface changes 2011-10-10 18:19:24 -07:00
Adrian Sampson
9a1d43d156 prevent albums_in_dir from yielding empty albums (#265)
This regression was introduced with the album collapsing feature. We need to
check whether the items array is empty before yielding every time.
2011-11-29 11:36:33 -08:00
Adrian Sampson
1ba4d74a75 use better default paths on Windows (#241) 2011-11-27 23:33:11 -08:00
Adrian Sampson
450115358d multi-disc album collapsing based on heuristics (#42) 2011-11-26 15:43:26 -08:00
Adrian Sampson
b1a1caa246 fix update tests for mtime optimization (#227) 2011-11-23 18:05:37 -08:00
Adrian Sampson
256cbf9fd5 sync with latest python-musicbrainz-ngs, fixing Unicode queries (#257) 2011-11-23 17:57:00 -08:00
Adrian Sampson
ec49fca4dc smarter MBID input (based on patch by derwin) 2011-10-07 15:33:19 -07:00
Adrian Sampson
2e2c1be1bd catch MB BadStatusLine errors 2011-09-18 17:09:20 -07:00
Adrian Sampson
4b5c674d9b "--pretend" (dry run) flag for update 2011-09-18 16:18:19 -07:00
Adrian Sampson
6fbe69d454 spelling errors in comments 2011-09-18 13:00:36 -07:00
Adrian Sampson
748457193b fix colorized diff of non-string values (#236) 2011-09-18 12:36:52 -07:00
Adrian Sampson
e0f66d6f18 epsilon tolerance in float equality for showdiff 2011-09-18 12:29:07 -07:00
Adrian Sampson
9933b5e4df difference display was showing the same value twice (#236) 2011-09-18 12:10:10 -07:00
Adrian Sampson
80ddff263f tests and a bug fix for #229 2011-09-15 21:26:19 -07:00
Adrian Sampson
e8b8cb179f refactor: move() is a method on Library (not Item) 2011-09-15 16:15:53 -07:00
Adrian Sampson
e12645684f do nothing when copying/moving a file to itself (#234) 2011-09-15 14:55:33 -07:00
Adrian Sampson
e2b7a7514d fix visual diff for non-string values (#235) 2011-09-15 14:45:31 -07:00
Adrian Sampson
94569a774e moving/copying fails when destination exists (#230) 2011-08-28 18:25:38 -07:00
Adrian Sampson
607757edf1 -i/import_incremental to only import new directories (#99) 2011-08-09 12:09:36 -07:00
Adrian Sampson
45eeea343e destination option for "beet move" (also tests) 2011-08-05 12:19:34 -07:00
Adrian Sampson
2c56fd22f2 fix replacement of in-library items 2011-08-04 16:14:07 -07:00
Adrian Sampson
3efeb9a133 -L flag to import lets you re-import items matching query (#69) 2011-08-04 15:29:59 -07:00
Adrian Sampson
248bccf951 move, rather than copying, when re-importing 2011-08-04 14:08:11 -07:00
Adrian Sampson
3e75d262a8 correctly detect item existence when copying 2011-08-04 13:35:44 -07:00
Adrian Sampson
f54ace110c allow "null" album art setting (when it's already in place) 2011-08-04 12:19:30 -07:00
Adrian Sampson
f3130152b1 don't count existing items/albums as duplicates (allowing update) 2011-08-04 12:04:22 -07:00
Adrian Sampson
58fb4392ee refactor duplicate tests to take the whole task as an argument 2011-08-04 11:51:17 -07:00
Adrian Sampson
7f4f477c32 remove old items/albums from database when re-importing items 2011-08-04 11:16:12 -07:00
Adrian Sampson
330585292d skip .DS_Store (and Thumbs.db) when pruning directory trees 2011-08-03 00:03:15 -07:00
Adrian Sampson
e84c3e7abd consolidate update command, removing album-munging logic 2011-08-02 23:37:55 -07:00
Adrian Sampson
e1d9e6bb45 prune directories when moving 2011-08-02 16:01:11 -07:00
Adrian Sampson
e24ebbae00 add --yes (-y) option for skipping modify confirmation 2011-08-02 14:10:03 -07:00
Adrian Sampson
a367b2764d first attempt at command-line modification command (#56) 2011-08-02 13:59:33 -07:00
Adrian Sampson
b63d6c858b MPEG-4 Unicode freeform frames are now encoded as UTF-8 bytes 2011-07-31 23:03:19 -07:00
Adrian Sampson
951e4eec86 fix VA inference for small (1-track) albums 2011-07-07 09:19:33 -07:00
Adrian Sampson
45383eced2 fix VA inference (needs to run before move step in "apply") 2011-07-07 09:13:37 -07:00
Adrian Sampson
f53a06ddf1 merge 2011-07-07 08:33:33 -07:00
Adrian Sampson
fed8782ca1 fix Unicode queries from CLI arguments 2011-07-01 15:43:06 -07:00
Adrian Sampson
a448879ca9 infer album artist or VA for as-is imports (#161) 2011-06-29 10:36:07 -07:00
Adrian Sampson
7f206baae5 automatically detect path queries containing / (finishes #146) 2011-06-26 00:25:39 -07:00
Adrian Sampson
fcc2744ac5 use separate shell arguments for queries to preserve whitespace 2011-06-26 00:12:45 -07:00
Adrian Sampson
f3ac19622a a couple of fixes for path queries 2011-06-25 14:23:32 -07:00
Adrian Sampson
1006a9a221 merge/fixup derwin's label patch 2011-06-25 13:04:19 -07:00
Adrian Sampson
e64e20cc87 copy album art from filesystem based on filename heuristics (#72) 2011-06-24 21:41:25 -07:00
Adrian Sampson
846b85556d algorithm for identifying filesystem album art 2011-06-24 21:24:15 -07:00
Adrian Sampson
6ca995f4e7 new path queries only match prefixes 2011-06-14 23:19:18 -07:00
Adrian Sampson
efa704f61e fix crash when using an item-only field in an album query 2011-06-13 21:27:13 -07:00
Adrian Sampson
ac9147928a calculate bitrate from file size when not available (#195) 2011-06-13 21:07:15 -07:00
Adrian Sampson
40035bfdf4 format $bitrate in path formats as "XXkbps" 2011-06-13 20:52:52 -07:00
Adrian Sampson
973fca1d89 better error message on unreadable database 2011-06-02 10:17:53 -07:00
Adrian Sampson
da6ee13159 fix singleton quiet imports 2011-05-21 16:53:01 -07:00
Adrian Sampson
39dac9a28d "beet ls -p" outputs paths 2011-05-21 12:40:36 -07:00
Adrian Sampson
078252d31e use unidecode to deal with accents and such (#118) 2011-05-06 12:41:32 -07:00
Adrian Sampson
8341dee3ab reorder items() and albums() parameters to reflect common use 2011-05-05 17:20:24 -07:00
Adrian Sampson
151df84150 remove unused artists() and get() methods on library 2011-05-05 17:11:54 -07:00
Adrian Sampson
3e90579a6c BPD uses new VFS as a backend (#131) 2011-05-05 17:00:05 -07:00
Adrian Sampson
926032fd07 add simple virtual filesystem construction
--HG--
rename : test/test_art.py => test/test_vfs.py
2011-05-05 14:19:47 -07:00
Adrian Sampson
a0ef39aba5 duplicate detection on adjacent albums/items now works (#156) 2011-05-05 10:20:23 -07:00
Adrian Sampson
65dac30e4d break album art and finalization into new stages (#168) 2011-05-03 13:12:23 -07:00
Adrian Sampson
73c4bedc41 simplify MediaFile art interface: no type is included
The interface no longer specifies the type of the image embedded in the file; it
just returns a bytestring blob. When a type must be stored, it is inferred using
the imghdr module, which shoudl reduce the potential for weird bugs when the
formats don't correspond.
2011-04-27 10:27:26 -07:00
Adrian Sampson
4a6b8274d8 basic album art unit test 2011-04-20 23:36:43 -07:00
Adrian Sampson
c2fd535047 &/and equivalent in string distance 2011-04-19 23:21:18 -07:00
Adrian Sampson
7e89282053 duplicate detection for items 2011-04-19 16:40:40 -07:00
Adrian Sampson
3dbce11a25 raise error when -q and -t are supplied together 2011-04-19 13:56:45 -07:00
Adrian Sampson
df6b1abfd8 clean up vestiges of TRACKS choice for album tasks 2011-04-19 13:21:27 -07:00
Adrian Sampson
db6eb60e23 update tests for timid mode 2011-04-19 13:13:16 -07:00
Adrian Sampson
828f1aa4f1 multiple() function for sending many messages to next stage 2011-04-17 08:18:54 -07:00
Adrian Sampson
85cd3cdb84 add pipeline tests, fixing a bug with parallel stages in the process 2011-04-17 07:57:56 -07:00
Adrian Sampson
375e335002 manual searching for singletons
(Still on a plane.)
2011-04-15 20:14:30 -07:00
Adrian Sampson
be9dc888cb fix crash when ~/.beetsconfig does not exist 2011-04-15 12:50:06 -07:00
Adrian Sampson
d1b7c8dc55 display track changes; some scaffolding for user query 2011-04-14 09:07:06 -07:00
Adrian Sampson
6cfb862906 conditional deletes in some cases (suggested in #170) 2011-04-13 20:23:33 -07:00
Adrian Sampson
45eef6e876 rename -i flag to -s ("singletons") and fix behavior 2011-04-12 23:31:44 -07:00
Adrian Sampson
12854ad2ff very first stab at a working individual-item importer flow
"beet import -i" now tags items instead of albums. There are many loose ends to
tie up (marked with TODOs in the source):
- What to do about applying non-track metadata to matched tracks? Currently it's
  just left in place.
- Plugin autotag candidates for tracks.
- No user querying yet.
- Non-autotagged -i import are unimplemented.
And, on top of those:
- Need to remove the action.TRACKS workflow and replace it with an option that
  lets you jump over to the individual-track interface from the album tagger.
2011-04-12 23:22:03 -07:00
Adrian Sampson
a39a5b5d66 extremely preliminary item importer skeleton
(I shouldn't have started on this yet; the autotagger functionality isn't in
place yet. Going back and doing that now...)
2011-04-12 20:52:39 -07:00
Adrian Sampson
6f9c460837 slight tweaks to tests to let them run under nose 2011-04-12 15:06:27 -07:00
Adrian Sampson
85ddfa4381 relocatable test rsrc directory 2011-04-12 14:26:48 -07:00
Adrian Sampson
c03ec1ee1c add a multithreaded import test case 2011-04-12 14:11:43 -07:00
Adrian Sampson
89f33466e0 move non-autotagged import test (wasn't testing UI) 2011-04-12 14:09:17 -07:00
Adrian Sampson
fcee8b2ab6 remove special-cased non-autotagged import function (simple_import) 2011-04-12 13:57:05 -07:00
Adrian Sampson
584cc74a5c fix bug when "applying" sentinel 2011-04-11 08:21:36 -07:00
Adrian Sampson
7503c1174a more natural-looking queries for comp field
You can now use "comp:true" or "comp:yes" as well as "comp:1".
2011-04-10 22:55:25 -07:00
Adrian Sampson
a675988eb2 add and use fancy enumeration module 2011-04-10 22:10:33 -07:00
Adrian Sampson
e669868896 move a bunch of functions to util 2011-04-10 21:48:05 -07:00
Adrian Sampson
3222cc6213 move main importer driver logic to importer module 2011-04-10 19:15:24 -07:00
Adrian Sampson
dffdbce5f1 sanitize CLI-specific code from importer module 2011-04-10 19:10:22 -07:00
Adrian Sampson
c0467c3724 encapsulate importer configuration in an object 2011-04-10 18:56:42 -07:00
Adrian Sampson
23392525ec The Great Importer Refactoring
I'm shuffling around the feature-creeping importer code to keep it as
interface-agnostic as possible. The "importer" module now takes care of the
basic, increasingly complicated workflow while the ui.commands module is
relegated to containing actual user-interface stuff.
2011-04-10 18:12:47 -07:00
Adrian Sampson
11c5b15c8d fix copying destination for full-album imports 2011-04-10 10:57:13 -07:00
Adrian Sampson
e478ae740d refactor importer to use a ImportTask class instead of a tuple 2011-04-09 19:53:52 -07:00
Adrian Sampson
d63a9fd188 singleton: queries 2011-04-09 16:13:12 -07:00
Adrian Sampson
b28ef722a5 singleton path format 2011-04-09 14:50:48 -07:00
Adrian Sampson
61ef980797 $albumartist falls back to $artist (#166) 2011-04-09 12:36:52 -07:00
Adrian Sampson
4ce8d3b249 duplicate detection is (belatedly) album-based instead of track-based 2011-04-03 16:12:09 -07:00
Adrian Sampson
966572c0d3 test missing track artist in compilation 2011-04-03 12:20:47 -07:00
Adrian Sampson
e9d790a2b3 tests for deletion during import 2011-04-03 12:11:08 -07:00
Adrian Sampson
f256726917 explicit searching for VA releases when it seems likely 2011-04-02 20:29:01 -07:00
Adrian Sampson
c051df6d91 fix broken symlink crash (#157) 2011-04-02 18:03:42 -07:00
Adrian Sampson
d4d74dd68b fix crasher w/ old APE files (#159) 2011-04-02 17:48:54 -07:00
Adrian Sampson
cd8ca9f473 make -p/-P and import_resume config option symmetric
The import_resume option (nee import_progress) now exactly reflects the behavior
of -p and -P on the command line, which I think is way less confusing. That
option now has three settings: yes, no, and "ask" (the default). The "ask"
behavior cannot be specified on the command line, but I think that's OK. It's
also important to note that "no" means that progress is disabled entirely
(including saving progress for later resumes). The -q flag still overrides the
config option.
2011-03-30 20:05:42 -07:00
Adrian Sampson
436f635b55 import_quiet_fallback option to customize in quiet mode (#149) 2011-03-29 21:27:03 -07:00
Adrian Sampson
5b13094789 -p and -P flags to force resume or skip resume 2011-03-29 20:02:47 -07:00
Adrian Sampson
1b6910ac6a move directory-pruning to item's remove() method 2011-03-23 17:03:21 -07:00
Adrian Sampson
7f7c45b252 refactoring, tests, NEWS note on wlof's directory-pruning patch 2011-03-23 16:53:24 -07:00
Adrian Sampson
43a5e913a7 move some reused testing stuff to _common module 2011-03-23 16:15:18 -07:00
Adrian Sampson
b5c38970cc add test for wlof's albumartist searching fix 2011-03-23 16:01:35 -07:00
Adrian Sampson
f69f69cecf merge in some fixes from wlof's repository 2011-03-23 15:50:11 -07:00
Adrian Sampson
bc807c6547 distance metric now sensitive to various-artist matches 2011-03-23 15:38:46 -07:00
Adrian Sampson
ecdcd1e1bf use timecop for MusicBrainz error-catching tests 2011-03-23 14:42:29 -07:00
Adrian Sampson
c698868bf0 catch Ogg header error (#133) 2011-03-23 11:51:27 -07:00
Adrian Sampson
096816cba7 path formats can now be specified by album type 2011-03-22 20:09:27 -07:00
wlof
c09f6a75ff updated db to new format 2011-03-19 01:47:24 +01:00
wlof
7be77a99d9 .. is now inserted at the beginning of sys.path so that local beets
files are used instead of installed ones
2011-03-19 01:45:35 +01:00
wlof
2db7699ed3 .. is now inserted at the beginning of sys.path so that local beets
files are used instead of installed ones
2011-03-19 00:08:19 +01:00
Adrian Sampson
2360c5744a retry on MusicBrainz error 504 (gateway timeout) 2011-03-03 15:25:16 -08:00
Adrian Sampson
5437b30688 strip null characters from MB queries (#142) 2011-02-28 10:08:09 -08:00
Adrian Sampson
4ab74d9a69 don't log output during testing 2011-02-18 12:41:23 -08:00
Adrian Sampson
993519c004 split import tests, suppress progress checks for testing 2011-02-18 12:38:46 -08:00
Adrian Sampson
0d869340ec fixes for album artist inference
- Inference must be enabled explicitly with the "infer_aa" flag. It does not
  happen transparently.
- Infer both artist and artist ID.
- Fixed a bug where only the database row was using the inferred data, not the
  returned data structure.
- Added tests.
2011-02-18 12:17:22 -08:00
Adrian Sampson
ce5f9f9936 move BaseAlbum tests to test_db (with other album tests) 2011-02-18 11:36:52 -08:00
Ozzi Lee
9d20fd7151 Add ImportTest, testing import_files in commands.py.
Only tests "as-is" metadata imports, making sure that tracks are
copied to the library and named properly.
2011-02-18 06:31:46 -06:00
Ozzi Lee
d9554746cd Added a very basic test_library.py
test_library.py so far just documents existing behavior of album
objects, especially the fact that trying to access unset fields causes
an AttributeError.
2011-02-02 22:22:23 -06:00
Adrian Sampson
0822fa2f82 test that autotagger sets track artist to match album artist 2011-01-24 20:22:13 -08:00
Adrian Sampson
9d3eaa5b05 remove albumify plugin (it's been a while since beta 3) 2011-01-24 19:43:27 -08:00
Adrian Sampson
eb1a6c8ae3 tests for multiple paths feature; legacy path_format overrides 2011-01-24 19:40:09 -08:00
Adrian Sampson
d16e972088 fix count queries over empty results 2011-01-24 15:41:38 -08:00
Adrian Sampson
66b3e5675c update default path formats; make $artist fall back on $albumartist
The default path formats now include both a "default", which is the same as
before but now uses $albumartist instead of $artist, and a "comp" path, which
uses a Compilations directory. Old paths are supported as-is by letting $artist
refer to either a track artist (when present, as it is in all old library
tracks) or album artist (when the track artist isn't present, as is the case
with most albums imported now).
2011-01-24 10:14:19 -08:00
Adrian Sampson
5cfc7db7b1 move "various artists" detection from autotag module to mb 2011-01-24 08:57:49 -08:00
Adrian Sampson
0c24376e6a migration of album table's artist field to albumartist; fix ls -a 2011-01-23 22:49:52 -08:00
Adrian Sampson
75e0924832 move _sanitize_for_path to module namespace 2011-01-23 19:59:41 -08:00
Adrian Sampson
6ade5635e1 light refactoring and renaming for patch
Changed mb_albumtype to albumtype.
Changed album_artist to albumartist.
Reinstated subset relationship between album fields and item fields.
2011-01-23 19:49:48 -08:00
Adrian Sampson
342c360285 apply jonathan.buchanan's compilation patch from issue #48 2011-01-23 18:41:35 -08:00
Adrian Sampson
3bfae3b78c fix permissions on album art (#130) 2011-01-21 17:57:58 -08:00
Adrian Sampson
1b423f05db fix bug where magic "ftyp" string would cause a Mutagen exception (#129) 2011-01-21 15:11:47 -08:00
Adrian Sampson
0b0d7e0b67 fixes for tests' cross-platformness by jonathan.buchanan 2011-01-20 09:29:09 -08:00
Adrian Sampson
93594bac5a convert import paths to absolute; more _syspath calls
Again, patch mainly due to jonathan.buchanan.
2011-01-20 00:13:00 -08:00
Adrian Sampson
5d79d3e537 add another test to justify mock IO setup 2011-01-19 15:16:31 -08:00
Adrian Sampson
1ee401678e a real system for mocking IO for UI functions 2011-01-19 14:53:03 -08:00
Adrian Sampson
96c2484b02 remove incompletely-isolated test cases; use mock timing functions 2011-01-19 14:19:41 -08:00
Adrian Sampson
4359845a01 prohibit trailing spaces in Windows filenames 2011-01-19 13:17:54 -08:00
Adrian Sampson
5904852e4b use "long filename" support instead of short truncation on Windows (#127)
(Patch by jonathan.buchanan. Thanks!)
2011-01-19 13:14:54 -08:00
Adrian Sampson
ab35db7b7a truncate path components to 30 characters on Windows (work around #120) 2011-01-18 20:13:57 -08:00
Adrian Sampson
ca0d1bc7aa fix unicode issue with manual search prompt (#113) 2011-01-18 19:09:04 -08:00
Adrian Sampson
580e4acf10 WavPack and Musepack support 2011-01-03 15:32:58 -08:00
Adrian Sampson
a23fe1c37f don't copy permissions of imported files 2011-01-01 12:12:55 -08:00
Adrian Sampson
87500cf5c4 fix copying when file is already where it needs to be 2011-01-01 10:49:16 -08:00
Adrian Sampson
43b8235a4c work around Python's graceless handling of invalid LANG 2010-12-31 17:41:50 -08:00
Adrian Sampson
4de44590d0 progress display for non-autotagged imports 2010-09-28 10:29:07 -07:00
Adrian Sampson
7cf10d13e5 fix escaping of / in paths on Windows 2010-09-27 16:56:40 -07:00
Adrian Sampson
ea26e6660e fix a bug where string heuristics could penalize 2010-09-22 20:23:36 -07:00
Adrian Sampson
742ebdf698 "smart" string distance detects common artifacts and reweights them
I've essentially loaded up the string distance function with heuristics that
apply different weights to different kinds of string cruft that one encounters
in music tags. For example, tracks ending with "feat. Somebody" shouldn't be
penalized for all those extra characters. Now the weight of that part of the
string is significantly reduced.
2010-09-21 15:12:20 -07:00
Adrian Sampson
b565a3afd4 fix autotagging of artist !!! via special-casing it 2010-09-18 10:51:16 -07:00
Adrian Sampson
4adb76bb65 fix parsing of escaped characters in MPD commands 2010-09-16 23:06:33 -07:00
Adrian Sampson
4d978f3541 album-level distance function in lastid plugin
This involves yet another new plugin method: album_distance. This leaves as the
last major puzzle piece for lastid the ability to augment the initial search
into MB (i.e., can start a search using fingerprinted metadata).
2010-09-14 14:42:51 -07:00
Adrian Sampson
ac35ef14df clean up MusicBrainz IDs at the MB layer (rather than exposing them) 2010-09-13 22:42:22 -07:00
Adrian Sampson
90c4b550fb make track index weight positive
(I'm not sure why, but the weight for track index mismatches was set to 0.0.
This way, the tagger will be slightly more reluctant to frivolously reorder.)
2010-08-06 11:49:31 -07:00
Adrian Sampson
c3988f7300 safely interpret integers in packed values 2010-08-06 11:17:57 -07:00
Adrian Sampson
633b97b302 decode unicode art paths from legacy databases 2010-08-06 10:44:00 -07:00
Adrian Sampson
898b4bd24e destination now uses album values when available
When computing track destination paths, we now look for album-level values when
they're available. This has the effect of making albums go into a single
directory even when their tracks have heterogeneous metadata. We will need to
revisit this once we start explicitly supporting non-album tracks.
2010-08-06 10:36:17 -07:00
Adrian Sampson
181949d1a3 _sanitize_path now uses a non-unicode regex 2010-08-06 10:01:49 -07:00
Adrian Sampson
d1c6448da8 album art paths now stored in blobs in database 2010-08-06 09:55:21 -07:00
Adrian Sampson
45870e6639 fix failure mode of order_items for length mismatch 2010-08-05 16:34:18 -07:00
Adrian Sampson
2a91ddf40b destinations now return bytestring paths 2010-08-05 13:36:50 -07:00
Adrian Sampson
2950ae1bf6 all paths are now bytestrings (not unicode)
In the end, after all of this, it turns out that we basically need to abandon
the temptation of dealing with unicode paths altogether. The POSIX filesystem
API has no notion of unicode and is very much a bytes-only interface. This
means that undecodable pathnames are a reality we must deal with. This new
approach stores all paths as buffers (blobs) in SQLite and -- as transparently
as possible -- presents them as str objects to the Python code. Legacy
databases will have their paths automatically encoded into str objects, and
will lazily have their unicodes in the database replaced with buffers.
2010-08-05 13:26:30 -07:00
Adrian Sampson
9da55376db basic resuming of crashed tagging via .beetsstate file 2010-08-02 16:08:49 -07:00
Adrian Sampson
61fa32e4ac fixed printing when no locale is set (#78) 2010-07-26 15:07:41 -07:00
Adrian Sampson
7e56cd199d add test ensuring that tagless MP3s are not modified when opened 2010-07-22 13:21:39 -07:00
Adrian Sampson
5b2653bb53 albumify plugin for upgrading old databases 2010-07-22 10:52:43 -07:00
Adrian Sampson
2eb10e391a add "format" field to MediaFile for getting the file type
This allows using $format in your path format string, which is nice.
2010-07-21 23:01:32 -07:00
Adrian Sampson
4b313fdbfb fix a test that was leaving cover.jpg strewn about 2010-07-21 16:19:10 -07:00
Adrian Sampson
11c9b7fad9 move album/art file tests to test_files from test_db 2010-07-21 16:11:08 -07:00
Adrian Sampson
cc3ec0d8aa albums() browse function now returns Album objects
As part of this, the BaseLibrary class was also adapted to include a notion of
albums. This is reflected by the new BaseAlbum class, which the Album class
(formerly _AlbumInfo) completely replaces in the concrete Library. The BaseAlbum
class just fetches metadata from the underlying items.
2010-07-21 15:02:08 -07:00
Adrian Sampson
e9e90fa538 expand set of album metadata to include everything relevant 2010-07-15 11:22:36 -07:00
Adrian Sampson
7816b411ad simplified interface for add_album 2010-07-14 23:04:59 -07:00
Adrian Sampson
6b99e3f48d importer now takes album art config options and switch
(doesn't yet actually apply art)
2010-07-14 14:58:17 -07:00
Adrian Sampson
6a3c024005 add_art convenience function takes care of copying to destination 2010-07-14 14:28:54 -07:00
Adrian Sampson
304e4d6708 albums move and remove their items, manage album art 2010-07-14 14:19:51 -07:00
Adrian Sampson
19ded256cd albums query and modify their associated items 2010-07-14 13:24:11 -07:00
Adrian Sampson
3006f9953c beginnings of explicit album management 2010-07-14 12:40:25 -07:00
Adrian Sampson
5096a12052 basic (non-collected) implementation of albums table 2010-07-13 19:42:45 -07:00
Adrian Sampson
bdbabe91da basic album information access through proxy object 2010-07-13 18:01:14 -07:00
Adrian Sampson
5d4f452393 add "albums" table to library database (including migrations) 2010-07-13 10:25:42 -07:00
Adrian Sampson
57fa6139f7 clean up code for art fetcher; add unit tests 2010-07-12 17:49:23 -07:00
Adrian Sampson
30669fd7ac replace :s with -s instead of _s in path names 2010-07-11 19:12:50 -07:00
Adrian Sampson
ca48d88598 couple of outdated tests: mock Items didn't have MB fields 2010-07-11 18:19:27 -07:00
Adrian Sampson
4378db1361 more characters escaped on Windows 2010-07-11 18:14:40 -07:00
Adrian Sampson
274118dc10 identify albums by existing MB album ID 2010-07-10 20:10:34 -07:00
Adrian Sampson
3d88bbfa96 split autotag tests into autotag (fast) and mb (slow) modules
--HG--
rename : test/test_autotag.py => test/test_mb.py
2010-07-10 19:26:35 -07:00
Adrian Sampson
3ce936701a autotagger now applies MusicBrainz IDs 2010-07-10 18:24:29 -07:00
Adrian Sampson
aec7bef504 add MusicBrainz ID fields to database schema 2010-07-10 17:53:51 -07:00
Adrian Sampson
f4d7d68e57 rudimentary migration (column adds only) support 2010-07-10 17:37:33 -07:00
Adrian Sampson
ac98777adc MediaFile support for MusicBrainz track, album, and artist IDs 2010-07-10 14:05:01 -07:00
Adrian Sampson
6e90009b07 remove outdated references to beets.player module 2010-07-09 18:12:18 -07:00
Adrian Sampson
a91ea35517 misc. overdue code cleanup 2010-07-09 18:07:15 -07:00
Adrian Sampson
e834ffd44f make test suite runnable with "setup.py test" 2010-07-08 11:07:56 -07:00
Adrian Sampson
a0bf6112ae remove dead code: add_path 2010-07-05 21:15:28 -07:00
Adrian Sampson
75ec3fda86 some very basic UI unit tests (for "list" only, for now) 2010-07-05 19:58:30 -07:00
Adrian Sampson
40a965ea18 detect unreadable files that seem to be of the correct type
In the case that Mutagen throws an exception while trying to read a file, we
throw an UnreadableFileError, which is a new superclass for FileTypeError.
2010-07-03 23:44:28 -07:00
Adrian Sampson
4be6edab7b read-only metadata (length & bitrate) support for ogg and ape 2010-06-26 11:01:48 -07:00
Adrian Sampson
cd9cfbe6fc refactor generated and specific mediafile tests into separate modules
--HG--
rename : test/test_mediafile.py => test/test_mediafile_basic.py
2010-06-26 10:52:39 -07:00
Adrian Sampson
3e23b412f4 a few more fields for Monkey's Audio support 2010-06-26 02:24:48 -07:00
Adrian Sampson
f8c8bff694 support some alternate ogg field names 2010-06-26 02:12:55 -07:00
Adrian Sampson
f944952300 preliminary support for ogg voribis
This entailed:
- changing the "flac" storage style option to "etc" to encompass both
  flac and vorbis as the tags are very similar
- permitting multiple StorageStyles per field/format, to allow a
  read-any/store-all approach to multiple field options
2010-06-26 02:07:13 -07:00
Adrian Sampson
ed51369dce track ordering now always uses bipartite matching algorithm, no longer assumes
current metadata to be correct if it's complete

Previously, we were using the Munkres algorithm (minimum bipartite matching) to
order tracks intelligently only as a fallback if the current metadata was
paradoxical or incomplete. This was because of a concern about the performance
of the potentially-O(n^3) Munkres solver. However, it was found that (a) the
performance is actually not bad, taking on the order of 0.02 to perform a
matching, and (b) there was no recourse for the tagger to reorder tracks that
were legitimately in the wrong order. Now, we get intelligent reordering of
badly tagged music even when the metadata seems to be complete.

To retain some of the functionality of the old orderer, the track distance
metric was expanded to include a component reflecting the track index.

In doing this, another bug was discovered in the UI that showed the track name
differences based on an arbitrary ordering. Now, the tag_album function returns
a reordered items list with every candidate.
2010-05-30 23:52:54 -07:00
Adrian Sampson
d1a3311fdd deal with MusicBrainz 503 (server busy) errors by retrying a few times 2010-05-28 11:20:59 -07:00
Adrian Sampson
67c4ec9507 change to MIT license
--HG--
rename : COPYING.txt => LICENSE.txt
2010-05-28 00:07:11 -07:00
Adrian Sampson
f6a0345786 intuitive field restrictions on text queries for browsing functions 2010-04-10 13:17:44 -07:00
Adrian Sampson
6769c9b20d make sure pathnames are unicode everywhere 2010-04-09 15:52:31 -07:00
Adrian Sampson
38801813be Item no longer retains a Library (changed constructors)
--HG--
branch : device
2010-04-06 11:45:31 -07:00
Adrian Sampson
68d43380b4 remove remaining library-interaction methods from Item
--HG--
branch : device
2010-04-06 11:36:00 -07:00
Adrian Sampson
628cfbffe2 Item.move() now takes a library as an argument
--HG--
branch : device
2010-04-06 11:18:41 -07:00
Adrian Sampson
c7f98ccde1 make the PodLibrary interface class more consistent; remove more back-references
from Item to Library

(including removing the delete() method, which was unused)

--HG--
branch : device
2010-04-06 11:07:57 -07:00
Adrian Sampson
4d1944f939 better names: add vs. add_path
--HG--
branch : device
2010-04-06 10:17:53 -07:00
Adrian Sampson
d3d485195c move destination calculation to Library from Item
--HG--
branch : device
2010-04-06 10:07:58 -07:00
Adrian Sampson
ec861e499c better distance, multiple candidates, and distance threshold 2009-12-18 19:21:41 -08:00
Adrian Sampson
4280760191 truncate long filenames 2009-11-28 17:03:36 -08:00
Adrian Sampson
a348e19112 moved per-library settings to config file 2009-11-27 21:18:20 -08:00
Adrian Sampson
85b4d9a129 fixed handling of misnumbered tracks during ordering 2009-11-25 14:30:52 -08:00
Adrian Sampson
71c5141f80 correct super-attribute behavior 2009-11-17 23:15:51 -08:00
Adrian Sampson
0377a0c1e5 crawl for album directories 2009-11-08 20:36:57 -08:00
Adrian Sampson
ce49755200 tolerate missing data 2009-11-02 22:45:07 -08:00
Adrian Sampson
991411da8a method name change in test 2009-11-02 22:16:14 -08:00
adrian.sampson
94b071493b int casting is now more tolerant (allowing "0 BPM" in "It's Blitz")
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40225
2009-05-12 19:56:49 +00:00
adrian.sampson
f6b53142a9 now tolerates space-separated release times
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40221
2009-04-21 07:21:23 +00:00
adrian.sampson
debebc616c fixed safetifying of destination paths
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40220
2009-04-15 05:48:40 +00:00
adrian.sampson
895806e8cc fixed handling of ID3 frames with empty lists
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40218
2009-04-14 03:47:09 +00:00
adrian.sampson
9925a4d8e3 fixed handling of MusicBrainz release dates with no day
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40214
2009-04-13 05:07:31 +00:00
adrian.sampson
4b7119855e BPD now reports empty path components as '(unknown)'
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40201
2009-04-12 01:48:37 +00:00
adrian.sampson
0b309edd27 path encoding now works with slashes better
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40199
2009-04-11 02:51:26 +00:00
adrian.sampson
60848d85ee added GPL license and accompanying notice
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40197
2009-04-09 02:46:22 +00:00
adrian.sampson
155c9f7303 added likely_metadata
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40196
2009-04-07 23:57:19 +00:00
adrian.sampson
7f6ace92be tests for mb.py
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40195
2009-04-07 23:36:02 +00:00
adrian.sampson
1cdf13ea8d PEP8
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40133
2009-02-10 02:54:11 +00:00
adrian.sampson
b6345fdd5d added forgotten test resource
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40131
2009-02-10 02:07:39 +00:00
adrian.sampson
176b14e052 created setup.py and trimmings
--HG--
rename : bts.py => bts
rename : test/alltests.py => test/testall.py
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40130
2009-02-10 00:50:21 +00:00
adrian.sampson
cf556b8166 tolerate times in dates (but ignore them)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40127
2009-02-07 23:55:19 +00:00
adrian.sampson
7d7c625091 limit to 80-character lines
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40121
2009-02-07 04:23:52 +00:00
adrian.sampson
647bd33b8e added bitrate support for flac
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40120
2009-02-07 04:19:07 +00:00
adrian.sampson
b1a45fda0b added bitrate and length to mediafile
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40119
2009-02-07 04:13:36 +00:00
adrian.sampson
22795c7124 added Mon Aug 25 00:52:14 PDT 2008 convenience field for MediaFile
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4089
2008-08-25 07:52:18 +00:00
adrian.sampson
b294b2e1f9 slightly reduced the number of unnecessary tests
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4088
2008-08-25 07:15:58 +00:00
adrian.sampson
08246c5f4b added file necessary for full-date test
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4086
2008-08-04 05:52:00 +00:00
adrian.sampson
1294d573d6 dded full date access to MediaFile (yyyy-mm-dd)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4085
2008-08-04 05:46:44 +00:00
adrian.sampson
fb4344e937 item fields no longer dirtied if unchanged when assigned
This is especially important for read(), which will assign many times while, in many cases, causing few actual changes. A store() that follows soon after will now be much more lightweight.

--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4079
2008-07-09 21:44:15 +00:00
adrian.sampson
e811b72763 fixed but with copying in library.add, tests
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4078
2008-07-08 00:06:56 +00:00
adrian.sampson
4ba801acb7 paths now normalized to absolute (issue 5)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4076
2008-07-07 22:13:52 +00:00
adrian.sampson
c5e06b6f73 fixed double-loading of test modules
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4070
2008-07-07 05:25:14 +00:00
adrian.sampson
cd124d2dad new tests for DB and file operations
Also, new organization for tests and automatic loader. Fixed bugs uncovered by new tests.

--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4069
2008-07-07 05:23:17 +00:00
adrian.sampson
e836a76d0d changed maxdisc and maxtrack to disctotal and tracktotal (clearer)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4064
2008-07-06 20:26:49 +00:00
adrian.sampson
c28efea9a6 changed save_tags to save
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4057
2008-07-06 03:25:12 +00:00
adrian.sampson
ec7e41a904 added FLAC support to MediaFile (with tests)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4054
2008-07-06 00:44:37 +00:00
adrian.sampson
7e24b5d3ca added missing resource for latest mediafile test
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4052
2008-07-03 23:54:38 +00:00
adrian.sampson
526b65a9c3 changed beets.tag to beets.mediafile
--HG--
rename : beets/tag.py => beets/mediafile.py
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4050
2008-07-03 23:22:14 +00:00
adrian.sampson
e69152e958 finished new add(); importing now works
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4040
2008-07-03 21:09:05 +00:00
adrian.sampson
7661a283aa moved intelligence of AndQuery to generic CollectionQuery class (allowing later functionality: OrQuery, for instance)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4015
2008-06-11 07:17:10 +00:00
adrian.sampson
e07131830e eliminated pointless distinction between Queries and QueryElements
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4014
2008-06-11 07:14:37 +00:00
adrian.sampson
f6feb5fbb0 added alltest convenience script
--HG--
rename : test/tagtest.py => test/tag.py
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4013
2008-06-11 07:10:56 +00:00
adrian.sampson
fdb6ff7bb2 added tests for query parser and library.get
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4012
2008-06-11 07:09:39 +00:00
adrian.sampson
2651b1c2b5 cleaned up gratuitous comment blocks and unnecessary shebang lines
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%404
2008-05-14 09:41:15 +00:00
adrian.sampson
ee7bb4b9e8 initial import
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%402
2008-05-14 01:42:56 +00:00