Commit graph

2187 commits

Author SHA1 Message Date
Adrian Sampson
c2acab510d album.move() now also stores
This lets items see any modifications to the album (when the album's fields
are dirty). It's also symmetric with the same method on items.
2013-08-21 09:07:20 -07:00
Adrian Sampson
8bcbe1dea2 fix outdated SQL query 2013-08-20 16:22:24 -07:00
Adrian Sampson
8bdf2d0efe fix dirtying when unchanged, artpath wrapping
Also some naming mistakes.
2013-08-20 16:05:45 -07:00
Adrian Sampson
238e743b5e add load() method to LibModel 2013-08-20 15:47:28 -07:00
Adrian Sampson
4d20d3b296 album.store() now also affects tracks 2013-08-20 15:32:27 -07:00
Adrian Sampson
50f724186f revamp ResultIterator (now Results)
This new design lets us provide better common functionality. The `get()`
method is a particularly good example: we can now avoid the try/except dance
that was previously necessary to get the only result for a single-result
query. This also lets us continue using `len()` on the result of
`album.items()`, which previously returned a materialized list.
2013-08-20 14:54:24 -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
abfad7b2a9 kill BaseAlbum
I added this back when I thought I would implement a different subclass that
represented iPods. That means I wrote this code when I had a lime iPod mini. I
am old.
2013-08-16 17:28:21 -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
206dee34f8 flexible attributes as slow queries
Queries over flexible attributes now Just Work!
2013-08-16 14:46:46 -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
1a0d9c507d drop flexattr namespaces
Namespaces were a worthy idea, but they added a lot of complexity to both the
library code itself and every client of the flexattrs interfaces. Getting rid
of them, and having one flat namespace of both traditional fields and
flexattrs, has one huge benefit: we can "promote" flexattrs to real attributes
(and vice versa) without code changes in every client.

This frees us to have a somewhat less efficient implementation of flexattrs
because we have a smooth upgrade path for making attributes more efficient via
promotion.
2013-08-16 11:18:05 -07:00
Adrian Sampson
3b9b39e5c9 merge with master 2013-08-15 18:14:33 -07:00
Adrian Sampson
3757aec494 fix homebrew gstreamer instructions 2013-08-15 17:46:03 -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
Adrian Sampson
bb191e7ced Merge pull request #354 from mineo/docs-fixup-2
Docs fixup
2013-08-06 09:46:14 -07:00
Wieland Hoffmann
e4af04e3be docs/inline.rst: The `[paths] section is now paths:` 2013-08-06 10:41:05 +02:00
Wieland Hoffmann
aafcbdc730 plugins/zero.rst: Add a missing 'a' 2013-08-06 10:41:05 +02:00
Wieland Hoffmann
d6673b7f79 plugins/zero.rst: Add a missing 'the' 2013-08-06 10:41:05 +02:00
Wieland Hoffmann
39d67363b5 ref/cli.rst: Remove a 'd' 2013-08-06 10:40:17 +02:00
Wieland Hoffmann
e0ea009508 ref/cli.rst: Add a missing 'k' 2013-08-06 10:40:17 +02:00
Wieland Hoffmann
ec30e3d377 guides/tagger: Make emailing Adrian less imperative 2013-08-06 10:40:17 +02:00
Adrian Sampson
c1b66105dd fix regex (and other) queries in path field 2013-08-04 13:12:25 -07:00
Adrian Sampson
dfb7509540 Merge pull request #353 from mineo/patch-4
pathformat.rst: Add back "track"
2013-08-03 13:23:15 -07:00
Wieland Hoffmann
0082570e11 pathformat.rst: Add back "track"
This got lost in e0bb3b5cd0 but is really essential enough to appear in that list.
2013-08-03 15:13:29 +02:00
Adrian Sampson
01b4d39bdc Merge pull request #352 from mineo/patch-3
Beets is a music library manager, not a TARDIS
2013-08-02 14:12:47 -07:00
Wieland Hoffmann
d849f37d0a Beets is a music library manager, not a TARDIS 2013-08-02 23:09:31 +02:00
Adrian Sampson
f493156e2d beets is now in the official Arch package repo 2013-07-30 21:59:33 -07:00
Fabrice L.
ed15c18bc8 Update index.rst
`pluginpath` option is described in *config* page, not *cli*
2013-07-27 10:34:49 +02:00
Adrian Sampson
d6432a6c36 Merge pull request #342 from mineo/patch-2
docs/.../cli.rst: Add an `of` to the description of `update -p`
2013-07-12 12:18:55 -07:00
Wieland Hoffmann
cc3d12f218 docs/.../cli.rst: Add an of to the description of update -p
This seems to have been missed when the documentation was added in the first place.
2013-07-12 19:11:47 +02:00
Adrian Sampson
194465e377 travis: don't --use-mirrors with pip
Since the CDN was added to PyPI, --use-mirrors just makes things slower and
less reliable.

http://comments.gmane.org/gmane.comp.python.distutils.devel/18440
2013-07-05 09:36:08 -07:00
Adrian Sampson
a6bed1135e changelog for #340 2013-07-02 20:12:52 -07:00
Adrian Sampson
fc8c4fbafc Merge pull request #340 from laarmen/fix_bpd_search
bpd: Use AnyFieldQuery when searching "any" fields
2013-07-02 20:11:35 -07: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
Adrian Sampson
214e6f76d9 changelog for #339 2013-06-30 18:34:42 -07:00
Adrian Sampson
24471f2f69 Merge pull request #339 from KraYmer/lyrics-enh
lyrics: google backend should turn up (even) more results
2013-06-30 18:29:50 -07: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
649dcd760d changelog for #335, version bump 2013-06-26 22:03:02 -07:00
Adrian Sampson
3a20a83ad4 Merge pull request #335 from dsedivec/master
Send a plug-in event when file is moved
2013-06-26 21:59:16 -07:00
Dale Sedivec
0e994c2274 Add Item instance to item_moved event
This brings this plug-in event in to line with similar events.
2013-06-26 22:10:19 -05:00
Dale Sedivec
ee5b0d36c4 Document new plug-in event item_moved 2013-06-25 22:31:01 -05:00
Dale Sedivec
fe886d363a Send a plug-in event when file is moved
I use this in one of my plug-ins to notice when I've moved all the audio
files in an album from one directory to another, at which point I move
any associated non-album files to the new directory and delete the old
directory.
2013-06-24 00:17:37 -05:00
Adrian Sampson
b1bb2e5c80 Added tag v1.2.1 for changeset bd7259ac13b5 2013-06-22 15:58:29 -07:00
Adrian Sampson
252b476f43 clean up changelog for release 2013-06-22 15:44:24 -07:00