diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index 3e03bd224..05d3ea53f 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -782,7 +782,7 @@ class LyricsPlugin(plugins.BeetsPlugin): ui.print_(item.lyrics) if opts.writerest: self.appendrest(opts.writerest, item) - if opts.writerest and len(items) > 0: + if opts.writerest and items: # flush last artist & write to ReST self.writerest(opts.writerest) ui.print_(u'ReST files generated. to build, use one of:') @@ -831,7 +831,6 @@ class LyricsPlugin(plugins.BeetsPlugin): with open(path, 'wb') as output: output.write(self.rest.encode('utf-8')) - def writerest_indexes(self, directory): """Write conf.py and index.rst files necessary for Sphinx diff --git a/docs/changelog.rst b/docs/changelog.rst index 21cbd1217..691a42de5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -207,6 +207,9 @@ Fixes: * :doc:`/plugins/lyrics`: Adapt the Genius backend to changes in markup to reduce the scraping failure rate. :bug:`3535` :bug:`3594` +* :doc:`/plugins/lyrics`: Fix crash when writing ReST files for a query without + results or fetched lyrics + :bug:`2805` For plugin developers: