Commit graph

60 commits

Author SHA1 Message Date
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Adrian Sampson
d1adaa9cb7 Merge pull request #1749 from diego-plan9/humanlength
Format length as M:SS by default
2015-12-12 17:29:56 -08:00
Diego Moreda
3e2d2479b5 Fix test that depended on local time, 2 2015-12-09 16:42:47 +01:00
Diego Moreda
25cb556ea2 Fix test that depended on local time 2015-12-09 16:40:14 +01:00
Diego Moreda
2f2cdd24da Fix unused import leftover on test_library 2015-12-09 16:31:45 +01:00
Diego Moreda
0e64275993 Add tests for library-specific field types 2015-12-09 16:07:01 +01:00
Peter Kessen
ceafad2651 Fixed testcase TestLibrary.test_write_with_custom_path
on windows it is important to use syspath with functions
to modify path
2015-12-05 15:05:25 +01:00
Peter Kessen
c086a634b6 Fixed testcase TestLibrary.test_no_write_permission
on windows it is important to use syspath with functions
to modify path
2015-12-05 14:58:03 +01:00
Ben Ockmore
de17d000bd Rewrote path legalization code to be two module functions rather than class methods. Also made algorithm more predictable, and added an extra test. 2015-07-07 01:17:12 +01:00
Ben Ockmore
d07c8fde69 Added loop to iterate over sanitize/truncate until stable. Enabled test_truncation_does_not_conflict_with_replacement test. Fixes #496. 2015-07-06 14:57:15 +01:00
Adrian Sampson
56ca69d63d Fix #1404 by only writing _media_fields
This just makes "date" and "original_date" into ordinary flexible fields,
which is probably the way it should be.
2015-04-16 19:55:48 -07:00
Bruno Cauet
58b39f1000 Merge branch 'master' into subcommand-auto-format-path 2015-03-05 17:53:31 +01:00
Bruno Cauet
f14f47f059 Renamed list_format_* into format_* 2015-03-04 16:51:28 +01:00
Adrian Sampson
e14f28fdda Merge pull request #1330 from brunal/path-query-case-sensitivity
Fix path query case sensitivity

Conflicts:
	docs/changelog.rst
2015-03-01 17:01:45 -08:00
Bruno Cauet
cb504ad163 library.parse_query_string: assert query is unicode 2015-03-01 15:01:27 +01:00
Bruno Cauet
952081e5ed Revert "InvalidQueryError: resist to any query"
This reverts commit 9e5e7a28e5.
2015-03-01 14:52:31 +01:00
Adrian Sampson
ccbe907971 Add (skipped) test for #496 2015-02-24 22:18:05 -08:00
Bruno Cauet
9e5e7a28e5 InvalidQueryError: resist to any query
Even though queries may not contain non-utf8 code points
InvalidQueryError ought to be prudent, for such an invalid query would
raise an InvalidQueryError which therefore has to be able to manipulate
the invalid query.
2015-02-18 19:31:07 +01:00
Bruno Cauet
489b6b2e7e Move many tests from test_library to test_util
Sice they only test functions from beets/util/__init__.py there's not
reason for them to reside in test/test_library.py.
2015-02-16 11:53:01 +01:00
Tom Jaspers
9cdd541943 Error handling for 'filesize' field
- Logs a warning and returns 0 if getsize fails
- Add tests for this

Fix #1326
2015-02-13 12:24:21 +01:00
Bruno Cauet
e1e46df1b3 Fix path truncation test: really use bytes
Test is to use bytes but because of __future__.unicode_literals it used
unicode.
2015-02-12 11:56:54 +01:00
Bruno Cauet
7476d6be46 InvalidQuery*Error extend ParsingError
And InvalidQueryArgumentTypeError does not extend TypeError anymore.
2015-02-09 19:25:23 +01:00
Bruno Cauet
54887e7655 Widen usage of InvalidQueryError
Replace previous InvalidQueryError with InvalidQueryArgumentTypeError
which extends the former as TypeError. However they lack context: the
query that caused the error.

Raise an InvalidQueryError when a shell-like expression cannot be parsed
by shlex.

Improve #1290.
2015-02-09 15:28:06 +01:00
Thomas Scholtes
51ab099145 Extend item.write() to embed images without changing item
Fixes #1241 and geigerzaehler/beets-check#14

