Commit graph

765 commits

Author SHA1 Message Date
Adrian Sampson
9607b258a5 fromfilename: simplify 2013-09-13 21:14:10 -07:00
Adrian Sampson
b8f01f0cfa fromfilename: preserve case, apply in more cases 2013-09-13 21:05:51 -07:00
Adrian Sampson
3f6eb4be24 fromfilename: switch to declarative style
No need for redundant handleXfields methods; we'll just inspect the fields
we're given.
2013-09-13 20:48:12 -07:00
Adrian Sampson
9e1e55e6a5 fromfilename: python style, naming, comments 2013-09-13 20:34:05 -07:00
Adrian Sampson
47999dc759 initial import of tags-from-filename plugin (#113)
This was contributed via email. Now I'll clean it up for inclusion.
2013-09-13 19:50:12 -07:00
Adrian Sampson
09d724db3f Merge pull request #380 from rowan-lewis/convert-all
Allow the convert plugin to convert to any format, not just mp3.
2013-09-13 19:32:57 -07:00
Adrian Sampson
b3bc4d3622 mbcollection: skip invalid MBIDs 2013-09-13 19:13:36 -07:00
Adrian Sampson
c57f2d0b78 merge 2013-09-13 18:58:30 -07:00
Rowan Lewis
80d060db07 Added 'quiet' operation mode, prevents start/finish announcements for each file. 2013-09-14 10:18:36 +10:00
Rowan Lewis
52d86f0e6a Added more format presets, updated documentation. 2013-09-14 09:35:25 +10:00
Rowan Lewis
d2327d2dcf Fixed validation, basically replace unfriendly errors with friendly errors. 2013-09-14 07:27:15 +10:00
Rowan Lewis
d3dae9f089 Reject lossy formats under a set bitrate. 2013-09-13 08:13:30 +10:00
Rowan Lewis
53aba3ce3f It's called Vorbis, not OGG. 2013-09-13 07:57:04 +10:00
Rowan Lewis
bfbf5a9215 Changed the configuration to allow for easier format selection. 2013-09-13 07:54:36 +10:00
Adrian Sampson
19958f75ff embedart: fix error message when imagehdr fails 2013-09-12 10:45:02 -07:00
Rowan Lewis
697e70f14b Problem with unicode filenames sorted. 2013-09-12 22:21:50 +10:00
Rowan Lewis
697cf3fd65 Removed reference to my testing plugin, oops. 2013-09-12 20:22:18 +10:00
Rowan Lewis
21c9855c4f Allow the convert plugin to convert to any format, not just mp3. 2013-09-12 20:09:53 +10:00
Adrian Sampson
fa97684e7b fix outdated _record reference in web plugin 2013-09-09 20:56:38 -07:00
Adrian Sampson
4ee4169349 simplify get_query using class attributes 2013-09-09 20:20:22 -07:00
Adrian Sampson
f70ddfbd1d deduplicate albums() and items() methods
This also drops the keyword arguments to these methods, which were vestigial.
2013-09-08 23:18:58 -07:00
Adrian Sampson
d80576fec1 get rid of dictionary comprehensions
for Python 2.6 compatibility
2013-08-29 17:07:04 -07:00
Adrian Sampson
343a85d482 mbsync: use separate structure for old_data
Assigning an attribute on Items doesn't really work here since we try to store
that value to the DB as a flexattr.
2013-08-23 14:01:31 -07:00
Adrian Sampson
5e09c5e473 convert: fix iteration over results 2013-08-22 17:33:56 -07:00
Adrian Sampson
c7fe017752 remove Library.{move,store} methods
These methods are now provided by LibModel, which makes dealing with items and
albums symmetric.
2013-08-21 15:34:45 -07:00
Adrian Sampson
deef7f9d20 a few more necessary album.store()s 2013-08-21 11:23:09 -07:00
Adrian Sampson
6677cea036 fix uses of item.dirty and item.record 2013-08-21 10:57:52 -07:00
Adrian Sampson
ec10f8c223 remove count() calls
I removed this method in an earlier commit.
2013-08-20 14:28:28 -07:00
Adrian Sampson
276ce14dd2 flexattrs work for Albums
A second base class, LibModel, maintains a reference to the Library and should
take care of database-related tasks like load and store. This is the beginning
of the end of the terrible incongruity between Item and Album objects (only
the latter had a library reference). More refactoring to come.

One large side effect: Album objects no longer automatically store
modifications. You have to call album.store(). Several places in the code
assume otherwise; they need cleaning up.

ResultIterator is now polymorphic (it takes a type parameter, which must be a
subclass of LibModel).
2013-08-16 18:36:30 -07:00
Adrian Sampson
38f1e6aec2 new FlexModel base class
I intend to use this for both Item and Album to avoid code duplication and
simplify code that uses both entities.
2013-08-16 17:22:17 -07:00
Adrian Sampson
7d9f556cbe introducing "slow queries"
In preparation for enabling queries over flexattrs, this is a new path that
lets queries avoid generating SQLite expressions altogether. Any query that
can be completely evaluated in SQLite will be, but when it can't, we now fall
back to running the entire query in Python by selecting everything from the
database and running the `match` predicate.

To begin with, this mechanism replaces RegisteredFieldQueries, which
previously used Python callbacks for evaluation. Now they just indicate that
they're slow queries and the query system falls back automatically.

This has the great upside that it lets use implement arbitrarily complex
queries without shoehorning everything into SQLite when that (a) is way too
complicated and (b) doesn't buy us much performance anyway. The obvious
drawback is that any code dealing with queries now has to handle two cases
(slow and fast).

In the future, we could optimize this further by combing fast and slow query
styles. For example, if you want to match with a substring *and* a regular
expression, we can do a first pass in SQLite and apply the regex predicate on
the results. Avoided for now because premature optimization, etc., etc.

Next step: implement flexattr matches as slow queries.
2013-08-16 14:28:46 -07:00
Adrian Sampson
f1c41428e6 changelog/thanks/tweaks for #355
- Remove requests import
- Name change
- Remove some obsolete checks
2013-08-08 16:19:16 -07:00
Filipe Fortes
7c607ebf82 Simplify fetching cover art from release group 2013-08-08 10:02:25 -03:00
Filipe Fortes
a4470ace69 FetchArt plugin: Support grabbing album art from MB release group 2013-08-07 19:21:45 -03:00
Simon Chopin
e30f8f8fb9 bpd: Use AnyFieldQuery when searching "any" fields
BPD hadn't been ported when AnySubstringQuery was removed, resulting in
crash, death and horror when using the search function.
2013-07-02 11:00:10 +02:00
Fabrice Laporte
995d75f3f3 Logging: remove match ratio, add source website name 2013-06-29 14:24:41 +02:00
Fabrice Laporte
9780be270c Some tweaking to yield better results by not
rejecting valid lyrics.
2013-06-29 14:23:53 +02:00
Fabrice Laporte
c6f935ac4c Don't consider text between parentheses when
matching url title with song title.
2013-06-29 14:21:55 +02:00
Adrian Sampson
1649512b54 web: item_count -> stats (#333)
The new /stats endpoint now counts both items and albums. In the future, it
could also expose other interesting information.
2013-06-21 10:27:49 -07:00
Uwe L. Korn
3fd78bd63d [web] Add API method to get the total item count 2013-06-21 16:01:03 +02:00
Pedro Silva
13dc28b349 Fix zero length field error under Python 2.6
* missing.py (_missing): add field indexes to format spec
* duplicates.py (commands): add field indexes to format spec
2013-06-14 13:59:14 +01:00
Adrian Sampson
0262803a40 add data_source, data_url to TrackInfo objects
The Beatport plugin now uses this to provide singleton matches (and their
appropriate penalty).
2013-06-12 16:19:30 -07:00
Adrian Sampson
4555d69803 random: py26 fix 2013-06-12 16:09:41 -07:00
Fabrice L.
6c8f45c7f7 Update lyrics.py 2013-06-12 01:20:08 +03:00
Fabrice Laporte
a64d277bae Merge branch 'master' of https://github.com/sampsyo/beets 2013-06-12 00:09:44 +02:00
Fabrice Laporte
b3747189e5 lyrics: google backend should turn up more results
bs4 scraping routine has been made more generic,
relying less on specific markup tags.
Better algorithm to detect which url titles match
song titles: domain names are now removed from url
titles.
Use regex to decimate \n in fetched lyrics.
2013-06-12 00:07:01 +02:00
Adrian Sampson
2f053b0ecd scrub: handle IOError
Mutagen can raise this error when trying to truncate a file.
2013-06-10 16:06:43 -07:00
Adrian Sampson
f6faf72328 move Distance class to hooks module 2013-06-10 15:21:32 -07:00
Fabrice Laporte
7f62db7327 Merge branch 'master' of https://github.com/sampsyo/beets 2013-06-08 16:36:56 +02:00
Adrian Sampson
d1ebe423c9 changelog/thanks/style for #319 2013-06-07 20:53:53 -07:00
Timothy Appnel
847edcd6cc Fix bug where a null value for lengthMS would crash an import. Added a fallback to parse the standard min:sec length field. 2013-06-07 23:43:21 -04:00
Tai Lee
42efd2a761 Change log for #316 and code style tweaks. 2013-06-08 00:32:40 +10:00
Wessie
0009c51577 Made formatting strings compatible with python 2.6
Also fixed styling according to pep8
2013-06-07 15:58:36 +02:00
Adrian Sampson
fa40fd9108 beatport: use new Distance objects (#302)
This also brought to light the fact that the distance calculations for tracks
was incorrect because there's no source field on TrackInfo objects yet. This
needs to be fixed.
2013-06-06 10:34:20 -07:00
Tai Lee
4cfd1a874f Merge branch 'master' of github.com:sampsyo/beets into distance-refactor
Conflicts:
	beets/autotag/match.py
	beets/config_default.yaml
	docs/changelog.rst
	docs/reference/config.rst
2013-06-06 23:28:25 +10:00
Tai Lee
898254ed6a Merge branch 'master' into distance-refactor
Conflicts:
	docs/changelog.rst
2013-06-06 11:09:36 +10:00
John Hawthorn
1bf8ae0a01 mpdupdate: Allow UNIX domain socket for MPD server
If the host configuration begins with a '/', it is assumed to reference
a UNIX domain socket. This is similar to libmpdclient's behaviour.
2013-06-05 13:20:27 -07:00
Adrian Sampson
dfda5a311d beatport (#301): more Unicode literals
Avoids warnings in the unidecode module.
2013-06-03 14:06:51 -07:00
Adrian Sampson
dc75935b89 Merge pull request #301 from jbaiter/beatport
Plugin for Beatport Metadata in Autotagger
2013-06-03 13:53:05 -07:00
Johannes Baiter
edd0efcb87 Fix unicode bug in Beatport plugin 2013-06-03 17:22:29 +02:00
Fabrice Laporte
09e721efe6 rename "section" markup 2013-06-02 22:35:36 +02:00
Johannes Baiter
f2a924fb56 Bugfixes in Beatport plugin 2013-06-02 11:55:44 +02:00
Tai Lee
e6ac8e1646 Use a Distance object instead of floats for distance calculations.
The new Distance object knows how to perform various types of distance
calculations (expression, equality, number, priority, string).

It will keep track of each individual penalty that has been applied so
that we can utilise that information in the UI and when making decisions
about the recommendation level.

We now display the top 3 penalties (sorted by weight) on the release
list (and "..." if there are more than 3), and we display all penalties
on the album info line and track change line.

The implementation of the `max_rec` setting has been simplified by
removing duplicate validation and instead looking at the penalties that
have been applied to a distance. As a result, we can now configure a
maximum recommendation for any penalty that might be applied.

We have a few new checks when calculating album distance:

`match: preferred: countries` and `match: preferred: media` can each be
set to a list of countries and media in order of your preference. These
are empty by default. A value that matches the first item will have no
penalty, and a value that doesn't match any item will have an unweighted
penalty of 1.0.

If `match: preferred: original_year` is set to "yes", beets will apply
an unweighted penalty of 1.0 for each year of difference between the
release year and the original year.

We now configure individual weights for `mediums` (disctotal), `label`,
`catalognum`, `country` and `albumdisambig` instead of a single generic
`minor` weight. This gives more control, but more importantly separates
and names the applied penalties so that the UI can convey exactly which
fields have contributed to the overall distance penalty.

Likewise, `missing tracks` and `unmatched tracks` are penalised and
displayed in the UI separately, instead of a combined `partial` penalty.

Display non-MusicBrainz source in the disambiguation string, and
"source" in the list of penalties if a release is penalised for being
a non-MusicBrainz.
2013-06-02 18:25:10 +10:00
Adrian Sampson
9a6b6240d0 zero: fix nulling fields containing None 2013-06-01 17:28:59 -07:00
Adrian Sampson
4624f65ce3 fix interface to ID matching
As outlined in #299, we broke many places in the code that were expecting
_album_for_id and _track_for_id to return a single item rather than a list. I
took this opportunity to divide up the interface: there's now one function for
MBIDs (returning a single object or None) and one for generic IDs (returning a
list).
2013-06-01 17:22:39 -07:00
Johannes Baiter
eb20d77c69 Implement BeetsPlugin API for Beatport plugin 2013-06-01 18:45:54 +02:00
Johannes Baiter
bbd50c65cd Fix Beatport source weight 2013-06-01 15:50:59 +02:00
Johannes Baiter
af81b67c0c Implement Beatport API wrapper 2013-06-01 15:23:18 +02:00
Johannes Baiter
1a8f54fd51 Lay out beatport plugin based on discogs plugin 2013-06-01 15:20:58 +02:00
Adrian Sampson
18bbe9f645 Merge pull request #298 from jayme-github/python26-resub
Fix Python 2.6 compatibility
2013-05-30 09:48:50 -07:00
Tai Lee
ee0c00708b Quick fix for a couple other places that were expecting hooks._album_for_id()` to return a single result.
It's possible that these plugins might require a little more thought
into how they should work (or not work) with potentially multiple albums
matching an idea, and potentially those those albums being an incorrect
match (e.g. if two data source plugins share a simple numerical ID
format).
2013-05-31 00:05:24 +10:00
Jayme
5bb0881cdd Replace two more flag arguments 2013-05-30 10:09:39 +02:00
Jayme
32e1c13510 Fix Python 2.6 compatibility 2013-05-30 09:30:00 +02:00
Adrian Sampson
303cd9ba00 Merge pull request #291 from jbaiter/discogs_albumid
Support for manually entered IDs in plugins
2013-05-29 14:43:59 -07:00
Johannes Baiter
3df635eca2 Make regex for Discogs ID more specific 2013-05-29 20:31:58 +02:00
Johannes Baiter
2d4ea4e49b Fix bug in discogs.album_for_id for ID-Strings that end in a bracket 2013-05-29 10:59:04 +02:00
Johannes Baiter
40a6e03ba6 Improve regular expression for Discogs IDs 2013-05-29 10:54:15 +02:00
Adrian Sampson
3b438b7778 inline: rename "pathfields" to "item_fields" 2013-05-28 23:20:19 -07:00
Adrian Sampson
0176e10ccf inline: allow album field definitions
Under the album_field heading.
2013-05-28 23:10:47 -07:00
Adrian Sampson
a0cb31956d distinguish Album and Item template fields
An earlier change (due to @pedros) added the ability for plugins to define
template fields that work with Albums as well as Items. This enables some
cool new use cases but required that every template field definition check the
type of its arguments. Instead, this iteration on the idea distinguishes
between fields meant for Items and those meant for Albums.

In addition to simplifying the implementation of these functions, this also
enables the creation of album fields with identical names to item fields.
(For example, a user contacted me recently about adding a $bitrate field for
albums, which would be the average bitrate of the items. They can do this now
using a plugin.)

I also changed the docs to stop using the decorator approach to registering
template fields. We're moving toward removing those.
2013-05-28 22:30:23 -07:00
Adrian Sampson
9f927438ca fix some dumb mistakes from most recent flurry 2013-05-28 22:04:20 -07:00
Adrian Sampson
72449caccf discogs: move config default into constructor
Such is the new convention for plugin configuratino defaults.
2013-05-28 21:45:31 -07:00
Adrian Sampson
480fa80e47 discogs: penalty only for matches from discogs
Otherwise, this was penalizing all album matches.

This also applies the same treatment as the previous commit: only load the
config at run time (at the expense of code clutter).
2013-05-28 21:25:28 -07:00
Johannes Baiter
f17e8550ca Determine IDs from MusicBrainz and Discogs URLs 2013-05-28 13:49:34 +02:00
Johannes Baiter
e3418be75d Add support for manually entered release ID in Discogs 2013-05-28 12:58:05 +02:00
Tai Lee
35e926a51b Add Discogs and general source weight penalty (configurable, undocumented).
Discogs (and other individual plugins) should return a penalty between
0.0 and 0.1, which will be multiplied by the general source weight. This
allows individual plugins to be weighted against relative to each other,
and amplified together against other penalty categories (track, title,
etc.)
2013-05-27 01:28:40 +10:00
Tai Lee
a6b1bb1bbc Move articles to the front of Discogs artist names. 2013-05-25 14:05:03 +10:00
Tai Lee
e3fa403ad2 Only execute pathfields expressions and functions if they are called with an Item argument. Otherwise, return an empty string. 2013-05-25 12:28:52 +10:00
Tai Lee
3f4e194c41 We only need to strip the disambiguation from artist names, not the join strings. 2013-05-25 12:19:48 +10:00
Adrian Sampson
72f0505744 discogs: extra space in ambiguous artists (#289) 2013-05-24 12:31:18 -07:00
Adrian Sampson
d877f5e3e8 Merge pull request #289 from Smyds/master
Remove discogs artist disambiguation number
2013-05-24 12:28:50 -07:00
César Prouté
726c84674b remove discogs artist disambiguation number 2013-05-24 20:15:24 +01:00
Tai Lee
835a3c2a73 Improved parsing of Discogs' position field.
Some albums have a single disc with positions like I, II, III, IV, etc.
Previously beets thought each track on these albums was a new medium.

Now we assume that if there is no explicit medium index and the ordinal
of an alpha medium does not appear to be sequential (e.g. A, B, C) that
the medium is actually the medium index.
2013-05-25 01:36:12 +10:00
Tai Lee
4c06c96630 Extract disc titles from Discogs' "index tracks". 2013-05-25 01:32:06 +10:00
Tai Lee
7f068a8c03 Add AlbumInfo.data_url property, populate it for Discogs matches and display it when it is non-empty.
Makes it easier for people to find the best Discogs (or other) match
and import it to Music Brainz using a grease monkey or similar script.
2013-05-24 22:50:14 +10:00
Adrian Sampson
26682f9168 docs/changelog for convert paths config (#285) 2013-05-22 15:00:53 -07:00
Lucas Duailibe
1e0290354c fix some debug code 2013-05-22 14:11:55 -03:00
Lucas Duailibe
76e310d811 different paths for convert
the paths configuration for converted files can be different from the importer
closes #232
2013-05-22 11:03:00 -03:00
Tai Lee
dde4bfab8c Update signature for item_candidates() in chroma plugin. 2013-05-22 08:10:20 +10:00
Tai Lee
75a4171d20 Merge branch 'master' of github.com:sampsyo/beets into imenem-discogs-search
Conflicts:
	docs/changelog.rst
	docs/plugins/index.rst
2013-05-21 23:27:53 +10:00
Tai Lee
3eb6f8e5eb Add discogs plugin, which extends the autotagger to include results from the discogs database.
This is a refactor of the plugin developed by `imenem`.

- Pass `artist`, `album` and `va_likely` to `candidates()` so that
  plugins don't have to work this out from `items` all over again.
- Pass `artist` and `title` to `item_candidates()`.
- Silence spurious `urllib3` info log lines.
- Use a proper "beets" user agent with `discogs_client`.
- Remove `abstract_search` plugin. It seems unnecessary. How many
  music databases are there? How many will beets support? How much
  common code might there be between them? We can add some abstraction
  if or when more databases are supported.
- Derive more AlbumInfo and TrackInfo properties from discogs Release
  objects, especially album ID so that beets doesn't just use the first
  release and think all subsequent releases are duplicates.
- Add basic documentation, doc strings and code comments.
- Sanitise search query. Remove non-word characters and medium info that
  might filter out good search results.
- Use artist `join` strings from discogs Release object when an album
  or track has multiple artists.
- Don't rely on discogs track position, which is unreliable. But tracks
  are in order, so we can recalculate medium and medium_index as long as
  we can extract a consistent medium across tracks from the position.
- Add "various" as a known signal to indicate various artists.
- Prevent `chroma` plugin from returning a a huge track distance for any
  track that is missing an ID (e.g. all discog tracks).
- `TrackInfo.index` should be the release index (calculated by beets),
  not the medium index (derived from discogs track position).
- Add `AlbumInfo.data_source`. It's "Unknown" by default which is shown
  in red when displaying a suggested or selected match. The built in
  auto tagger sets it to "MusicBrainz" which is shown in green. Anything
  else (e.g. "Discogs") is shown in yellow.
- Remove double spaces from album titles (bad data from Discogs).
2013-05-21 21:16:52 +10:00
Adrian Sampson
6f2c1d81bd random -e (#263): fix some short responses
This slight modification to the selection algorithm avoids the situation in
which too many objects are chosen for a given artist and fewer than N objects
are eventually returned. We do this by implementing "selection without
replacement" literally: we choose objects one at a time and pop them from the
population when they are selected.
2013-05-19 11:00:52 -07:00
Adrian Sampson
748d8caa64 Merge pull request #263 from madjar/master
Added a -e option to random that makes the distribution even among artists
2013-05-19 10:41:39 -07:00
Georges Dubus
5dbff4a8eb Fixed the randomness of the equal change to have more than one song by artist 2013-05-19 17:22:19 +02:00
Adrian Sampson
cee3b20630 duplicates: refactoring and empty-ID fix (#278)
The main change here, aside from documentation/naming updates, is that we skip
"duplicates" that arise from albums/tracks that are missing their MBIDs.
2013-05-17 12:35:35 -07:00
Adrian Sampson
cef245eb05 merge 2013-05-17 12:15:36 -07:00
Adrian Sampson
2f442b5677 Merge pull request #278 from pedros/duplicates
Duplicates plugin
2013-05-17 12:15:06 -07:00
Adrian Sampson
1898a79d4f fix inline for album plugin fields (#274) 2013-05-17 12:13:01 -07:00
Adrian Sampson
1ffc56b85a doc correction and refactoring for #275
Plugin-provided template fields are not available for queries. (Perhaps they
should be, though!)
2013-05-17 12:07:53 -07:00
Pedro Silva
7031c15418 Initial import of 'duplicates' plugin 2013-05-17 12:47:34 +01:00
Pedro Silva
a48fde9f2c Use newly defined '$missing' template field instead of hardcoded format (-c) 2013-05-15 15:09:00 +01:00
Adrian Sampson
a0ef886801 lyrics: substitute more punctuation (fixes #270) 2013-05-12 12:45:49 -07:00
Adrian Sampson
a5cb34360d lyrics: fix encoding for Lyrics.com 2013-05-12 12:38:48 -07:00
Adrian Sampson
f086fb6fd7 changelog, little style tweak for #272
Changed single-triple quotes to double-triple quotes, just for consistency
with the rest of the codebase.
2013-05-10 22:23:24 -07:00
Adrian Sampson
e1f7027abc Merge branch 'missing' of https://github.com/pedros/beets
Conflicts:
	docs/plugins/index.rst
2013-05-10 22:08:15 -07:00
Pedro Silva
b2d8f04f05 Modify "not part of beets" to "part of beets" 2013-05-10 16:50:34 +01:00
Pedro Silva
763cfa06b4 Don't check for item.paths == None as that can't happen 2013-05-10 16:43:17 +01:00
Pedro Silva
d32a3ef9b5 Implement logic for displaying missing track counts 2013-05-10 16:42:45 +01:00
Pedro Silva
69877f2013 Add 'count' and 'total' parameters
- count: count missing tracks per album
- total: count total missing tracks
2013-05-10 16:42:10 +01:00
Pedro Silva
bed7c5ae88 Add _missing_count function 2013-05-10 16:41:04 +01:00
Pedro Silva
abe12be4b2 Remove unneeded Library argument from _missing 2013-05-10 16:06:30 +01:00
Pedro Silva
18e2704ffb Remove unnecessary _format function 2013-05-10 14:23:32 +01:00
Pedro Silva
6ae73bc921 Initial import of missing tracks plugin
This plugin adds a new command, ``missing`` or ``miss``, which finds
and lists, for every album in your collection, which tracks are
missing.
2013-05-10 14:13:53 +01:00
Georges Dubus
bcae495c50 Added a -e option to random that makes the distribution even among artists 2013-05-03 18:19:44 +02:00
Adrian Sampson
dd8d4c16cc spell check 2013-04-29 10:23:21 -07:00
Adrian Sampson
374e043c3c API/test enhancements for #257
Also, `cautious` defaults to False for backwards-compatibility.
2013-04-27 16:47:42 -07:00
Fabrice Laporte
2dc15a0e2b Use re.search instead of re.match with simplified regex.
Add additional cover_names parameter to art_in_path, and makes 'cover_names' a  plugin config option.
2013-04-27 12:21:57 +02:00
Fabrice Laporte
d9e213867c fetchart (issue 459): use regex to detect valid image names + 'cautious' option for finer control of filename matching 2013-04-22 23:44:35 +02:00
Adrian Sampson
bf904187e2 smartplaylist: split query w/ shlex (fixes #256) 2013-04-21 20:55:07 -07:00
Adrian Sampson
aaafba4d28 changelog for #254 2013-04-21 20:41:01 -07:00
Fabrice Laporte
0fb877a059 lastgenre: invert 'force' option default value. 2013-04-21 23:34:20 +02:00
Fabrice Laporte
6fdfabe4b7 Revert "lastgenre: force real lookup during import only if no custom whitelist set."
This reverts commit 4be30fca2e.
2013-04-21 10:35:08 +02:00
Fabrice Laporte
4be30fca2e lastgenre: force real lookup during import only if no custom whitelist set. 2013-04-20 14:29:14 +02:00
Adrian Sampson
2a9afd3908 misc. style cleanup for #243 2013-04-15 10:52:17 -07:00
Adrian Sampson
1622dcefb7 Merge pull request #243 from KraYmer/master
Add a lyrics backend that scrapes results from google custom search api
2013-04-15 10:19:31 -07:00
Adrian Sampson
16e0648c81 lastgenre: fix crash with canonicalization 2013-04-10 10:34:06 -07:00
Adrian Sampson
8ae202cf24 changelog for #246 2013-04-10 10:18:58 -07:00
Uwe L. Korn
3b33705e3b Compute Content-Length to make tracks seekable in most players via the web plugin 2013-04-10 14:21:47 +02:00
Fabrice Laporte
479b25bac3 Code style + fix doc typo 2013-04-08 18:35:02 +02:00
Fabrice Laporte
7b13edee40 lyrics: restore tags write and fix extract_text() 2013-04-06 18:24:30 +02:00
Fabrice Laporte
cfb6735e43 Add a lyrics backend that scraps results from google custom search api.
Add a 'fallback' option to facilitate working around the 100 queries/day google
limit by marking files as 'visited' so they are not considered for lyrics search
on the next beet run.
I've put my own google_engine_ID as default value in the code but could be
reconsidered, this engine contains databases known to be scrappable by the
plugin algorithm though.
2013-04-06 15:22:04 +02:00
Adrian Sampson
70b528ed81 use standard query API for album-by-artist (#240) 2013-04-02 20:31:28 -07:00
Uwe L. Korn
dcc1e1aa71 Add functions needed for ScriptCollection Support in Tomahawk 2013-04-01 17:50:51 +02:00
Fabrice Laporte
6405962beb Merge branch 'master' of https://github.com/sampsyo/beets 2013-03-25 22:29:02 +01:00
Lucas Duailibe
51ed0939d6 fixing things 2013-03-25 15:20:38 -03:00
Lucas Duailibe
c682ac84b0 one more error message (#125) 2013-03-25 11:45:11 -03:00
Lucas Duailibe
56c53acbab human-friendly error messages (#125) 2013-03-25 11:24:42 -03:00
Adrian Sampson
f8d6e84581 invert new embedart switch (#182)
The default behavior now does what most people probably expect, which is to
run like the on-import handler for the embedart plugin.
2013-03-17 22:50:28 -07:00
Lucas Duailibe
0c53c0bc3f option to embed current album arts (closes #182) 2013-03-17 22:52:51 -03:00
Lucas Duailibe
7b2ff4ae9b fix mbsync bug
This fixes a bug that only applied changes to the first item of an album
2013-03-17 02:50:32 -03:00
Fabrice Laporte
9c0fa57f34 Merge branch 'master' of https://github.com/sampsyo/beets 2013-03-16 09:16:21 +01:00
Adrian Sampson
3e1a181d3a fix extra super call in fuzzy
This was dumb of me.
2013-03-14 18:43:44 -07:00
Adrian Sampson
f474f3aed2 split FieldQuery into base and registered versions 2013-03-14 10:00:30 -07:00
Adrian Sampson
f005ec2de0 refactor: everything is like a plugin query (#214)
The initial idea for this refactor was motivated by the need to make
PluginQuery.match() have the same method signature as the match() methods on
other queries. That is, it needed to take an *item*, not the pattern and
value. (The pattern is supplied when the query is constructed.) So it made
sense to move the value-to-pattern code to a class method.

But then I realized that all the other FieldQuery subclasses needed to do
essentially the same thing. So I eliminated PluginQuery altogether and
refactored FieldQuery to subsume its functionality. I then changed all the
other FieldQuery subclasses to conform to the same pattern.

This has the side effect of allowing different kinds of queries (even
non-field queries) down the road.
2013-03-13 22:57:20 -07:00
Adrian Sampson
40b49ac786 some low-level tweaks to extensible queries (#214) 2013-03-13 21:59:03 -07:00
Philippe Mongeau
292092bef7 Merge #214 extend query syntax from plugins
Conflicts:
	docs/changelog.rst
2013-03-13 18:32:27 -04:00
Adrian Sampson
54d8adf6a6 changelog for #180 2013-03-12 22:00:11 -07:00
Lucas Duailibe
b9844ccf3a importfeeds: absolute path option (#180) 2013-03-13 01:50:09 -03:00
Adrian Sampson
ae40b97528 chroma: catch acoustid exceptions during submit 2013-03-12 20:30:57 -07:00
Adrian Sampson
7b7a4257ac mbcollection: use library functions
Since we now require python-musicbrainz-ngs 0.3 or later, we no longer have to
hand-craft the API requests.
2013-03-11 19:43:57 -07:00
Adrian Sampson
aff3fb106d chroma: fingerprint command's write from config
This turns on metadata-writing based on the import.write config option, so
those with this option turned off will be spared any surprises. (Affects #217
and #143.)
2013-03-11 19:19:48 -07:00
Lucas Duailibe
704259b459 fix typo 2013-03-11 19:26:33 -03:00
Lucas Duailibe
a6ae5c4a4f cleaning up 2013-03-11 19:22:03 -03:00
Lucas Duailibe
3390fd339a store fingerprints with the "fingerprint" command 2013-03-11 18:31:53 -03:00
Lucas Duailibe
8a64686ff3 store fingerprints 2013-03-11 17:56:13 -03:00
Philippe Mongeau
8b1511a8af fix fuzzy config 2013-03-10 20:39:02 -04:00
Philippe Mongeau
ca8af62e9c change queries() function to returns a dict
of {prefix: PluginQuery}

use the class __name__ as sqlite function name

make RegexpQuery use the AnyPluginQuery
2013-03-10 20:11:42 -04:00
Philippe Mongeau
2a42c75cba fuzzy: use smartcase for the pattern
ignore case unless the pattern contains a capital letter
2013-03-10 19:07:29 -04:00
Philippe Mongeau
7d879289c1 fuzzy: add prefix config 2013-03-10 18:00:28 -04:00
Philippe Mongeau
09156b03f0 fuzzy: use threshold value from config 2013-03-10 17:37:03 -04:00
Philippe Mongeau
7314bc0524 make fuzzy use PluginQuery instead of a subcommand 2013-03-10 16:50:54 -04:00
Adrian Sampson
01a449ffa6 convert: auto (#212) now transcodes to /tmp
This avoids naming conflicts in the source directory. In particular, when
encoding MP3 -> MP3, the previous scheme would overwrite the original file
(and hang ffmpeg waiting for input). This should also work in
situations where the source directory is read-only.
2013-03-10 13:22:05 -07:00
Adrian Sampson
8736a0bb4c convert auto: changelog and de-cloning (#212) 2013-03-10 13:12:56 -07:00
Adrian Sampson
47a549a31c Merge pull request #212 from duailibe/auto_convert
Transcode files during import
2013-03-10 12:57:36 -07:00
Lucas Duailibe
c2c96d522f config name and docs update 2013-03-09 23:33:45 -03:00
Lucas Duailibe
a3d8105a5a small fix 2013-03-09 20:04:26 -03:00
Lucas Duailibe
27b1d6d7cc clean up old files and remove pdb 2013-03-09 19:36:34 -03:00
Lucas Duailibe
e49ca34f3c partial commit 2013-03-09 19:09:43 -03:00
Adrian Sampson
7d9fd0a2cf convert: fix unicode error in path construction
I introduced a regression a few commits ago when I started using
lib.destination with the basedir keyword argument as opposed to doing
os.path.join manually.
2013-03-09 11:37:10 -08:00
Adrian Sampson
218f10a62d echonest_tempo: catch socket.error 2013-03-09 11:33:55 -08:00
imenem
12476ca22e Added Discogs search plugin. 2013-03-07 17:59:52 +02:00
Adrian Sampson
69f2659410 convert: read new audio metadata (#208) 2013-03-06 23:11:08 -08:00
Adrian Sampson
87d71abc28 changelog/cleanup/fixes for #209
The major functional change here is how files move around when in keep_new
mode. Now, files are first moved to the destination directory and then
copied/transcoded back into the library.

This avoids problems where naming conflicts could occur when transcoding from
MP3 to MP3 (and thus not changing the filename).
2013-03-06 18:21:42 -08:00
Lucas Duailibe
a338b95bb7 Changing behavior in "keep new files" 2013-03-06 22:04:05 -03:00
Lucas Duailibe
28522376be Adding "keep new files" option to convert plugin 2013-03-06 21:41:40 -03:00
Fabrice Laporte
72a06e96d0 Merge branch 'master' of https://github.com/sampsyo/beets 2013-03-04 08:38:09 +01:00
Adrian Sampson
1a7ec6dc79 mbsync: fix redundant album art movement
Since we explicitly move album art later in the process, implicitly moving it
with items can cause a double-move (and thus a "file not found" error).
2013-03-03 17:46:16 -08:00
Adrian Sampson
18688008a4 mbsync: avoid spurious stores/moves
As _print_and_apply_changes itself does for items, we now shortcut
modifications (metadata and filesystem) for albums when no changes are
required for a given album. This avoids effectively doing a "beet move" on an
album even when nothing has changed.
2013-03-03 17:19:05 -08:00
Adrian Sampson
5f68d03793 mbsync: don't write tags if import.write is off
This will avoid surprising users with import.write turned off.
2013-03-03 17:13:54 -08:00
Adrian Sampson
72263a1cf7 mbsync: use ID lookups instead of full match logic
This change uses _album_for_id and _track_for_id instead of the full
autotag.match.* functions. This should be faster (requiring fewer calls to the
MusicBrainz API) while also being more predictable. It also won't, for
example, use acoustic fingerprinting even if the chroma plugin is installed.

Finally, this change catches the error case in which MBIDs are erroneous. This
can happen, for example, if the user has some track MBIDs left over from
before the NGS transition.
2013-03-03 17:08:07 -08:00
Adrian Sampson
a8d999a101 mbsync: split album/item functions; shorter txns
The main change here is to use shorter transactions -- one per matching entity
-- rather than one large one. This avoids very long transactions when the
network happens to move slowly.
2013-03-03 16:52:14 -08:00
Adrian Sampson
54e070d06b mbsync: use SingletonQuery for item updates 2013-03-03 16:29:31 -08:00
Jakob Schnitzer
d647ea0f0d mbsync: a little refactoring 2013-03-03 23:39:14 +01:00
Jakob Schnitzer
3a9c9d53da mbsync: add support for singletons
I can't really guarantee this works right now since I have no singletons
in my collection to test it
2013-03-03 23:39:13 +01:00
Jakob Schnitzer
cd7305d487 mbsync: write metadata to files... 2013-03-03 23:39:13 +01:00
Jakob Schnitzer
2fd3ad5362 initial version of the mbsync plugin
this plugin provides a faster way to query new metadata from
musicbrainz. (instead of having to 're-import' the files)
Currently it lacks all forms of documentation and will only work for
album queries. not really tested so far so be careful
2013-03-03 23:39:13 +01:00
Jakob Schnitzer
ef22ea5183 convert: add missing util.displayable_path 2013-03-01 16:16:28 +01:00
Fabrice Laporte
91255c5ae1 Merge branch 'master' of https://github.com/sampsyo/beets 2013-03-01 08:25:39 +01:00
Adrian Sampson
1fbbe61546 mbcollection: human-readable MB exceptions
Fixes #107 by wrapping the API invocation function with exception handlers.
2013-02-28 10:43:02 -08:00
Adrian Sampson
c31eabe95c convert: add missing syspath call (closes #106) 2013-02-27 10:30:24 -08:00
Adrian Sampson
a1e89b879d echonest_tempo: warn on API error 2013-02-18 18:40:59 -08:00
Adrian Sampson
63564d84e7 echonest_tempo: sanitize newlines from input
The Echo Nest API confusingly says that the input is missing if it contains a
newline.
2013-02-18 18:34:31 -08:00
Dang Mai
3be24110d7 Sanitize template evaluation for smartplaylist 2013-02-11 21:37:14 -05:00
Adrian Sampson
d1e50da71f fetchart: remote_priority config option 2013-02-10 21:40:55 -08:00
Fabrice Laporte
6b2e409007 Merge branch 'master' of https://github.com/sampsyo/beets 2013-02-09 17:46:06 +01:00
Adrian Sampson
f7f2454134 docs & style for #92
We already have a nice plurality() function in beets.util to calculate the most
popular value of something, so I reused that.
2013-02-06 10:55:48 -08:00
Peter Schnebel
7193f4e863 Do not write track-level genres if source is not 'track'. 2013-02-06 08:41:20 +01:00
Peter Schnebel
9f1e9031b6 Try to guess 'Various Artists' genre based on track genres if source is 'track'. 2013-02-06 08:15:29 +01:00
Peter Schnebel
d667fca02e Do not write track-level genres if source is not 'track'.
For 'Various Artist' compilations without a usefull 'album' genre, pick the most used track / track-artist genre.
2013-02-06 08:04:58 +01:00
Adrian Sampson
976bc20900 collapse separate album and item paths (#92)
Should reduce copypasta overhead significantly.
2013-02-05 12:16:53 -08:00
Adrian Sampson
3860a5ac27 lastgenre: "auto" config option 2013-02-05 12:02:51 -08:00
Adrian Sampson
e50e28dc38 canonicalize original genre (#92) 2013-02-05 11:58:24 -08:00
Adrian Sampson
d1e752fdeb simplify configuration handling (#92) 2013-02-05 11:51:32 -08:00
Adrian Sampson
f38bed787e remove verbose option (#92)
The lastgenre command should always log what it's doing so the user can see
the progress being made. If you really don't want any output, just pipe to
/dev/null.
2013-02-05 11:40:04 -08:00
Adrian Sampson
1fe36057b0 Python style and legibility cleanup for #92 2013-02-05 11:34:17 -08:00
Adrian Sampson
cd2d4c9b8a Merge pull request #92 from pscn/master
lastgenre improvements
2013-02-05 10:31:46 -08:00
Adrian Sampson
5be50fbb38 echonest_tempo: skip when missing artist or title 2013-02-05 10:28:24 -08:00
root
f83e9fb8bb qbugfix 2013-02-05 08:13:36 +01:00
Peter Schnebel
30dff5afff cleaned up, removed debug 2013-02-04 21:47:35 +01:00
Peter Schnebel
4df9521007 experimental track / album / artist based genre stuff per item 2013-02-04 20:24:22 +01:00
Adrian Sampson
99ed9e03de rename ImportTask.path to paths (#89) 2013-02-03 11:22:27 -08:00
Tai Lee
23cd5453d9 Improved multi-disc album detection.
- Remove "part", "volume", "vol." multi-disc markers. These are often
  part of album titles, and not necessarily indicative of a multi-disc
  album. Only look for "CD X" and "disc X" (case insensitive), ignoring
  white space and other non-word characters.

- Don't only expect each disc to be in a subdirectory of a common parent
  directory, with all siblings belonging to the same release. Also match
  any consecutive siblings (even when the parent contains other albums)
  that are named with the same prefix and multi-disc marker.

- The `albums_in_dir(path)` function now always yields a list of paths
  along with each list of items. `ItemTask.path` is now always a list of
  paths.

- The `displayable_path(path)` function now accepts a list of paths, and
  will join them with "; " by default. This can be changed with the
  `separator` argument.

- The `sorted_walk()` function now does a case insensitive sort on
  directories, but still returns case sensitive results. This allows
  better multi-disc album detection.

- The `art_for_album()` function now takes a list of paths as its second
  argument, instead of a single path.
2013-02-03 23:51:31 +11:00
Adrian Sampson
0be319767f fixes and refactoring for lastgenre.source (#88)
This provides a default for source, preventing a crash when not present in the
user's config.

It also refactors the source decision to a helper function, _lastfm_obj, to
avoid copypasta.
2013-02-02 12:52:43 -08:00
Adrian Sampson
a21e3ca344 Merge pull request #88 from pdf/lastgenre_source_selection
Allow selection of source for genre information (ie - artist vs album)
2013-02-02 12:44:02 -08:00
Adrian Sampson
89689899c9 changelog note and indentation fix for #86 2013-02-02 12:27:42 -08:00
Adrian Sampson
52dc2f6b0b Merge pull request #86 from steinitzu/master
AlbumArtist tag browsing in bpd
2013-02-02 12:25:01 -08:00
Adrian Sampson
887d1c1287 fix inline and rewrite for instance fields
I'm transitioning to using exclusively instance-level fields instead of
class-level fields in plugin objects, but I neglected to bring inline and
rewrite into the future. This manifested as silent inaction on the part of
these plugins.

This change restores the old behavior (for compatibility) but also updates the
plugins to use the new behavior.
2013-02-02 08:35:54 -08:00
Adrian Sampson
f59ff7e89e importfeeds: use bytestring paths 2013-02-02 08:22:51 -08:00
Fabrice Laporte
8eabbf64cc Merge branch 'lyrics' 2013-02-02 10:48:58 +01:00
Fabrice Laporte
bc82e04077 importfeeds: fix UnicodeDecodeError when creating symlinks 2013-02-02 10:31:36 +01:00
Fabrice Laporte
cf73d7cb08 replace \r by \n 2013-02-02 09:38:49 +01:00
Peter Fern
ef5dfa3fcf Allow selection of source for genre information (ie - artist vs album)
If config is set to:

   lastgenre:
     source: artist

The genre will be fetched for the artist, rather than the album.  This
allows for filesystem org like:

   genre/artist/album

Currently defaults to previous behaviour for anything other than
`artist`
2013-02-02 14:31:45 +11:00
steini
476adf40af Support for AlbumArtist and AlbumArtistSort tag listings. 2013-02-01 02:35:19 +00:00
Dang Mai
d4004f10fa Update comments to reflect config migration 2013-01-31 18:17:00 -05:00
Dang Mai
ef8ef4c747 Update MPD whenever database changes 2013-01-31 18:16:21 -05:00
Dang Mai
7de2727572 Fix smartplaylist to use lib param from cli_exit 2013-01-31 18:09:17 -05:00
Adrian Sampson
e6ea6dc875 zero: remove redundant list of dict's keys 2013-01-31 12:15:18 -08:00
Adrian Sampson
58d9a775cc remove singleton enforcement from plugins
The plugin system itself now enforces single instances.
2013-01-31 12:13:19 -08:00
Adrian Sampson
bba0051ee7 changelog & doc tweaks for smartplaylist (#80) 2013-01-31 10:07:18 -08:00
Dang Mai
397ad441a8 Remove debugging statement
Silly me for forgetting to check the pdb statement I just put in ...
2013-01-30 21:28:54 -05:00
Dang Mai
f5838692d7 Add default for playlist_dir 2013-01-30 21:27:00 -05:00
Dang Mai
6bc0202354 Add ability to use tag in m3u names 2013-01-30 12:45:56 -05:00
Dang Mai
895ee7de3f Fix playlist_dir not resolving relative path 2013-01-30 09:50:27 -05:00
Dang Mai
5a7d7e1bb5 Change command to splupdate 2013-01-30 09:28:50 -05:00
Dang Mai
d134e9c461 Add comments 2013-01-30 08:42:29 -05:00
Dang Mai
480d51443c Add print statements 2013-01-30 08:31:39 -05:00
Dang Mai
70240bf4b1 Fix optional relative_to 2013-01-30 08:25:18 -05:00
Dang Mai
4312fd3914 Working smart playlist plugin 2013-01-30 08:12:22 -05:00
Adrian Sampson
d0aaa511a3 minor style cleanup for #75 2013-01-29 21:30:57 -08:00
Dave Hayes
2f06a508bd Implements support for WMA/ASF
* Adds support for importing/managing .wma and .asf files
 * Adds support for all available ASF tag equivalents
 * Adds two utility methods for (un)packing embedded ASF pictures
 * Modifies scrub plugin to work around the lack of a delete method on
   ASFTags object.
2013-01-28 14:05:34 -06:00