Commit graph

20 commits

Author SHA1 Message Date
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
280b431173 changelog / doc for #214 2013-03-13 18:29:11 -04:00
Philippe Mongeau
a5367df66e document how extend the query syntax in plugins using PluginQuery
update the fuzzy documentation
2013-03-13 01:04:23 -04:00
Lucas Duailibe
5a8880e86f Correcting typo in writing.rst
Simple typo: "fishes" -> "finishes"
2013-03-06 19:59:08 -03:00
Adrian Sampson
e780ff27c2 update plugin API docs for 1.1 2013-02-16 15:04:07 -08:00
Dang Mai
7fe9e2ea18 Refer to the lib param in the documentation 2013-01-31 16:54:42 -05:00
Adrian Sampson
58dc7be0a7 docs for new plugin events (#79) 2013-01-29 20:59:02 -08:00
Adrian Sampson
11e1fd1bd8 document new Confit-based configuration 2012-12-20 21:56:47 -08:00
Adrian Sampson
6200f0a4c8 scrub: remove all types of tags 2012-08-24 15:39:13 -07:00
Adrian Sampson
96de3ee400 add track mapping to album_distance plugin method 2012-08-03 18:12:58 -07:00
Adrian Sampson
ad4b7f8ff5 new plugin event: import_task_files 2012-06-14 12:41:39 -07:00
Adrian Sampson
48ffa08928 plugin import stages 2012-06-08 14:49:04 -07:00
Adrian Sampson
dfcd47942d new plugin event: library_opened 2012-05-15 12:39:04 -07:00
Adrian Sampson
c9da7bf3f8 new plugin event: import_task_choice 2012-05-15 12:33:57 -07: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
01dce53212 store Acoustid data in DB & file
This is accomplished via a new event, "import_task_apply", which is called
right after metadata is applied to newly-imported items.

This change makes chroma REQUIRE a new version (0.6) of pyacoustid. Users with
older versions installed will see complaints about a missing method
"fingerprint_file".
2012-04-01 19:38:46 -07:00
Adrian Sampson
82a4bafc3e chroma: fingerprint when task begins
The old "caching"-based approach to fingerprinting was kinda hacky to begin
with. Now, the chroma plugin has an explicit opportunity (in the form of a new
event) to perform its initial fingerprinting and lookup for all tracks. Then,
this information is used explicitly during the autotagging phase rather than
being used transparently through memoization of the lookup function.
2012-04-01 18:55:14 -07:00
Adrian Sampson
6fd8ae0e95 move plugin API docs to their own page 2012-02-09 14:43:59 -08:00