Commit graph

3424 commits

Author SHA1 Message Date
Pierre Rust
0799ad16c4 Merge remote-tracking branch 'origin/master' into optimize-model-init 2014-05-08 10:46:37 +02:00
Pierre Rust
6d5c5824b5 Move Model initialization in a separate method
The idea is that we can apply special treatment in subclasses when
needed, especially for path normalization.
2014-05-08 10:44:44 +02:00
Adrian Sampson
6ecf4ef6ed Release script: upload command 2014-05-06 22:16:19 -07:00
Adrian Sampson
611be7b4b5 Release script: convert changelog to Markdown 2014-05-06 22:06:28 -07:00
Adrian Sampson
d641927ad8 Fix formatted.get calls 2014-05-06 15:57:04 -07:00
Pierre Rust
60160c38a0 Shortcut some tests in Model initialization
When Model objects (Albums and Items) are loaded from the database a lot of time is wasted checking if the object is dirty and if fields are fixed or flexattr.

This change alow bypassing these checks when we know that the data is correct ; it should only be used when loading Model from the database.

With this, listing all tracks in my test database (8200 items) takes 4 seconds while it took 31 seconds previously.
2014-05-07 00:30:39 +02:00
Adrian Sampson
6b3bea99a0 Changelog for faster queries (lazy formatting) 2014-05-06 12:01:13 -07:00
Adrian Sampson
c08e07d31b Property for easy FormattedMapping access 2014-05-06 11:54:56 -07:00
Adrian Sampson
e800b46a5d Make FormattedMapping behave more like a dict
The collections.Mapping abstract base class provides all the nice dict-like
functionality we need.
2014-05-06 11:32:20 -07:00
Adrian Sampson
d30e2f597f Merge pull request #751 from sampsyo/lazy-formatted-mapping
Make _formatted_mapping lazy and an object
2014-05-06 11:16:58 -07:00
Thomas Scholtes
335247481f Make _formatted_mapping lazy and an instance
The motivation for this is to increase the performance of template evalutation.

Previously, the `model._formatted_mapping()` method returned a dictionary that
served as the environment (mapping of variable names to values) when evaluating
a template. To populate the dictionary, we iterated over all keys in the model,
formatted the values, and assigned it to the dictionary. This meant we
formatted every field, even if the template did not require it.

With this commit `_formatted_mapping()` does not return a populated dictionary
but a proxy (or view) instance. The object only knows about the model and the
keys it provides the formatted view for. If a variable is requested by the
template it computes the formatted value on the fly.

