Commit graph

5624 commits

Author SHA1 Message Date
Diego Moreda
4afdbdfdf4 Move raw_seconds_short to beets.util 2015-12-09 16:14:08 +01:00
Diego Moreda
0e64275993 Add tests for library-specific field types 2015-12-09 16:07:01 +01:00
Diego Moreda
cca307c88b Fix test that was expecting raw length format 2015-12-05 14:18:23 +01:00
Diego Moreda
62ee915aac Fix pyflakes issues, variable name 2015-12-05 14:12:27 +01:00
Diego Moreda
8d2fda790b Add config option for human vs raw track duration
* Add "format_raw_length" global configuration option to allow the user to
toggle between human-readable (default) or raw formatting of track durations.
2015-12-05 13:28:56 +01:00
Diego Moreda
67eb0ed54c Format track duration as H:MM instead of seconds
* Modify library.Item in order to have length formatted as H:MM instead of the
raw number of seconds by using a types.Float subclass (DurationType).
* Add library.DurationType, with custom format() and parse() methods that
handle the conversion.
* Add dbcore.query.DurationQuery as a NumericQuery subclass that _convert()s
the ranges specified by the user to floats, delegating the rest of the
functionality in the parent NumericQuery class.
* Add ui.raw_seconds_short() as the reverse of human_seconds_short(). This
function uses a regular expression in order to allow any number of minutes, and
always required SS to have two digits.
2015-12-04 20:51:25 +01:00
Adrian Sampson
5c8acc9a49 Fix #1721 by disabling \\?\ prefix for IM 2015-11-30 08:00:34 +01:00
Adrian Sampson
a333777946 Merge pull request #1737 from diego-plan9/mbtracks
info plugin: Allow custom formatting and human-readable lengths
2015-11-26 10:31:12 -08:00
Diego Moreda
3cdcaa45a8 info: modify emitter output, clearer path handling
* Make emitters produce a pair (dict, Item), in order to preserve the output
at print_data (dict is used if no custom format is specified, Item otherwise).
* Simplify the handling of the paths, printed at the top of print_data. The
path key is removed from the dict entirely and fetched from the Item.
2015-11-26 15:55:00 +01:00
Adrian Sampson
cd687e7bef Merge pull request #1738 from diego-plan9/querysort
Documentation update: followup to #1736, fix typo on inline.rst
2015-11-25 17:32:09 -08:00
Diego Moreda
47ceb492dc Add docs note for custom-field sorting, fix typo
* Add note about ordering when sorting by custom-fields on query.rst.
* Fix typo on inline.rst.
2015-11-25 19:15:01 +01:00
Diego Moreda
a8f9f016d8 info: add format note to docs 2015-11-25 18:12:04 +01:00
Diego Moreda
be5138376b info: add changelog entry for format option 2015-11-25 18:04:49 +01:00
Diego Moreda
ca63311101 info: revert human_length changes 2
* Remove human_length parameter from print_data()
2015-11-25 17:36:51 +01:00
Diego Moreda
83279ebe5b info: revert human_length changes
* Remove human length changes from the plugin and the tests, as they will
eventually be handled at a higher level.
2015-11-25 16:06:19 +01:00
Adrian Sampson
155727a227 Merge pull request #1736 from diego-plan9/querysort
Fix for crash when sorting by nonexistent field (#1734)
2015-11-24 20:05:54 -08:00
Diego Moreda
0ed3f4067a Add changelog entry for nonexistent fields sorting 2015-11-24 19:43:48 +01:00
Diego Moreda
2bce87cd3f Merge remote-tracking branch 'upstream/master' 2015-11-24 19:41:13 +01:00
Diego Moreda
455fd0e352 Fix sorting by nonexistent field (#1734), tests
* Fix crash when sorting by nonexistent field.
* Add tests for queries with nonexistient fields for sorting.
2015-11-24 19:37:30 +01:00
Diego Moreda
67af8af7dd info: add unit tests
* Add tests for length (human/raw, library/path) and custom format.
2015-11-24 17:16:14 +01:00
Diego Moreda
8d9db9ffe6 info: minor cleanups
* Rename filter() function to avoid warning of reserved built-in symbol.
* Remove mediafile fixture on two tests.
2015-11-24 16:41:56 +01:00
Diego Moreda
1ef407672a info: add item format and length format arguments
* Add custom output formatting via a format string to InfoPlugin. The command
accepts a formatting string via the "-f" parameter, which is handled by its
CommonOptionsParser and applied during print_data().
* Modify the emitters in order to include an Item into the list of fields, that
is formatted according to the format string if specified.
* Add an argument to allow the user to choose if track lengths are displayed as
raw floats or using a human-readable form (mm:ss), defaulting to human-readable
form.
2015-11-24 16:31:01 +01:00
Adrian Sampson
6958f83dd6 Fix test for richer CalledProcessError 2015-11-23 22:55:51 -08:00
Adrian Sampson
4ccf81534e Even more ImageMagick error logging (#1721) 2015-11-23 22:47:52 -08:00
Adrian Sampson
c90ca1096c fetchart: Log reasons for rejecting art 2015-11-23 17:30:09 -08:00
Adrian Sampson
0a719a0152 Fix formatting in logging for #1721 2015-11-22 10:30:20 -08:00
Adrian Sampson
1d0984a294 Slight log rewording 2015-11-21 12:54:50 -08:00
Adrian Sampson
e55b01c2bb Better artresizer error logging
Should help diagnose #1721.
2015-11-21 12:52:19 -08:00
Adrian Sampson
eb68177fee Fix #1735: convert --pretend encoding error 2015-11-21 12:40:45 -08:00
Adrian Sampson
9702011884 Changelog for #1433 2015-11-20 11:28:51 -08:00
Adrian Sampson
6c0f43cf1c Thumbnails: Fix string memory management
Should fix #1433. The problem now was that we were freeing the string memory
that Python expected to be managing in a string object held by the `uri`
variable. Now, we do a silly dance to copy the memory out of the buffer
returned by the library and return that instead.
2015-11-20 11:26:35 -08:00
Adrian Sampson
530b42156b Thumbnails: Declare more interface types
Seems to address a segfault indicated in #1433, but there are still crashes
lurking.
2015-11-20 10:55:25 -08:00
Adrian Sampson
fd2cacbc25 Minor docs refinements for #1728
- Use a marginally more realistic example in the changelog.
- The -- convention is actually not the purview of shells; it's just a de
  facto standard for command-line parsers. Fortunately, argparse supports it
  out of the box.
2015-11-20 10:07:29 -08:00
Adrian Sampson
6cb8db3b2e Merge pull request #1728 from diego-plan9/notquery
Add boolean "not" query operator
2015-11-20 10:00:05 -08:00
Diego Moreda
51bf6a1c9f Add documentation for NotQuery, cleanup
* Add changelog and query.rst documentation entries for the usage of negated
queries.
* Cleanup NotQuery class as suggested during code review (PEP conforming
docstring, clarification on empty clause match behaviour).
2015-11-20 18:06:22 +01:00
Peter Kessen
49a1e3c5d5 Merge pull request #1733 from pkess/fix_encoding
Fixed missing encoding definition in python files
closes #1722
2015-11-19 21:16:40 +01:00
Adrian Sampson
27b5b407c2 Fix #1732 by importing ctypes on demand 2015-11-19 10:10:17 -08:00
Peter Kessen
0e5a1e6b00 added encoding to beet itself 2015-11-19 19:09:11 +01:00
Adrian Sampson
7233173507 Fix some outdated comments 2015-11-19 10:08:37 -08:00
Peter Kessen
f5eca77117 added encoding as comment
last file for encoding check
python3 file without license
2015-11-19 18:54:02 +01:00
Peter Kessen
6b408507f6 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files without license
2015-11-19 18:52:57 +01:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Diego Moreda
40bfed756b Revise not query syntax, cleanup, modify docstring
* Revise the NotQuery syntax, replacing the '¬' character with '^'. Fix tests
to conform to this change, and cleanup the PARSE_QUERY_PART_REGEX.
* Modify parse_query_part() docstring to mention the negate parameter on the
returned tuple, and added an example.
2015-11-19 18:04:47 +01:00
Diego Moreda
e69b3b3c5d Fix NotQuery assertion by using sets, not lists
* Fix issue with an assertion that was order-sensitive and caused a problem on
some tox runs.
2015-11-18 17:40:47 +01:00
Diego Moreda
e457479558 Add NotQuery syntax tests
* Add tests to NotQueryTest for testing the results of using queries with
negation.
* Fix issue on test_dbcore due to the modifications on the tuple returned by
parse_query_part (the number of elements was changed from 3 to 4).
2015-11-18 17:27:22 +01:00
Diego Moreda
0293504a24 Update negation query syntax, prefix always first
* Update the negation query sintax so that the negation prefix ("-" or "¬") is
always the first part of a query, instead of after the ":" separator.
* Modify queryparse, so that the detection of the negation is done inside
parse_query_part() (using the modified PARSE_QUERY_PART_REGEX, and returning
the negation flag) instead of construct_query_part.
* Revert the prefixes dict on beets.library to the original dict (only one item,
with the RegexpQuery prefix).
2015-11-18 16:59:50 +01:00
Diego Moreda
dd8b80e320 Make NotQuery subclass Query, update tests
* Modify NotQuery so it subclasses Query instead of MutableCollectionQuery.
* Update instances where NotQuery objects are created on tests and queryparse,
as NotQuery expects a single Query as a parameter to the constructor instead of
a list of Queries.
2015-11-18 14:54:20 +01:00
Diego Moreda
f2c8e9ff07 Add "not" query operator, initial draft
* Add support for user friendly "not" operator in queries without requiring to
use regular expressions, via adding NotQuery to beets.dbcore.query.
* Update the prefix list at library.parse_query_parts() and the query parsing
mechanisms in order to create a NotQuery when the prefix is found.
* Add two TestCases, NotQueryMatchTest as the negated version of MatchTest, and
the more generic NotQueryTest for testing the integration of the NotQuery with
the rest of the existing Query subclasses.
2015-11-16 21:36:42 +01:00
Peter Kessen
ecbd337c47 Added file encoding definition to badfiles.py 2015-11-15 14:51:12 +01:00
Adrian Sampson
e39dede8b4 Merge pull request #1720 from Schweinepriester/master
Replace PIL with Pillow
2015-11-15 00:18:27 -08:00