Commit graph

3860 commits

Author SHA1 Message Date
Fabrice Laporte
f5520d7ec9 fix flake8 warnings 2014-09-20 12:27:27 +02:00
Fabrice Laporte
d684229816 skip art compare tests if no recent IM version 2014-09-20 12:26:36 +02:00
Fabrice Laporte
1c2448c3e0 add can_compare flag to ArtResizer 2014-09-20 12:19:10 +02:00
Fabrice Laporte
e731990888 check_method return method version, add _can_compare() 2014-09-19 17:30:29 +02:00
Fabrice Laporte
cf372f72a6 reduce image sizes 2014-09-17 22:57:50 +02:00
Fabrice Laporte
1bffe2a7bf obey Travis orders 2014-09-17 22:57:38 +02:00
Fabrice Laporte
187497c8c6 embedart: docs. explain 'compare_threshold' option 2014-09-17 22:07:35 +02:00
Fabrice Laporte
3ec8902ea4 embedart: add tests for 'compare_threshold' option
was tricky to write meaningful tests when computing phash of existing 6
pixels image (image-2x3.jpg) so I added new -more representatives-
images.
2014-09-17 22:04:45 +02:00
Fabrice Laporte
e99df7bc65 embedart: add compare_threshold option
if compare_threshold > 0 we call check_art_similarity to return sooner
if it happens that candidate image and embedded one are similar.
2014-09-17 22:01:08 +02:00
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
a92493cf12 Test queries on boolean fields 2014-09-15 00:48:18 +02:00
Thomas Scholtes
e5da5757c0 Preserve state in query tests 2014-09-15 00:36:24 +02:00
Thomas Scholtes
e864c2ff43 Document from/to SQL serialization of types 2014-09-15 00:30:34 +02:00
Adrian Sampson
77f7d18c00 Remove stray comment from #909
Yes, it is necessary.
2014-09-14 13:15:42 -07: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
67b1ac46d7 Changelog for importfeeds echo (#955) 2014-09-14 13:06:25 -07:00
Adrian Sampson
20968a92ee Merge pull request #955 from robotanarchy/master
importfeeds: add new 'echo' type that writes to stdout
2014-09-14 13:03:59 -07:00
Adrian Sampson
67c043532c More docstrings for try_sync (#958) 2014-09-14 12:22:56 -07:00
Adrian Sampson
5ba3d98631 More docs/changelog for flex types (#951) 2014-09-14 12:10:47 -07:00
Adrian Sampson
8ec4f8bc24 Merge pull request #958 from geigerzaehler/item-sync
Update database mtimes in modify and write commands
2014-09-14 12:09:55 -07:00
robotanarchy
2039d2effe don't use the _write_m3u function for stdout stuff 2014-09-14 20:17:53 +02: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
Lucas Duailibe
b1a5189f68 Add default value for relative_to in play plugin 2014-09-14 12:07:08 -03: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
b86669fe05 Add integer query tests 2014-09-14 16:11:13 +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
Thomas Scholtes
84acf17855 Test that mtimes are updated when writing files
Follows the discussion in #937 and the wiki [1].

[1]: https://github.com/sampsyo/beets/wiki/Architecture#modification-times-mtime
2014-09-14 14:19:11 +02:00
Thomas Scholtes
3fe52a7694 Add test helpers to create database fixtures 2014-09-14 14:16:34 +02:00
Thomas Scholtes
bd871cbc03 Don’t interact with files in TypePluginTest 2014-09-14 14:00:34 +02:00
Thomas Scholtes
ffc75c333d Merge branch 'flextypes' 2014-09-14 13:16:43 +02:00
Thomas Scholtes
80f3ec1ed7 Document flexible field types in plugins 2014-09-14 13:15:47 +02:00
Adrian Sampson
d081b6a220 Docs for types plugin 2014-09-14 12:35:47 +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
5dec867ab3 mpdstats: set types for flexible fields 2014-09-14 12:34:46 +02:00
Thomas Scholtes
d4f72f62eb echonest: set types for flexible fields
Conflicts:
	beetsplug/echonest.py
2014-09-14 12:34:46 +02:00
Thomas Scholtes
aa24fa7c1b Fix tests on python2.6 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
Thomas Scholtes
9a732fbd26 Converted files are tagged and checked in tests
The conversion function either copies files or runs the conversion
command on them, depending on the result of the `should_transcode()`
function. This commit makes the tests more sensitive to these cases.
2014-09-14 12:17:05 +02:00