mirror of
https://github.com/beetbox/beets.git
synced 2026-02-09 08:52:30 +01:00
Raise OSError
This commit is contained in:
parent
2fcdb8c2ca
commit
3b39a4fe66
1 changed files with 6 additions and 3 deletions
|
|
@ -15,6 +15,7 @@
|
|||
"""Allows beets to embed album art into file metadata."""
|
||||
|
||||
import os.path
|
||||
import traceback
|
||||
from io import BytesIO
|
||||
|
||||
import requests
|
||||
|
|
@ -84,7 +85,7 @@ class EmbedCoverArtPlugin(BeetsPlugin):
|
|||
embed_cmd.parser.add_option("-y", "--yes", action="store_true",
|
||||
help="skip confirmation")
|
||||
|
||||
embed_cmd.parser.add_option('-u', '--url', action="store_true",
|
||||
embed_cmd.parser.add_option('-u', '--url', metavar='URL',
|
||||
help='the URL of the image file to embed')
|
||||
|
||||
maxwidth = self.config['maxwidth'].get(int)
|
||||
|
|
@ -125,8 +126,10 @@ class EmbedCoverArtPlugin(BeetsPlugin):
|
|||
try:
|
||||
with open('temp.jpg', 'wb') as f:
|
||||
f.write(response.content)
|
||||
except util.FilesystemError as exc:
|
||||
self._log.error('Error writing file: {}', exc)
|
||||
except OSError as exc:
|
||||
raise util.FilesystemError(exc, 'write',
|
||||
bytestring_path('temp.jpg'),
|
||||
traceback.format_exc())
|
||||
opts.file = 'temp.jpg'
|
||||
items = lib.items(decargs(args))
|
||||
# Confirm with user.
|
||||
|
|
|
|||
Loading…
Reference in a new issue