Before, `embed_item` would add the images to the item and then call
`item.write()` to write the item data, including the image, to the
file. This would trigger `item.store()` in the `after_write` hook of
the check plugin. This would in turn try to persist the temporary
`images` attribute of the item, resulting in an SQL error.
2015-02-01 15:35:24 +01:00
Bruno Cauet
dbef31776f Replace ur'' strings by r'' strings
Since we use unicode_literals they are equivalent, but ur'' strings are
a syntax error in python 3.0+
2015-01-27 09:02:44 +01:00
Adrian Sampson
b8dab9cf9f Merge pull request #1247 from brunal/future
Use all __future__ imports in beets core

Conflicts:
	beetsplug/web/__init__.py
	test/test_embedart.py
2015-01-26 17:02:07 -08:00
Bruno Cauet
060c275fd3 Merge branch 'master' into libmodels-formatting
Conflicts:
	beetsplug/embedart.py
2015-01-26 10:17:15 +01:00
Bruno Cauet
bd29ab21e1 Delete outdated disabled test in test_library.py
TemplateTest.album_fields_override_item_values() never ran because of
its name (missing 'test_' prefix). When run it now fails for it targets
outdated functionality.
2015-01-25 21:38:29 +01:00
Bruno Cauet
73d200184b Implement __format__ on Album and Item
Cut the need to format manually (and often incorrectly) when logging by
implementing the __format__ magic method (see PEP 3101) on LibModel
(the parent class of Album & Item).

Based on a discussion in PR #1262
2015-01-25 19:41:49 +01:00
Bruno Cauet
02d8e88ef1 Replace all mentions of 'str' with 'bytes' 2015-01-20 12:48:15 +01:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet
2dab8e5fd6 Import unicode_literals in beets package 2015-01-19 21:41:33 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Bruno Cauet
2902cda036 tests: use absolute imports everywhere 2015-01-19 12:25:15 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Adrian Sampson
daeab3d3a9 Add (skipped) tests for #359 2014-11-22 21:48:06 -08:00
Adrian Sampson
36d332ab6a Fix #856: album dirty tracking 2014-11-13 23:25:16 -08:00
Thomas Scholtes
91c5d0ae12 Item fields take precedence over Album fields in formatting
For consistency, this is reversed when formatting paths. Fixes #858.
2014-08-25 14:38:58 +02:00
Thomas Scholtes
0798af7774 Refactor model formatting
Remove all formatting related code from models. It now lives in the
`FormattedMapping` class. Only API change is from `model.formatted` to
`model.formatted()`.
2014-08-25 14:24:39 +02:00
Thomas Scholtes
76c7ba9186 Add asciify_paths configuration option 2014-08-06 17:53:44 +02:00
Thomas Scholtes
b5426f72a1 Wrap mediafile read exceptions in library.ReadError
The ui only handles library Exceptions. Fixes #857.
2014-07-06 13:19:43 +02:00
Adrian Sampson
10d0572214 Tiny style fixes for #854 2014-07-01 23:10:50 -07:00
philipbjorge
9e6f31eef0 Fixed flake8 errors 2014-07-01 19:41:43 -07:00
philipbjorge
16ef9a7aeb Added unit test for Library unicode filenames #833 2014-07-01 19:19:55 -07:00
Adrian Sampson
908584bde8 Revamp FormattedItemMapping
This subclass was not cleanly conforming to the Mapping abstract base. Now
we're in business -- the thing looks like a dict. Brought up by #782.
2014-05-20 16:24:40 -07:00
Ayberk Yilmaz
f67ace610a Fixed #453 and added test cases 2014-04-16 23:16:04 +03:00
Adrian Sampson
9dd4ad96bd syspath: correctly prefix Windows UNC paths
Identified while tackling #670, but this should actually solve some legitimate
problems with cataloging music on a network drive.
2014-04-13 13:19:03 -07:00
Adrian Sampson
77eddaa2d1 properly sandbox all tests
All filesystem writes are now to temporary directories. (Long ago, the policy
was to put temporary stuff in _RSRC, but that was a pretty bad idea.)
2014-04-12 19:29:29 -07:00
Thomas Scholtes
4970c1de5a Add tests for item.write() custom path 2014-04-04 15:19:32 +02:00
Thomas Scholtes
574903e986 Add FileOperationError and handling in item.write() 2014-03-24 14:22:27 +01:00