Commit graph

2713 commits

Author SHA1 Message Date
Rowan Lewis
6f0261e5ff Added opus support, maybe. 2013-09-12 07:17:32 +10:00
Adrian Sampson
fa97684e7b fix outdated _record reference in web plugin 2013-09-09 20:56:38 -07:00
Adrian Sampson
3b4e3d47f5 consolidate excess SELECT in load() 2013-09-09 20:41:30 -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
0e042d3d74 better Chromaprint installation instructions 2013-09-07 17:03:24 -07:00
Adrian Sampson
99aa2c6640 Merge pull request #372 from toddbot2/master
add ASCII art logo
2013-08-30 11:05:00 -07:00
Todd Durboraw
7ec209ce63 Fixed logo for real 2013-08-29 22:24:57 -07:00
Todd Durboraw
6aec45a53b fixed logo 2013-08-29 22:14:20 -07:00
Todd Durboraw
2123ea8513 add ascii logo 2013-08-29 20:49:02 -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
247e3b9e01 merge flexattr branch
This is a big change. Some things will probably break.
2013-08-27 17:20:37 -07:00
Adrian Sampson
104f007aaa Added tag v1.2.2 for changeset c6af5962e25b 2013-08-27 09:15:34 -07:00
Adrian Sampson
21a5626347 changelog date/summary for 1.2.2 2013-08-27 09:15:17 -07:00
Adrian Sampson
ca206053ac fix import deletion race
By moving the duplicate file removal to the manipulate_files coroutine, we
ensure that all previous albums are fully moved/copied before trying to delete
their duplicate files.
2013-08-26 14:22:32 -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
f9f8994d85 flexattr description in changelog 2013-08-21 18:44:14 -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
15cf046285 don't reset mtime on awakening from DB 2013-08-21 11:38:48 -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
0176b9742f tests: unknown fields silently match nothing
Previously, an unknown field would be ignored. Now, they're treated as
flexattrs that just haven't been set yet (and thus always hold None).
2013-08-21 09:46:30 -07:00
Adrian Sampson
9e61e49457 fix NumericQuery constructor 2013-08-21 09:42:16 -07:00
Adrian Sampson
9609e41cf8 store albums after moving art 2013-08-21 09:25:47 -07:00
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
e91a08099d remove debug print that slipped in 2013-08-15 18:15:24 -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