Commit graph

12907 commits

Author SHA1 Message Date
Adrian Sampson
ac35ef14df clean up MusicBrainz IDs at the MB layer (rather than exposing them) 2010-09-13 22:42:22 -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
00300cdf81 move event-handling logic into plugin system 2010-08-30 12:50:17 -07:00
Jeffrey Aylesworth
5bf2d86221 Send event after plugins have been loaded 2010-08-29 10:30:02 -04:00
Jeffrey Aylesworth
22be9ea2fb send event method and decorator for listening 2010-08-29 09:47:07 -04:00
Jeffrey Aylesworth
0b9265d815 add an event listener 2010-08-29 09:38:20 -04:00
Jeffrey Aylesworth
c797e48690 python library for the event system 2010-08-29 09:21:57 -04:00
Adrian Sampson
a4a6f0a667 fix silly outdated assumption for "imp -A" 2010-08-22 12:18:51 -07:00
Adrian Sampson
a995c52c5a Added tag 1.0b4 for changeset 127b1ca77a2b 2010-08-09 22:17:07 -07:00
Adrian Sampson
514d1bc706 fixed silly error when listing tracks in BPD 2010-08-09 21:57:06 -07:00
Adrian Sampson
e0809bfaf7 give README an extension (for Github display)
--HG--
rename : README => README.rst
2010-08-09 16:48:20 -07:00
Adrian Sampson
27a4107627 grammar and style in NEWS! 2010-08-06 11:53:04 -07:00
Adrian Sampson
90c4b550fb make track index weight positive
(I'm not sure why, but the weight for track index mismatches was set to 0.0.
This way, the tagger will be slightly more reluctant to frivolously reorder.)
2010-08-06 11:49:31 -07:00
Adrian Sampson
c3988f7300 safely interpret integers in packed values 2010-08-06 11:17:57 -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
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