Commit graph

418 commits

Author SHA1 Message Date
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
6ce08c4ce6 merge 2012-05-08 11:59:41 -07:00
Adrian Sampson
8b25a86ee3 use 2.6-compatible format strings 2012-05-08 11:46:08 -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
5ebb61bab7 moving import (#266): move album art files 2012-05-03 17:08:52 -07:00
Adrian Sampson
104aec3c2f cleanup and docs for regular expression queries 2012-05-01 20:03:01 -07:00
Adrian Sampson
a6e6da245a Merge branch 'upstream' of https://github.com/djrtl/beets-dj
Conflicts:
	beets/library.py
2012-05-01 19:17:05 -07:00
Adrian Sampson
1ee07e116e flexible -f templates for album listings (and rdm) 2012-04-30 22:59:17 -07:00
Adrian Sampson
ef45461cf9 evaluate_template is now a method on Item 2012-04-30 21:40:02 -07:00
Adrian Sampson
792c5b5e5d cleanup and docs for -f option flexibility 2012-04-30 21:26:49 -07:00
Adrian Sampson
928730e0ed merge GH-33: more flexibility for -f arguments 2012-04-30 21:17:20 -07:00
Adrian Sampson
6d7cbd6d2f get list of tmpl_* functions only once 2012-04-29 19:55:34 -07:00
Adrian Sampson
e85fe2d834 fix memoization presence check 2012-04-29 18:20:37 -07:00
Adrian Sampson
de87fb7489 memoize %aunique results (share among tracks) 2012-04-29 18:07:29 -07:00
Adrian Sampson
d042bed27c pre-parse path format templates
Instead of parsing the template at each call to destination(), it's now possible
to parse them *once*, a priori, and re-use the resulting template object. This
is analogous to the re module's compiled expressions.
2012-04-29 15:30:43 -07:00
Adrian Sampson
2087ff6e41 add items to DB before moving/copying (#190)
Previously, all files would be moved/copied/deleted before the corresponding
Items and Albums were added to the database. Now, the in-place items are added
to the database; the files are moved; and then the new paths are saved to the
DB. The apply_choices coroutine now executes two database transactions per task.
This has a couple of benefits:
- %aunique{} requires album structures to be in place before the destination()
  call, so this now works as expected.
- As an added bonus, the "in_album" parameter to move() and destination() --
  along with its associated ugly hacks -- is no longer required.
2012-04-29 14:14:11 -07:00
Steve Dougherty
c93e7e443e Run functions and substitute fields in list format strings. 2012-04-29 11:11:57 -04:00
Adrian Sampson
4b253df48c ensure album art path is unique when moving
Avoid filename collisions on cover art when running a "beet move". (This is
already covered for adding new art and for moving audio files.)
2012-04-28 21:14:11 -07:00
Matteo Mecucci
f4a0595b32 Fixed the regexp function used with sqlite3. 2012-04-28 15:24:42 +02:00
Matteo Mecucci
10a4e14045 Added regexps to queries, use with additional column before pattern eg 'title::^Quiet' or ':^Quiet'. 2012-04-28 15:24:17 +02:00
Adrian Sampson
8f128876e2 %aunique: use a single field instead of a sequence
For a less cumbersome uniquifying string, only a single field value is now used
instead of a prefix of a list of fields. The old semantics had two problems that
made it both unnecessary and insufficient:
- In the vast majority of cases, a single field suffices (year OR label OR
  catalog number, for example) and forcing the string to include many identical
  fields is unnecessary.
- If the albums are very similar, a prefix may be insufficient; a better
  solution may be found with an arbitrary subset. (Of course, we can't afford to
  search the whole power set.)
So we're going with a single field for now. This should cause far less
confusion.
2012-04-24 21:15:50 -07:00
Adrian Sampson
8fe3738710 default arguments to %aunique{} (#190) 2012-04-24 20:34:51 -07:00
Adrian Sampson
938a9b2f96 catalognum is an album-level field 2012-04-24 20:03:11 -07:00
Adrian Sampson
f20fbede5e sanitize output of %unique 2012-04-20 10:17:19 -07:00
Adrian Sampson
251026b759 add a new batch of metadata fields
The new fields are:
ALBUM: mb_releasegroupid asin catalognum script language country albumstatus
media albumdisambig
TRACK: disctitle encoder
These are not yet parsed from MusicBrainz responses (just added to MediaFile
and the database).
2012-04-04 00:52:57 -07:00
Adrian Sampson
ffa2402ff4 revamp default character substitutions
There's no longer a distinction between Unix and Windows substitutions. Enough
users reported problems with Windows-forbidden characters on Samba shares that
it seems appropriate to make all filenames Windows-safe, even on Unix. Users who
really want those additional characters (<>:"?*|\) can re-enable them via the
"replace" option. Nobody has complained about beets being *too* conservative.

This also adds sanitization of control characters, which is an all-around good
idea, and the substitution now runs in the Unicode (rather than byte) domain.
2012-04-03 14:22:38 -07:00
Adrian Sampson
de6530f4a5 acoustid ID and fingerprint stored/tracked (#332) 2012-04-01 18:22:42 -07:00
Adrian Sampson
781c26ffd0 normalize to NFC on non-Mac platforms (#367) 2012-03-27 10:44:11 -07:00
Adrian Sampson
823e36ad01 normalize new filenames to with NFD 2012-03-26 12:14:30 -07:00
Adrian Sampson
3c4d8500e5 sort by sort names 2012-03-25 17:35:07 -07:00
Adrian Sampson
12998de8ee mark album artist sort as an album field 2012-03-25 17:13:12 -07:00
Adrian Sampson
2f1ac61d4f track and album artist sort names (GH-25, GC-77)
Previously, there was just an "artist sort name" field -- now there's a
corresponding sort name for both track artists and album artists. I also made
the names shorter (artist_sort and albumartist_sort).
2012-03-25 17:02:52 -07:00
Paul Provost
1e4f2d555f Merge branch 'master' of https://github.com/sampsyo/beets 2012-03-24 17:25:26 -04:00
Adrian Sampson
06f137bff9 %unique path function
Generates disambiguating strings to distinguish albums from one another. To be
used as the basis for a simpler path field, $unique, as a default disambiguator.
2012-03-22 18:04:06 -07:00
Adrian Sampson
8fad15263b reorganize default template functions into class
Using a class wrapper allows additional context to be provided to the functions.
Namely, we can now provide the Item itself to the function, so %foo{} could
conceivably do something useful even without arguments. This will be used for
the upcoming %unique function.
2012-03-22 17:08:22 -07:00
Paul Provost
68952209d5 Added artist sort name
- MP3 tag saved
- Available template field as $artist_sort_name
2012-03-10 18:51:48 -05:00
Adrian Sampson
bb4be3a303 lower case extensions in destination (#331) 2012-01-31 15:11:19 -08:00
Adrian Sampson
337e2556a6 sanitize path components from plugins (#315) 2012-01-30 16:53:05 -08:00
Adrian Sampson
fe33926038 add new audio properties to library/DB
$samplerate now expands to "##kHz" in path formats.
2012-01-27 16:04:51 -08:00
Adrian Sampson
979c33a0b1 fix substring pattern match when value is None 2012-01-06 10:36:34 -08:00
Adrian Sampson
9920cc482c add "scrub" plugin (#280)
--HG--
rename : beetsplug/embedart.py => beetsplug/scrub.py
rename : docs/plugins/embedart.rst => docs/plugins/scrub.rst
2012-01-02 14:03:28 -08:00
Adrian Sampson
d73c133a53 query-conditioned path formats (#210)
Also, Library.path_formats is now a list of pairs instead of a dictionary. (I
would have used an OrderedDict, but that was added in 2.7.)
2011-12-28 19:01:13 -08:00
Adrian Sampson
112d0f5452 uniquify conflicting filenames (#182) 2011-12-19 22:52:13 -08:00
Adrian Sampson
8fde981b1d add asciify function 2011-12-19 19:41:09 -08:00
Adrian Sampson
b493bc7004 configurable pathname substitution (#115) 2011-12-19 18:37:35 -08:00
Adrian Sampson
91901fc379 plugin-extensible path format fields (#169) 2011-12-17 21:29:15 -08:00
Adrian Sampson
f1ebc82a55 plugin hooks for template functions (#231) 2011-12-16 11:56:40 -08:00
Adrian Sampson
255fbf6c41 add a small set of default path functions (#231) 2011-12-15 14:27:59 -08:00
Adrian Sampson
3c99e54174 switch out string.Template with new template parser (#231) 2011-12-15 11:53:58 -08:00
Adrian Sampson
6eaf3f96ae don't include path queries when querying albums 2011-12-07 16:52:38 -08:00
Adrian Sampson
348eb2beff don't update mtime when moving
This is incorrect when the file was out-of-sync when moved. A possible approach
in the future could check whether the old mtime was up to date and, in that case
only, keep it up to date with the new filename.
2011-12-07 16:38:38 -08:00
Adrian Sampson
8736d359c6 "timeout" config value (#261) 2011-12-04 18:46:35 -08:00
Adrian Sampson
b9d6928278 consistency policy for DB mtimes (#227) 2011-12-03 17:18:51 -08:00
Adrian Sampson
d805401b23 simplifications afforded by eager result iterators (#261) 2011-11-27 22:35:19 -08:00
Adrian Sampson
bcc348f018 make result iterators query the database eagerly (#261)
Previously, ResultIterators would query the database lazily. Specifically, they
would only fetch a row from the underlying cursor when an Item was pulled from
the iterator. This was a performance optimization. However, it was causing
endless headaches due to SQLite's locking policy: as long as the cursor is
"open", it holds a reader lock. This led to many hard-to-diagnose problems when
trying to acquire a writer lock. This solution may require a little more memory,
but it should put an end to this kind of bug for good.
2011-11-27 22:29:32 -08:00
Adrian Sampson
78dca315d4 slightly clean up mtime feature; changelog mention 2011-11-22 00:11:45 -08:00
Jos van der Til
2c81ee736c Implemented file modified time tracking to beets.
Only files which were modified after beets checked them will be checked again.
Implements feature request #227

--HG--
extra : transplant_source : K%F1d%C5%B1%1F%CA%AB%95ck%8C%AC%25m%F0%26%E4%9DB
2011-11-21 19:51:16 +01:00
Adrian Sampson
af98a2fb01 move/copy album art along with items automatically (#229) 2011-09-15 17:26:12 -07:00
Adrian Sampson
c67f88bccb final refactoring: lib.move() now affects DB 2011-09-15 16:38:36 -07:00
Adrian Sampson
5d3796b404 further move() refactoring: file manipulation on Item 2011-09-15 16:22:47 -07:00
Adrian Sampson
e8b8cb179f refactor: move() is a method on Library (not Item) 2011-09-15 16:15:53 -07:00
Adrian Sampson
94569a774e moving/copying fails when destination exists (#230) 2011-08-28 18:25:38 -07:00
Adrian Sampson
45eeea343e destination option for "beet move" (also tests) 2011-08-05 12:19:34 -07:00
Adrian Sampson
2c56fd22f2 fix replacement of in-library items 2011-08-04 16:14:07 -07:00
Adrian Sampson
248bccf951 move, rather than copying, when re-importing 2011-08-04 14:08:11 -07:00
Adrian Sampson
f54ace110c allow "null" album art setting (when it's already in place) 2011-08-04 12:19:30 -07:00
Adrian Sampson
e84c3e7abd consolidate update command, removing album-munging logic 2011-08-02 23:37:55 -07:00
Adrian Sampson
fdf697dc90 merge in wlof's "update" command 2011-08-02 20:43:21 -07:00
Adrian Sampson
e1d9e6bb45 prune directories when moving 2011-08-02 16:01:11 -07:00
Adrian Sampson
a367b2764d first attempt at command-line modification command (#56) 2011-08-02 13:59:33 -07:00
wlof
2495227724 Detect deleted files
Display detected modifications
2011-08-02 21:20:23 +02:00
wlof
fca60c510e update feature (issue 107) 2011-08-01 04:59:20 +02:00
Adrian Sampson
a448879ca9 infer album artist or VA for as-is imports (#161) 2011-06-29 10:36:07 -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
1006a9a221 merge/fixup derwin's label patch 2011-06-25 13:04:19 -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
6291a71a3c fix "mpdupdate runs twice" bug 2011-05-23 09:45:34 -07:00
Adrian Sampson
39dac9a28d "beet ls -p" outputs paths 2011-05-21 12:40:36 -07:00
Adrian Sampson
e5e11503ad a couple more cursor closings 2011-05-05 18:26:29 -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
3e90579a6c BPD uses new VFS as a backend (#131) 2011-05-05 17:00:05 -07:00
Adrian Sampson
926032fd07 add simple virtual filesystem construction
--HG--
rename : test/test_art.py => test/test_vfs.py
2011-05-05 14:19:47 -07:00
Adrian Sampson
d8ae325dcb stop being sloppy about close()ing SELECT cursors (#170) 2011-05-05 10:06:41 -07:00
Adrian Sampson
e588638e8e fix typo uncovered by pylint 2011-04-28 22:36:29 -07:00
Adrian Sampson
a0e0104d83 clean up some log handler addtions 2011-04-15 12:30:12 -07:00
Adrian Sampson
6cfb862906 conditional deletes in some cases (suggested in #170) 2011-04-13 20:23:33 -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
e669868896 move a bunch of functions to util 2011-04-10 21:48:05 -07:00
Adrian Sampson
11c5b15c8d fix copying destination for full-album imports 2011-04-10 10:57:13 -07:00
Adrian Sampson
d63a9fd188 singleton: queries 2011-04-09 16:13:12 -07:00
Adrian Sampson
b28ef722a5 singleton path format 2011-04-09 14:50:48 -07:00
Adrian Sampson
61ef980797 $albumartist falls back to $artist (#166) 2011-04-09 12:36:52 -07:00
Adrian Sampson
2dfae9721d fix typo in dead code 2011-04-05 18:43:47 -07:00
Adrian Sampson
c41c9f38f8 add a missing _syspath call 2011-03-23 18:31:44 -07:00
Adrian Sampson
d16311acb6 only prune directories below the library directory 2011-03-23 17:12:07 -07:00
Adrian Sampson
1b6910ac6a move directory-pruning to item's remove() method 2011-03-23 17:03:21 -07:00
Adrian Sampson
7f7c45b252 refactoring, tests, NEWS note on wlof's directory-pruning patch 2011-03-23 16:53:24 -07:00
Adrian Sampson
f69f69cecf merge in some fixes from wlof's repository 2011-03-23 15:50:11 -07:00
Adrian Sampson
096816cba7 path formats can now be specified by album type 2011-03-22 20:09:27 -07:00
wlof
c2d2914178 fix for issue 73 (http://code.google.com/p/beets/issues/detail?id=73) 2011-03-19 19:48:55 +01:00
wlof
1a3769a326 corrected a bug where artist was being used instead of albumartist in
albums default queries
2011-03-19 01:48:33 +01:00
Adrian Sampson
0d869340ec fixes for album artist inference
- Inference must be enabled explicitly with the "infer_aa" flag. It does not
  happen transparently.
- Infer both artist and artist ID.
- Fixed a bug where only the database row was using the inferred data, not the
  returned data structure.
- Added tests.
2011-02-18 12:17:22 -08:00
Adrian Sampson
adefff10dd use super() instead of hard-coding superclass name 2011-02-18 11:30:01 -08:00
Ozzi Lee
82e5f0cfa2 Make sure album.albumartist is set when adding items to a Library.
If the track.albumartist isn't set on the first track, then the
album.albumartist is set to the track.artist.
2011-02-18 06:17:35 -06:00
Ozzi Lee
95a456acfc Use object.setattr in BaseAlbum __init__ method.
BaseAlbum needs to use object.setattr in its __init__ method, because
it overrides __setattr__.
2011-02-02 13:09:06 -06:00
Adrian Sampson
d16e972088 fix count queries over empty results 2011-01-24 15:41:38 -08:00
Adrian Sampson
66b3e5675c update default path formats; make $artist fall back on $albumartist
The default path formats now include both a "default", which is the same as
before but now uses $albumartist instead of $artist, and a "comp" path, which
uses a Compilations directory. Old paths are supported as-is by letting $artist
refer to either a track artist (when present, as it is in all old library
tracks) or album artist (when the track artist isn't present, as is the case
with most albums imported now).
2011-01-24 10:14:19 -08:00
Adrian Sampson
0c24376e6a migration of album table's artist field to albumartist; fix ls -a 2011-01-23 22:49:52 -08:00
Adrian Sampson
75e0924832 move _sanitize_for_path to module namespace 2011-01-23 19:59:41 -08:00
Adrian Sampson
6ade5635e1 light refactoring and renaming for patch
Changed mb_albumtype to albumtype.
Changed album_artist to albumartist.
Reinstated subset relationship between album fields and item fields.
2011-01-23 19:49:48 -08:00
Adrian Sampson
342c360285 apply jonathan.buchanan's compilation patch from issue #48 2011-01-23 18:41:35 -08:00
Adrian Sampson
3bfae3b78c fix permissions on album art (#130) 2011-01-21 17:57:58 -08:00
Adrian Sampson
93594bac5a convert import paths to absolute; more _syspath calls
Again, patch mainly due to jonathan.buchanan.
2011-01-20 00:13:00 -08:00
Adrian Sampson
4359845a01 prohibit trailing spaces in Windows filenames 2011-01-19 13:17:54 -08:00
Adrian Sampson
5904852e4b use "long filename" support instead of short truncation on Windows (#127)
(Patch by jonathan.buchanan. Thanks!)
2011-01-19 13:14:54 -08:00
Adrian Sampson
ab35db7b7a truncate path components to 30 characters on Windows (work around #120) 2011-01-18 20:13:57 -08:00
Adrian Sampson
a23fe1c37f don't copy permissions of imported files 2011-01-01 12:12:55 -08:00
Adrian Sampson
87500cf5c4 fix copying when file is already where it needs to be 2011-01-01 10:49:16 -08:00
Adrian Sampson
7cf10d13e5 fix escaping of / in paths on Windows 2010-09-27 16:56:40 -07:00
Adrian Sampson
0b0db17743 normalize relative paths as they opened 2010-09-22 21:40:12 -07:00
Adrian Sampson
d9383aceb1 merge with events branch 2010-09-13 21:46:03 -07:00
Adrian Sampson
fba874932c beginnings of last.fm fingerprinting plugin for autotagger
This required the introduction of a track_distance method on plugins. We'll also
need to add an album_distance method as well as a mechanism for extending the
search routine (so we can search for albums in MusicBrainz even when they have
no tags). This commit also adds the '-v' flag for printing debug logs (something
we should do more of).
2010-09-13 21:14:49 -07:00
Adrian Sampson
a384aa948b add a couple more events: "library saved" and "import finished" 2010-08-30 12:59:51 -07:00
Adrian Sampson
633b97b302 decode unicode art paths from legacy databases 2010-08-06 10:44:00 -07:00
Adrian Sampson
898b4bd24e destination now uses album values when available
When computing track destination paths, we now look for album-level values when
they're available. This has the effect of making albums go into a single
directory even when their tracks have heterogeneous metadata. We will need to
revisit this once we start explicitly supporting non-album tracks.
2010-08-06 10:36:17 -07:00
Adrian Sampson
181949d1a3 _sanitize_path now uses a non-unicode regex 2010-08-06 10:01:49 -07:00
Adrian Sampson
d1c6448da8 album art paths now stored in blobs in database 2010-08-06 09:55:21 -07:00
Adrian Sampson
2a91ddf40b destinations now return bytestring paths 2010-08-05 13:36:50 -07:00
Adrian Sampson
2950ae1bf6 all paths are now bytestrings (not unicode)
In the end, after all of this, it turns out that we basically need to abandon
the temptation of dealing with unicode paths altogether. The POSIX filesystem
API has no notion of unicode and is very much a bytes-only interface. This
means that undecodable pathnames are a reality we must deal with. This new
approach stores all paths as buffers (blobs) in SQLite and -- as transparently
as possible -- presents them as str objects to the Python code. Legacy
databases will have their paths automatically encoded into str objects, and
will lazily have their unicodes in the database replaced with buffers.
2010-08-05 13:26:30 -07:00
Adrian Sampson
eff42d2136 revert a silly decision about hard-coding latin1
Decoding a path as latin1 when it appears undecodable is a non-solution
because, the next time we want to actually *use* the path, it will be encoded
differently and the file won't be found. Death to undecodable paths!
2010-08-04 12:10:08 -07:00
Adrian Sampson
0c87e2470a deal with invalid pathname encodings
So. Apparently, os.listdir() will *try* to give you Unicode when you give it
Unicode, but will occasionally give you bytestrings when it can't decode a
filename. Also, I've now had two separate reports from users whose filesystems
report a UTF-8 filesystem encoding but whose files contain latin1 characters.
The choices were to (a) switch over to bytestrings entirely for filenames or
(b) just deal with the badly-encoded filenames. Option (a) is very unattractive
because it requires me to store bytestrings in sqlite (which is not only
complicated but would require more code to deal with legacy databases) and
complicates the construction of pathnames from (Unicode) metadata. Therefore,
I've implemented a static fallback to latin1 if the default pathname decode
fails. Furthermore, if that also fails, the _sorted_walk function just ignores
the badly-encoded file (and logs an error).
2010-08-04 11:06:28 -07:00
Adrian Sampson
6b5edbeead path sanitation now removes ? 2010-07-30 15:27:53 -07:00
Adrian Sampson
2eb10e391a add "format" field to MediaFile for getting the file type
This allows using $format in your path format string, which is nice.
2010-07-21 23:01:32 -07:00
Adrian Sampson
6754155c71 Albums now have an internal cache of their values
This makes way more sense than fetching every metadata request from the
database. The performance of "beet ls -a" and the like should be drastically
better.
2010-07-21 16:04:59 -07: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
7de294ba9f add get_item convenience function to fetch Items by id
The beetfs project uses this to quickly get paths for items when reading them.
2010-07-21 11:26:43 -07:00
Adrian Sampson
e9e90fa538 expand set of album metadata to include everything relevant 2010-07-15 11:22:36 -07:00
Adrian Sampson
7816b411ad simplified interface for add_album 2010-07-14 23:04:59 -07:00
Adrian Sampson
6b99e3f48d importer now takes album art config options and switch
(doesn't yet actually apply art)
2010-07-14 14:58:17 -07:00
Adrian Sampson
4f1b55f7a9 avoid long database locks by storing items at the end of AlbumInfo.move 2010-07-14 14:38:42 -07:00
Adrian Sampson
6a3c024005 add_art convenience function takes care of copying to destination 2010-07-14 14:28:54 -07:00
Adrian Sampson
304e4d6708 albums move and remove their items, manage album art 2010-07-14 14:19:51 -07:00
Adrian Sampson
19ded256cd albums query and modify their associated items 2010-07-14 13:24:11 -07:00
Adrian Sampson
3006f9953c beginnings of explicit album management 2010-07-14 12:40:25 -07:00
Adrian Sampson
722e0ea2b7 AlbumInfo implementation now uses opaque "ident" field (concretely: row id)
--HG--
extra : transplant_source : %F42%F7k%7F%23%3EY%8E1%C2%9B%B9%1DR%1C%28w%AEm
2010-07-13 21:22:55 -07:00
Adrian Sampson
5096a12052 basic (non-collected) implementation of albums table 2010-07-13 19:42:45 -07:00
Adrian Sampson
bdbabe91da basic album information access through proxy object 2010-07-13 18:01:14 -07:00
Adrian Sampson
84f5577121 comment and docstring cleanup 2010-07-13 17:27:50 -07:00
Adrian Sampson
5d4f452393 add "albums" table to library database (including migrations) 2010-07-13 10:25:42 -07:00
Adrian Sampson
6394371628 better names for KEYS constants 2010-07-13 10:04:17 -07:00
Adrian Sampson
529d2b1c49 start cleanup of field definitions 2010-07-12 18:14:20 -07:00
Adrian Sampson
30669fd7ac replace :s with -s instead of _s in path names 2010-07-11 19:12:50 -07:00
Adrian Sampson
4378db1361 more characters escaped on Windows 2010-07-11 18:14:40 -07:00
Adrian Sampson
aec7bef504 add MusicBrainz ID fields to database schema 2010-07-10 17:53:51 -07:00
Adrian Sampson
f4d7d68e57 rudimentary migration (column adds only) support 2010-07-10 17:37:33 -07:00
Adrian Sampson
f8c317a2cd undefined variable reported by pylint 2010-07-09 18:16:40 -07:00
Adrian Sampson
a0bf6112ae remove dead code: add_path 2010-07-05 21:15:28 -07:00
Adrian Sampson
40a965ea18 detect unreadable files that seem to be of the correct type
In the case that Mutagen throws an exception while trying to read a file, we
throw an UnreadableFileError, which is a new superclass for FileTypeError.
2010-07-03 23:44:28 -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
6769c9b20d make sure pathnames are unicode everywhere 2010-04-09 15:52:31 -07:00
Adrian Sampson
bae5ca5d70 implement get() querying for device libraries 2010-04-06 17:49:19 -07:00
Adrian Sampson
e1c1b1e038 fill out PodLibrary's implementation of the Library methods
--HG--
branch : device
2010-04-06 12:07:21 -07:00
Adrian Sampson
38801813be Item no longer retains a Library (changed constructors)
--HG--
branch : device
2010-04-06 11:45:31 -07:00
Adrian Sampson
68d43380b4 remove remaining library-interaction methods from Item
--HG--
branch : device
2010-04-06 11:36:00 -07:00
Adrian Sampson
628cfbffe2 Item.move() now takes a library as an argument
--HG--
branch : device
2010-04-06 11:18:41 -07:00
Adrian Sampson
c7f98ccde1 make the PodLibrary interface class more consistent; remove more back-references
from Item to Library

(including removing the delete() method, which was unused)

--HG--
branch : device
2010-04-06 11:07:57 -07:00
Adrian Sampson
4d1944f939 better names: add vs. add_path
--HG--
branch : device
2010-04-06 10:17:53 -07:00
Adrian Sampson
d3d485195c move destination calculation to Library from Item
--HG--
branch : device
2010-04-06 10:07:58 -07:00
Adrian Sampson
83d661152e moved library logic to the library: load, store, add, remove
--HG--
branch : device
2010-04-05 23:09:04 -07:00
Adrian Sampson
8e27693d2f create BaseLibrary class, which Library and PodLibrary extend
--HG--
branch : device
2010-04-05 21:50:40 -07:00
Adrian Sampson
4280760191 truncate long filenames 2009-11-28 17:03:36 -08:00
Adrian Sampson
a348e19112 moved per-library settings to config file 2009-11-27 21:18:20 -08:00
Adrian Sampson
71c5141f80 correct super-attribute behavior 2009-11-17 23:15:51 -08:00
adrian.sampson
debebc616c fixed safetifying of destination paths
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40220
2009-04-15 05:48:40 +00:00
adrian.sampson
9e6953246d expanded usefulness of "bts set" command
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40213
2009-04-13 05:00:34 +00:00
adrian.sampson
4b7119855e BPD now reports empty path components as '(unknown)'
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40201
2009-04-12 01:48:37 +00: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
7d10b76169 added list and count
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40184
2009-04-05 20:27:53 +00:00
adrian.sampson
16b36f99a3 first implementation of stats
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40147
2009-03-24 02:47:34 +00:00
adrian.sampson
e2a54e1111 added virtual directory structure, reasonable implementations of all
current browse functions

--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40145
2009-03-24 02:25:59 +00:00
adrian.sampson
834f85e23e added prototype browsing; capitalized SQL
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40138
2009-02-18 08:10:37 +00:00
adrian.sampson
1cdf13ea8d PEP8
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40133
2009-02-10 02:54:11 +00:00
adrian.sampson
e52f0aaaf1 use logger module
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40132
2009-02-10 02:08:00 +00:00
adrian.sampson
b1a45fda0b added bitrate and length to mediafile
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40119
2009-02-07 04:13:36 +00:00
adrian.sampson
8fe53fec4c implemented a bunch of commands
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40115
2009-02-05 06:55:45 +00:00
adrian.sampson
585c10b4db added month & day to library; added Item.__repr__, cleaned up get/setattr
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4087
2008-08-25 07:10:31 +00:00
adrian.sampson
fb4344e937 item fields no longer dirtied if unchanged when assigned
This is especially important for read(), which will assign many times while, in many cases, causing few actual changes. A store() that follows soon after will now be much more lightweight.

--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4079
2008-07-09 21:44:15 +00:00
adrian.sampson
e811b72763 fixed but with copying in library.add, tests
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4078
2008-07-08 00:06:56 +00:00
adrian.sampson
4ba801acb7 paths now normalized to absolute (issue 5)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4076
2008-07-07 22:13:52 +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
adrian.sampson
9090ef25b5 fixed typo from cursor simplification
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4068
2008-07-06 21:50:57 +00:00
adrian.sampson
0be8ffcf32 item fields are no longer automatically updated in the database on setattr
One must now call store(), just like write(). This makes the behavior much more understandable and deterministic-seeming. It is also a small optimization, what with the dirty flags and partial store(). Still no tests.

--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4066
2008-07-06 21:09:38 +00:00
adrian.sampson
e836a76d0d changed maxdisc and maxtrack to disctotal and tracktotal (clearer)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4064
2008-07-06 20:26:49 +00:00
adrian.sampson
bfc68e7a71 finished changing save_tags to save
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4059
2008-07-06 18:28:36 +00:00
adrian.sampson
526b65a9c3 changed beets.tag to beets.mediafile
--HG--
rename : beets/tag.py => beets/mediafile.py
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4050
2008-07-03 23:22:14 +00:00
adrian.sampson
e69152e958 finished new add(); importing now works
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4040
2008-07-03 21:09:05 +00:00
adrian.sampson
2fe30f1195 fixed new add function
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4037
2008-07-03 19:55:02 +00:00
adrian.sampson
f4b95ea1b5 began adding 'import' command & refactor of 'add', but committing so I can erase my disk safely
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4036
2008-06-30 18:45:00 +00:00
adrian.sampson
31f8dd074a finished delete() and remove()
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4030
2008-06-27 21:49:23 +00:00
adrian.sampson
d6472584be fixed store() (can't use sqlite ?-binding for column names in update), although it's never called yet
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4029
2008-06-25 21:14:03 +00:00
adrian.sampson
6b113c8f6e move() now has less confusing behavior, unambiguously moving (even across FS boundaries) or copying
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4023
2008-06-25 06:20:43 +00:00
adrian.sampson
e469f308e1 readability: using Connection.execute shortcut instead of making a new cursor where appropriate
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4022
2008-06-25 06:15:09 +00:00
adrian.sampson
fe67fe00dc move() now copies as a fallback
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4021
2008-06-25 01:43:16 +00:00
adrian.sampson
66d767c054 style: private methods begin with _, not __
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4020
2008-06-25 01:36:32 +00:00
adrian.sampson
e8ac0d6893 added file moving (no copying yet), library options; a little reorganization
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4019
2008-06-25 01:33:01 +00:00
adrian.sampson
e9017f4bba AnySubstringQuery now reuses code from CollectionQuery
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4016
2008-06-11 07:36:22 +00:00
adrian.sampson
7661a283aa moved intelligence of AndQuery to generic CollectionQuery class (allowing later functionality: OrQuery, for instance)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4015
2008-06-11 07:17:10 +00:00
adrian.sampson
e07131830e eliminated pointless distinction between Queries and QueryElements
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4014
2008-06-11 07:14:37 +00:00
adrian.sampson
5daba34d10 added query string parser; library.get
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4011
2008-06-11 07:05:37 +00:00
adrian.sampson
932f839bca added Query object and friends (from_string is next)
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%405
2008-05-15 05:08:31 +00:00
adrian.sampson
2651b1c2b5 cleaned up gratuitous comment blocks and unnecessary shebang lines
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%404
2008-05-14 09:41:15 +00:00
adrian.sampson
fb63de437c new Item class; a more sensible Library interface
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%403
2008-05-14 09:35:00 +00:00
adrian.sampson
ee7bb4b9e8 initial import
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%402
2008-05-14 01:42:56 +00:00