The class-based approach has one additional advantage: In the future, we can
separate the formatting logic from the database logic.
2014-05-06 11:24:51 +02:00
Adrian Sampson
066c4e1655 Release script: extract changelog 2014-05-02 14:09:59 -07:00
Adrian Sampson
1613f9b773 Release script: build command 2014-05-02 14:09:59 -07:00
Adrian Sampson
064013605a Changelog for #742 2014-05-01 21:16:48 -07:00
Adrian Sampson
27804ce68b Merge pull request #742 from tsigo/rs-before_item_moved-event
Add before_item_moved event
2014-05-01 21:14:37 -07:00
Adrian Sampson
5b671a0465 Start version-number-bumping utility 2014-05-01 17:38:31 -07:00
Robert Speicher
a7c996d3af Add before_item_moved event
This event gets called just before `util.move` with the same arguments
as the `item_moved` event.
2014-05-01 20:38:07 -04:00
Adrian Sampson
6cc643520d Merge branch 'KraYmer-lyrics-integration-sources' 2014-05-01 08:58:07 -07:00
Adrian Sampson
9b160bb81d Travis: YAML syntax
I feel incredibly dumb.
2014-04-29 22:35:34 -07:00
Adrian Sampson
de2b2ad407 Travis: use explicit $COVERAGE variable
This makes the conditionals a little easier to read.
2014-04-29 22:34:09 -07:00
Adrian Sampson
534c57a78c Travis: one more try
This is horrible. Apparently, I need to *only* use `matrix.include`, none of
the other options (which fill out the matrix automatically).
2014-04-29 22:28:19 -07:00
Adrian Sampson
e29cb67c89 Travis: hopefully fix Travis matrix
The documentation here is completely unclear (does "include" exclude
everything else?). I hope this works.
2014-04-29 22:27:13 -07:00
Adrian Sampson
7f69f90462 Travis: deal with new build environments
The latest Travis updates seem to only install the requested Python.
Previously, we assumed we had all Pythons even when the requested Python was
the default.
2014-04-29 22:21:14 -07:00
Adrian Sampson
9101b88499 Slightly shorter description of autotag
Brevity is the soul of documentation.
2014-04-29 21:57:39 -07:00
Adrian Sampson
78dc45c44c Merge pull request #734 from EvanPurkhiser/doc/import.autotag
Document 'import.autotag' configuration
2014-04-29 21:54:37 -07:00
Evan Purkhiser
63fc7e04e6 docs: Document 'import.autotag' configuration 2014-04-30 00:14:49 -04:00
Adrian Sampson
e19632c11d Merge branch 'master' of github.com:sampsyo/beets 2014-04-29 10:23:30 -07:00
Adrian Sampson
54445882d8 replaygain: Log when files are unsupported 2014-04-29 10:23:07 -07:00
Adrian Sampson
362db8f22f Merge pull request #728 from sampsyo/lastgenre-tests-new
Tests for lastgenre (cleaned up)
2014-04-29 08:38:56 -07:00
Adrian Sampson
2fac1567ec Remove redundant quotes in exception
Indicated in #731.
2014-04-29 08:34:56 -07:00
Adrian Sampson
233f71a457 Use real booleans for whitelist/canonical options
As opposed to the strings "true" and "false".
2014-04-28 23:00:00 -07:00
Adrian Sampson
add309b57d Isolate lastgenre tests
We now appropriately set up and tear down the fixture for the lastgenre tests.
(This was causing unpredictable failures elsewhere before.)
2014-04-28 22:35:32 -07:00
Fabrice L.
f6337d2d1f Update lastgenre.rst 2014-04-28 10:44:53 +02:00
Fabrice L.
5a0a97c7e0 undo previous commit (wrong branch) 2014-04-28 10:43:21 +02:00
Fabrice L.
6fff2a5097 Update lastgenre.rst 2014-04-28 10:38:17 +02:00
Fabrice Laporte
ef3c1cd1ff use booleans for whitelist and c14n options
homogenise options setup using booleans, while keeping the empty string
(synonym of ‘true’) for backward compatibility.
2014-04-28 10:31:22 +02:00
Adrian Sampson
d5dbaeff7a lastgenre: Restore default whitelist 2014-04-27 13:54:32 -07:00
Adrian Sampson
dfd9a4c397 Merge branch 'KraYmer-lastgenre-tests-new' into lastgenre-tests-new
Conflicts:
	test/test_lastgenre.py
2014-04-27 13:52:06 -07:00
Fabrice Laporte
d1cc95984e Rename/add tests
Rewrite tests now that empty whitelist is allowed.
2014-04-27 22:32:31 +02:00
Fabrice Laporte
0613cb7d13 Update _setup_config
Give an empty string to obtain default whitelist, None for no whitelist
or a stringlist for a custom one.
2014-04-27 22:31:31 +02:00
Fabrice Laporte
0b3c5ddbe0 Canonicalization only return most common genre 2014-04-27 22:27:20 +02:00
Fabrice Laporte
817b8cc96e Allowing the whitelist to be disabled
By default it is disabled, setting the value to the empty
string will use the built-in whitelist (same behaviour than
c14n).
2014-04-27 22:26:09 +02:00
Fabrice L
4af96f316d fix mailing list link 2014-04-27 10:45:01 -07:00
Adrian Sampson
9f5f70aeab Merge pull request #720 from sampsyo/import-refactor
Import refactor
2014-04-27 09:51:10 -07:00
Fabrice L.
e442749cd4 add a test that would fail with the restricted whitelist approach
If no option is set, valid genres should not be rejected. Which is an argument
to have a wide default whitelist.
2014-04-27 16:05:16 +02:00
Fabrice Laporte
e399173f7e add a test that would fail with the restricted whitelist approach
If no option is set, valid genres should not be rejected. Which is an argument
to have a wide default whitelist.
2014-04-27 15:59:43 +02:00
Adrian Sampson
35b6602795 Use self.config instead of global config 2014-04-26 21:00:59 -07:00
Adrian Sampson
e7af3319f8 lastgenre: Restore min_weight option 2014-04-26 20:59:39 -07:00
Fabrice Laporte
d0d3c18da2 lastgenre: rewrite filtering logic to make tests pass
- remove filter_tags() as genres should not be removed this soon while
c14n has not been applied
- group all filtering logic in the function _resolve_genres (formerly
_strings_to_genre)
2014-04-26 20:51:13 -07:00
Fabrice Laporte
2e8e55736d get rid of module level options variable
Conflicts:
	beetsplug/lastgenre/__init__.py
2014-04-26 20:51:00 -07:00