albumart#106
Conversation
| exist.""", file=sys.stderr, flush=True) | ||
| coverart = False | ||
| else: | ||
| coverart_mime = mimetypes.guess_type(coverart_filename)[0] |
There was a problem hiding this comment.
Rather than guessing the MIME type from the extension, couldn’t we leverage mime-info on systems that have it? It’s more accurate in most cases.
There was a problem hiding this comment.
E.g. using https://github.com/ahupp/python-magic
There was a problem hiding this comment.
I am a bit wary of multiplying dependencies; also, users can pretty much choose their own extension with file_to_tag, right?
There was a problem hiding this comment.
I had assumed that EyeD3 bundled magic anyway for use with https://eyed3.readthedocs.io/en/latest/eyed3.plugins.html#module-eyed3.plugins.mimetype but looking at the source, it seems I was mistaken.
There was a problem hiding this comment.
... but perhaps I'm being silly about dependencies. You seem to be a serious dev, much unlike me :) So I'm willing to listen.
There was a problem hiding this comment.
No, I think you’re being perfectly reasonable. Also I might be a serious dev (whatever that means) but not all that familiar with the Python ecosystem…
| for mytag in tagdict: | ||
| setattr(file_to_tag.tag, mytag, tagdict[mytag]) | ||
| if coverart: | ||
| with open(coverart_filename, 'rb') as imagefile: |
There was a problem hiding this comment.
It would be cool if the coverart_filename could be a http(s) URL. And if the images linked from the feed (e.g. <image><url> in the feed and <itunes:image> in the article) would be made available as placeholders. This way we could do:
coverart = {articleimage}
or
coverart = {feedimage}
There was a problem hiding this comment.
Right, let me look into that.
lgtm Co-authored-by: Raphael Schweikert <any@sabberworm.com>
Introduces a new
coverartoption forgreg.conf. This option expects a path to an image, which will be used as cover art for the podcast.