Commit graph

28 commits

Author SHA1 Message Date
Adrian Sampson
073ee14e56 fix broken matching of path format queries (#405)
A bug in the shlex module with Unicode strings made these queries unparseable
and thus match every track.
2012-06-23 17:18:28 -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
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
104aec3c2f cleanup and docs for regular expression queries 2012-05-01 20:03:01 -07:00
Matteo Mecucci
46ec5db3fe Added unit tests for regexps in query expressions. 2012-04-28 15:24:42 +02:00
Adrian Sampson
5a0105b12c fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
Adrian Sampson
fed8782ca1 fix Unicode queries from CLI arguments 2011-07-01 15:43:06 -07:00
Adrian Sampson
7f206baae5 automatically detect path queries containing / (finishes #146) 2011-06-26 00:25:39 -07:00
Adrian Sampson
fcc2744ac5 use separate shell arguments for queries to preserve whitespace 2011-06-26 00:12:45 -07:00
Adrian Sampson
f3ac19622a a couple of fixes for path queries 2011-06-25 14:23:32 -07:00
Adrian Sampson
6ca995f4e7 new path queries only match prefixes 2011-06-14 23:19:18 -07:00
Adrian Sampson
efa704f61e fix crash when using an item-only field in an album query 2011-06-13 21:27:13 -07:00
Adrian Sampson
8341dee3ab reorder items() and albums() parameters to reflect common use 2011-05-05 17:20:24 -07:00
Adrian Sampson
151df84150 remove unused artists() and get() methods on library 2011-05-05 17:11:54 -07:00
Adrian Sampson
85ddfa4381 relocatable test rsrc directory 2011-04-12 14:26:48 -07:00
Adrian Sampson
7503c1174a more natural-looking queries for comp field
You can now use "comp:true" or "comp:yes" as well as "comp:1".
2011-04-10 22:55:25 -07:00
Adrian Sampson
d63a9fd188 singleton: queries 2011-04-09 16:13:12 -07:00
Adrian Sampson
43a5e913a7 move some reused testing stuff to _common module 2011-03-23 16:15:18 -07:00
Adrian Sampson
b5c38970cc add test for wlof's albumartist searching fix 2011-03-23 16:01:35 -07:00
wlof
7be77a99d9 .. is now inserted at the beginning of sys.path so that local beets
files are used instead of installed ones
2011-03-19 01:45:35 +01:00
Adrian Sampson
d16e972088 fix count queries over empty results 2011-01-24 15:41:38 -08:00
Adrian Sampson
cc3ec0d8aa albums() browse function now returns Album objects
As part of this, the BaseLibrary class was also adapted to include a notion of
albums. This is reflected by the new BaseAlbum class, which the Album class
(formerly _AlbumInfo) completely replaces in the concrete Library. The BaseAlbum
class just fetches metadata from the underlying items.
2010-07-21 15:02:08 -07:00
Adrian Sampson
aec7bef504 add MusicBrainz ID fields to database schema 2010-07-10 17:53:51 -07:00
Adrian Sampson
ed51369dce track ordering now always uses bipartite matching algorithm, no longer assumes
current metadata to be correct if it's complete

Previously, we were using the Munkres algorithm (minimum bipartite matching) to
order tracks intelligently only as a fallback if the current metadata was
paradoxical or incomplete. This was because of a concern about the performance
of the potentially-O(n^3) Munkres solver. However, it was found that (a) the
performance is actually not bad, taking on the order of 0.02 to perform a
matching, and (b) there was no recourse for the tagger to reorder tracks that
were legitimately in the wrong order. Now, we get intelligent reordering of
badly tagged music even when the metadata seems to be complete.

To retain some of the functionality of the old orderer, the track distance
metric was expanded to include a component reflecting the track index.

In doing this, another bug was discovered in the UI that showed the track name
differences based on an arbitrary ordering. Now, the tag_album function returns
a reordered items list with every candidate.
2010-05-30 23:52:54 -07:00
Adrian Sampson
67c4ec9507 change to MIT license
--HG--
rename : COPYING.txt => LICENSE.txt
2010-05-28 00:07:11 -07:00
Adrian Sampson
f6a0345786 intuitive field restrictions on text queries for browsing functions 2010-04-10 13:17:44 -07:00
adrian.sampson
60848d85ee added GPL license and accompanying notice
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40197
2009-04-09 02:46:22 +00:00
adrian.sampson
cd124d2dad new tests for DB and file operations
Also, new organization for tests and automatic loader. Fixed bugs uncovered by new tests.

--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4069
2008-07-07 05:23:17 +00:00
Renamed from test/test_library.py (Browse further)