diff --git a/beetsplug/embedart.py b/beetsplug/embedart.py index 975431051..4b1aca067 100644 --- a/beetsplug/embedart.py +++ b/beetsplug/embedart.py @@ -108,9 +108,9 @@ class EmbedCoverArtPlugin(BeetsPlugin): return [embed_cmd, extract_cmd, clear_cmd] +# 'embedart' command with --file argument. + def embed(lib, imagepath, query): - """'embedart' command with --file argument. - """ albums = lib.albums(query) for i_album in albums: album = i_album @@ -126,9 +126,9 @@ def embed(lib, imagepath, query): config['embedart']['maxwidth'].get(int)) +# 'embedart' command without explicit file. + def embed_current(lib, query): - """'embedart' command without explicit file. - """ albums = lib.albums(query) for album in albums: if not album.artpath: @@ -142,9 +142,9 @@ def embed_current(lib, query): config['embedart']['maxwidth'].get(int)) +# 'extractart' command. + def extract(lib, outpath, query): - """'extractart' command. - """ item = lib.items(query).get() if not item: log.error('No item matches query.') @@ -178,9 +178,9 @@ def extract(lib, outpath, query): f.write(art) +# 'clearart' command. + def clear(lib, query): - """'clearart' command. - """ log.info('Clearing album art from items:') for item in lib.items(query): log.info(u'%s - %s' % (item.artist, item.title)) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index 224d5018f..ac87c57f2 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -264,10 +264,9 @@ class FetchArtPlugin(BeetsPlugin): self.import_stages = [self.fetch_art] self.register_listener('import_task_files', self.assign_art) + # Asynchronous; after music is added to the library. def fetch_art(self, session, task): """Find art for the album being imported.""" - # Asynchronous; after music is added to the library. - if task.is_album: # Only fetch art for full albums. if task.choice_flag == importer.action.ASIS: # For as-is imports, don't search Web sources for art. @@ -285,10 +284,9 @@ class FetchArtPlugin(BeetsPlugin): if path: self.art_paths[task] = path + # Synchronous; after music files are put in place. def assign_art(self, session, task): """Place the discovered art in the filesystem.""" - # Synchronous; after music files are put in place. - if task in self.art_paths: path = self.art_paths.pop(task) @@ -300,9 +298,8 @@ class FetchArtPlugin(BeetsPlugin): if src_removed: task.prune(path) + # Manual album art fetching. def commands(self): - # Manual album art fetching. - cmd = ui.Subcommand('fetchart', help='download album art') cmd.parser.add_option('-f', '--force', dest='force', action='store_true', default=False, diff --git a/beetsplug/inline.py b/beetsplug/inline.py index d130e80e6..b0142a934 100644 --- a/beetsplug/inline.py +++ b/beetsplug/inline.py @@ -122,4 +122,4 @@ class InlinePlugin(BeetsPlugin): log.debug(u'inline: adding album field %s' % key) func = compile_inline(view.get(unicode), True) if func is not None: - self.album_template_fields[key] = func \ No newline at end of file + self.album_template_fields[key] = func diff --git a/beetsplug/keyfinder.py b/beetsplug/keyfinder.py index 193a1da86..61bb9d9f5 100644 --- a/beetsplug/keyfinder.py +++ b/beetsplug/keyfinder.py @@ -69,4 +69,4 @@ class KeyFinderPlugin(BeetsPlugin): log.debug('added computed initial key {0} for {1}' .format(key, util.displayable_path(item.path))) item.try_write() - item.store() \ No newline at end of file + item.store() diff --git a/beetsplug/mbcollection.py b/beetsplug/mbcollection.py index 77a46b49b..e4d8d4e70 100644 --- a/beetsplug/mbcollection.py +++ b/beetsplug/mbcollection.py @@ -90,4 +90,4 @@ class MusicBrainzCollectionPlugin(BeetsPlugin): ) def commands(self): - return [update_mb_collection_cmd] \ No newline at end of file + return [update_mb_collection_cmd] diff --git a/beetsplug/mbsync.py b/beetsplug/mbsync.py index f484641cc..d82fd3cb7 100644 --- a/beetsplug/mbsync.py +++ b/beetsplug/mbsync.py @@ -151,4 +151,4 @@ class MBSyncPlugin(BeetsPlugin): default=config['import']['write'], dest='write', help="don't write updated metadata to files") cmd.func = mbsync_func - return [cmd] \ No newline at end of file + return [cmd] diff --git a/beetsplug/mpdstats.py b/beetsplug/mpdstats.py index c522d4e1b..451aafe1b 100644 --- a/beetsplug/mpdstats.py +++ b/beetsplug/mpdstats.py @@ -348,4 +348,4 @@ class MPDStatsPlugin(plugins.BeetsPlugin): pass cmd.func = func - return [cmd] \ No newline at end of file + return [cmd] diff --git a/beetsplug/the.py b/beetsplug/the.py index c4fb15045..5bc50415a 100644 --- a/beetsplug/the.py +++ b/beetsplug/the.py @@ -102,4 +102,4 @@ class ThePlugin(BeetsPlugin): self._log.debug(u'[the] \"{0}\" -> \"{1}\"'.format(text, r)) return r else: - return u'' \ No newline at end of file + return u'' diff --git a/beetsplug/zero.py b/beetsplug/zero.py index 13d314261..4bba2c45a 100644 --- a/beetsplug/zero.py +++ b/beetsplug/zero.py @@ -89,4 +89,4 @@ class ZeroPlugin(BeetsPlugin): if self.match_patterns(value, patterns): log.debug(u'[zero] {0}: {1} -> None'.format(field, value)) - setattr(item, field, None) \ No newline at end of file + setattr(item, field, None)