Commit graph

169 commits

Author SHA1 Message Date
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
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
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
6d68a4855e per-plugin configuration defaults in __init__()
This uses the new BeetsPlugin.config convenience view heavily. Things are
slowly getting less verbose.
2012-12-18 22:35:44 -08:00
Adrian Sampson
3ef9e006f4 finish confit-ifying all the plugins 2012-12-13 17:14:19 -08:00
Jakob Schnitzer
ba140a3f97 Added command to the lastgenre plugin 2012-10-04 10:56:31 +02:00
Fabrice Laporte
49a6b993d3 lastgenre: add existing genre to the list of suggested tags to canonicalize 2012-09-15 12:00:33 +02:00
Adrian Sampson
c5424dce05 lastgenre and lyrics: use new pluggable import stages
This solves a problem where files were copied before the genre field was
updated, resulting in problems when $genre was used in a path (GC-357).
2012-06-08 15:17:49 -07:00
Adrian Sampson
760fff3ace use new "except ... as ...:" syntax
This replaces the older "except ..., ...:" syntax.
2012-05-13 21:18:50 -07:00
Adrian Sampson
f6b37d2c8c remove with_statement __future__ imports
This is the first of several commits that will modernize the beets codebase for
Python 2.6 conventions. (Compatibility with Python 2.5 is hereby abandoned.)
2012-05-13 20:39:07 -07:00
Adrian Sampson
b68e87b92c The Great Trailing Whitespace Purge of 2012
What can I say? I used to use TextMate!
2012-05-13 20:22:17 -07:00
kraymer
c4783e25f8 'Issue 358:Options for when lastgenre fails to find a tag'. Added 'fallback_str' plugin parameter to specify a fallback string when no genre found. Declare the parameter without specifying a value (= empty string) to blank the genre field when no genre found. 2012-05-08 23:41:07 +02:00
Adrian Sampson
a28f930c52 transaction objects to control DB access
In an attempt to finally address the longstanding SQLite locking issues, I'm
introducing a way to explicitly, lexically scope transactions. The Transaction
class is a context manager that always fully fetches after SELECTs and
automatically commits on exit. No direct access to the library is allowed, so
all changes will eventually be committed and all queries will be completed. This
will also provide a debugging mechanism to show where concurrent transactions
are beginning and ending.

To support composition (transaction reentrancy), an internal, per-Library stack
of transactions is maintained. Commits only happen when the outermost
transaction exits. This means that, while it's possible to introduce atomicity
bugs by invoking Library methods outside of a transaction, you can conveniently
call them *without* a currently-active transaction to get a single atomic
action.

Note that this "transaction stack" concepts assumes a single Library object per
thread. Because we need to duplicate Library objects for concurrent access due
to sqlite3 limitation already, this is fine for now. Later, the interface should
provide one transaction stack per thread for shared Library objects.
2012-05-06 23:24:05 -07:00
Adrian Sampson
2d3c9d9f9a suppress more pylast errors (#349) 2012-02-26 17:57:40 -08:00
Adrian Sampson
93678307ef lastgenre now writes tags to files (#279)
This was accomplished by adding a new "config" parameter to the *_imported
events so that the handlers can check whether writing is enabled.
2011-12-20 17:49:11 -08:00
Adrian Sampson
c03fb658c7 clean up genre canonicalization (#264)
- Canonicalization is disabled by default. (This prevents pyyaml from being a
  dependency if you don't use canonicalization.)
- Config value to set the tree file.
- Python style.
- Added YAML file to MANIFEST.in.
- Documentation.
2011-12-01 12:14:11 -08:00
kraymer
9fd10c0186 add genres canonicalization: when a last.fm tag is found but rejected (because not in user whitelist), try to found a
parent tag that is accepted

--HG--
extra : transplant_source : %C6%F2%F9%EDY%C4%1B%FD%BDV/%E5%041I%CB4%00%0A%07
2011-10-11 00:16:57 +02:00
Adrian Sampson
1e88b9ea8d fix storing of genres after item import 2011-10-11 10:20:43 -07:00
Adrian Sampson
b62b462b1e file-based genre whitelist & cleanup
--HG--
rename : beetsplug/lastgenre.py => beetsplug/lastgenre/__init__.py
2011-10-07 12:51:38 -07:00