Commit graph

1869 commits

Author SHA1 Message Date
Fabrice Laporte
a06c278a20 add stderr to exception raised by command_output 2014-09-17 21:58:14 +02:00
Fabrice Laporte
26ec2b8d2b artresizer: add check_method()
for the case where we want to know if a specific method is available
2014-09-17 21:55:53 +02:00
Thomas Scholtes
a17e8b54be Flexible SQL columns have TEXT affinity
Reverts 2314f0f9ff

Also implements handling of text values for the base `Type` and
overwrites in the blob-based `PathType`
2014-09-15 01:14:06 +02:00
Thomas Scholtes
e864c2ff43 Document from/to SQL serialization of types 2014-09-15 00:30:34 +02:00
Adrian Sampson
72436644a6 Merge pull request #909 from arogl/master
Clean up of logging messages as described here
2014-09-14 13:14:35 -07:00
Adrian Sampson
cc49c8cc18 Miniscule tweaks for #959 2014-09-14 13:11:47 -07:00
Adrian Sampson
c38d45e273 Merge pull request #959 from geigerzaehler/dbcore-refactor
Refactor DBcore without changing behaviour
2014-09-14 13:10:36 -07:00
Adrian Sampson
67c043532c More docstrings for try_sync (#958) 2014-09-14 12:22:56 -07:00
Thomas Scholtes
fafc56c95b Unify similar code from Type subclasses in base class
Instead of implementing the `parse()` and `format()` methods and
setting the `null` attribute in subclasses, we set the `model_type`
field and the generic implementations of the two methods take care of
the rest.

Again: No change in behaviour!
2014-09-14 17:11:02 +02:00
Thomas Scholtes
30addc12b4 Do not use abstract base class instance
We want to move common code into the base class with out changing the
behaviour of the default type.
2014-09-14 16:47:21 +02:00
Thomas Scholtes
629fc0087d DateType inherits from Float type 2014-09-14 16:17:12 +02:00
Thomas Scholtes
492cf38927 Use item[field] instead of getattr(item, field) 2014-09-14 16:13:35 +02:00
Thomas Scholtes
19d3ca822e Minor simplifications in Model class 2014-09-14 16:13:35 +02:00
Thomas Scholtes
4cfb59bfba Add Type.to_sql() and simplify model code
Instead of encoding the conversion behaviour in the model class (via
the `_bytes_keys` attribute) we define it on the type. This gives us
a more extensible interface and separates logic.

This should not change any behaviour (as one can see by closely staring
at the code).
2014-09-14 16:13:33 +02:00
Thomas Scholtes
4134a5173a Split Type.normalize() responsibilities into normalize() and from_sql()
Previously `normalize()` was used to convert values set by the model API
consumer and values received from the database. These are two
orthogonal uses.

The commit does not change behaviour since the `from_sql()` method uses
the `normalize()` implementation.
2014-09-14 16:13:33 +02:00
Thomas Scholtes
1613a199fa Combine try_write() and store() as try_sync()
This makes sure we store the updated file `mtime`. By providing the
same interface on `Album` and `item` we can also reduce some code
duplication in the `modify` command.
2014-09-14 14:44:32 +02:00
Adrian Sampson
2314f0f9ff Use NONE type affinity for flexattr value column
This is what we should have been using all along---since it allows any type to
appear---but we didn't. 😢
2014-09-14 12:34:46 +02:00
Adrian Sampson
044dbfcd38 NumericQuery: Check that the field exists 2014-09-14 12:34:46 +02:00
Thomas Scholtes
f112c9610c Add 'types' plugin for flexible field types
Conflicts:
	beets/library.py
2014-09-14 12:34:46 +02:00
Thomas Scholtes
475d4899ee Add tests for plugins providing flexible field types 2014-09-14 12:34:45 +02:00
Thomas Scholtes
3cbe9cbd10 Plugins can define types of flexible fields
This partially solves #647.
2014-09-14 12:34:45 +02:00
Adrian Sampson
c57439770b Collapse build_sql into _fetch (#953)
This was getting so short that it made sense to go back from whence it came.
2014-09-13 21:35:19 -07:00
Adrian Sampson
85de214399 Remove SQL ORDER BY sorting option
I don't think anything uses this anymore.
2014-09-13 21:19:32 -07:00
Adrian Sampson
2b921b19fd NullSort instead of None
A more descriptive placeholder for "don't sort".
2014-09-13 20:38:31 -07:00
Adrian Sampson
369533d46f Remove special_sorts
These are not extensible anyway; we'll need another mechanism for that.
2014-09-13 19:47:20 -07:00
Adrian Sampson
76c831a1cd Merge branch 'master' of github.com:sampsyo/beets 2014-09-13 17:19:04 -07:00
Adrian Sampson
4870d7e0fa Roll back fast flexible field sorts (#953)
Sad to see them go, but happy be rid of the SQL injection.
2014-09-13 17:16:12 -07:00
Thomas Scholtes
89c82dc63d fetchart: correctly handle path encoding
* Ensure that `config.as_str_seq()` returns a list of unicode objects.
* Map these to bytestring paths so we can compare them to other paths.

Fixes #887
2014-09-13 16:49:34 +02:00
Adrian Sampson
395be1a0f6 Fix missing super-constructor call 2014-09-12 21:40:00 -07:00
Adrian Sampson
cfb929223e Collapse some duplication in Confit templates 2014-09-12 21:28:32 -07:00
Adrian Sampson
f5b6431488 Flake8 fix 2014-09-12 21:12:44 -07:00
Adrian Sampson
db4e74fd57 Fix mistaken removals 2014-09-12 21:11:53 -07:00
Adrian Sampson
03d0f9dfb3 Fix namedtuple call 2014-09-12 20:59:19 -07:00
Adrian Sampson
bb4082fbfc Style cleanup in sorting 2014-09-12 20:58:25 -07:00
Adrian Sampson
d572bde13b Tiny docs typos
Conflicts:
	docs/plugins/index.rst
2014-09-12 20:58:24 -07:00
Adrian Sampson
ba93d6b176 Move flags back to _raw_main
SubcommandsOptionParser is supposed to be generic.
2014-09-12 20:57:48 -07:00
Thomas Scholtes
7328a09644 Align dispatch of 'version' command with other commands 2014-09-12 17:23:49 +02:00
Thomas Scholtes
5279016db4 config: Add suport for 'key in config' syntax
We can use this instead of the cumbersome `config[key].exists()`.
2014-09-11 16:09:26 +02:00
Thomas Scholtes
7958469b25 mediafile: Zero-padded date format
Tag files with '2000-08-01' instead of '2000-8-1'
2014-09-11 11:48:34 +02:00
Adrian Sampson
832f34c46c --version (fix #939) 2014-09-10 19:36:09 -07:00
Adrian Sampson
6dd6d4770e Skip zero-track matches (fix #942) 2014-09-10 19:08:39 -07:00
Thomas Scholtes
9ee794beb7 Model.load() should remove flexible fields 2014-09-10 17:22:23 +02:00
Thomas Scholtes
8b73681cf3 Remove unused function 2014-09-09 20:23:32 +02:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
d3386df056 Merge remote-tracking branch 'origin/master'
Conflicts:
	beets/importer.py
	beets/ui/commands.py
	beetsplug/lyrics.py
2014-09-09 12:05:38 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
816e4fb152 clean up after rebase 2014-09-09 11:53:44 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
2100dab379 displayable_path clean up error 2014-09-09 11:31:45 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
1b47fb9f1a Just go back to basics 2014-09-09 11:31:44 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
7f0f046f8a Oh the formatting 2014-09-09 11:31:44 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
020ee2b1ed Fix Travis errors
I was over zealous on the brackets for formatting
2014-09-09 11:31:43 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
65de93941d flake8 cleanup
Cleanup after cleanup
2014-09-09 11:28:43 +10:00