Commit graph

6487 commits

Author SHA1 Message Date
Adrian Sampson
ff9d888541 bump up weight of track lengths 2010-08-05 16:51:36 -07:00
Adrian Sampson
45870e6639 fix failure mode of order_items for length mismatch 2010-08-05 16:34:18 -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
8eeaead135 fixed pause & resume, which neither paused nor resumed
In the multithreaded version, the "directory done" state was written before
other progress states, causing it to be overwritten. This was because I had
stupidly put the "done" message in the initial generator, which of course
finishes before the entire pipeline finished. This manifested as two problems:
the tagger would always want to "resume" even when it had finished the last
time; "aBort"ing the process would not cause the next run to resume.
2010-08-04 11:30:02 -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
959c6e55c3 fixed adding tags where they already existed (but were empty) 2010-08-03 17:33:04 -07:00
Adrian Sampson
7dadbc6734 use a console_script instead of a script for Windows compat 2010-08-03 14:52:25 -07:00
Adrian Sampson
59063e4494 NEWS about pause & resume 2010-08-02 19:49:44 -07:00
Adrian Sampson
6c4ce92077 don't bother poisoning the queue on exception
Previously, we tried to shut down everything very nicely by sending along a
channel poison message when an exception occurred. That, of course, was
disastrous because some of the pipeline was no longer running and the poison
was unlikely to get all the way through. Now we just abort every thread and
clear every queue (to force the abort even when blocking on enqueues). This
problem manifested as a deadlock when an exception occurred in the final
stage.
2010-08-02 19:40:35 -07:00
Adrian Sampson
3f34c5c9eb make pipeline exceptions look more natural 2010-08-02 19:16:32 -07:00
Adrian Sampson
df766abcb4 reliably terminate pipeline when exception is raised
Previously, the producer thread (i.e., the first stage) would continue running
to completion even when an exception was raised! And, depending on the size of
the queue, deadlock was even possible if the next stage was no longer consuming
the produced values.
2010-08-02 19:07:47 -07:00
Adrian Sampson
4239c08127 add aBort option for all tagger UI inputs 2010-08-02 16:32:16 -07:00
Adrian Sampson
477c4bf3ba use None instead of pipeline.BUBBLE to indicate skips
This makes the apply_choices coroutine run even for albums that are skipped or
still in the library. This (along with making things more predictable) lets the
apply_choices stage write the progress value as albums are retired even if they
are skipped.
2010-08-02 16:15:08 -07:00
Adrian Sampson
9da55376db basic resuming of crashed tagging via .beetsstate file 2010-08-02 16:08:49 -07:00
Adrian Sampson
8ee6b18e1d colorize distances in tagger output 2010-08-01 16:15:52 -07:00
Adrian Sampson
1b5a2afd35 initial autotagger output coloring (of titles and tracks only) 2010-08-01 15:35:11 -07:00
Adrian Sampson
957b414f97 code cleanup and NEWS for parallel tagger 2010-07-31 19:23:14 -07:00
Adrian Sampson
ee6b15b367 abstract pipeline implementation into its own module 2010-07-31 19:12:10 -07:00
Adrian Sampson
45ee9b210c initial ad-hoc implementation of threaded tagger 2010-07-31 17:02:25 -07:00
Adrian Sampson
2fecb1c8e8 refactor autotagger UI again into coroutines 2010-07-31 16:06:07 -07:00
Adrian Sampson
6b5edbeead path sanitation now removes ? 2010-07-30 15:27:53 -07:00
Adrian Sampson
2e23c2acc6 oops: one more unicode-decode in _sorted_walk 2010-07-30 09:51:20 -07:00
Adrian Sampson
51f9db16cf _sorted_walk works only with unicode paths 2010-07-30 09:45:33 -07:00
Adrian Sampson
8f5aa3c594 make MusicBrainz queries thread-safe with a module-global lock 2010-07-29 11:47:19 -07:00
Adrian Sampson
0746fca7d7 bump version to b4 2010-07-29 11:12:38 -07:00
Adrian Sampson
fb7773ba46 fixed deleting of albums (rm -a): now deletes album entry 2010-07-29 11:10:59 -07:00
Adrian Sampson
5a10fb446e tagger refactoring in preparation for concurrent tagging 2010-07-29 10:57:10 -07:00
Adrian Sampson
61fa32e4ac fixed printing when no locale is set (#78) 2010-07-26 15:07:41 -07:00
Adrian Sampson
948a6930dc Added tag 1.0b3 for changeset a5e6430ece5a 2010-07-22 22:27:09 -07:00
Adrian Sampson
e591063e82 "pluginpath" config value 2010-07-22 17:09:47 -07:00
Adrian Sampson
7e56cd199d add test ensuring that tagless MP3s are not modified when opened 2010-07-22 13:21:39 -07:00
Adrian Sampson
5b2653bb53 albumify plugin for upgrading old databases 2010-07-22 10:52:43 -07:00
Adrian Sampson
adcaaf3a13 news about $format 2010-07-21 23:04:48 -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
1bb17de8b0 fetch release group ID, in preparation for getting "original date" 2010-07-21 22:48:42 -07:00
Adrian Sampson
2d54e0cb56 NEWS note about "improved" ls -a &c. 2010-07-21 16:21:17 -07:00
Adrian Sampson
4b313fdbfb fix a test that was leaving cover.jpg strewn about 2010-07-21 16:19:10 -07:00
Adrian Sampson
11c9b7fad9 move album/art file tests to test_files from test_db 2010-07-21 16:11:08 -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
c62b1355f1 don't fetch art when importing as-is 2010-07-21 10:30:23 -07:00
Adrian Sampson
6c0895de96 make sure beetsplug is loaded as a namespace package 2010-07-20 23:15:19 -07:00
Adrian Sampson
602f896bd1 import -A now tags albums
Previously, importing without autotagging just imported a bunch of Items. Now,
like the autotagging version, "import -A" creates albums based on the directory
hierarchy. The effect is exactly as if the user chose "use as-is" every time in
the interactive procedure. One side effect is that "import -A" can now only take
directories, where previously it could take single items on the command line. We
need a new solution for this kind of import in the future.
2010-07-15 13:58:16 -07:00
Adrian Sampson
e9e90fa538 expand set of album metadata to include everything relevant 2010-07-15 11:22:36 -07:00
Adrian Sampson
a69fd39cb5 NEWS note about album art and albums table 2010-07-14 23:38:15 -07:00
Adrian Sampson
f181835e2a abandon attempt at making albums implicit from items
--HG--
branch : implalbum
extra : close : 1
2010-07-14 23:36:35 -07:00
Adrian Sampson
7816b411ad simplified interface for add_album 2010-07-14 23:04:59 -07:00