aaaaactually, let's do this.

This commit is contained in:
brent s 2017-03-25 02:01:29 -04:00
parent 7215e98e96
commit a2c610e09d

View File

@ -288,12 +288,12 @@ def imgConv(imgfile):
progressive = False, progressive = False,
icc_profile = img_data.info.get('icc_profile'), icc_profile = img_data.info.get('icc_profile'),
subsampling = 'keep') subsampling = 'keep')
# Be kind, please rewind.
# Don't sue me, Blockbuster. lol
img_stream.seek(0)
else: else:
with open(imgfile) as f: with open(imgfile) as f:
img_stream = f.read() img_stream = f.read()
# Be kind, please rewind.
# Don't sue me, Blockbuster. lol
img_stream.seek(0)
return(img_stream, img_meta) return(img_stream, img_meta)




@ -338,6 +338,7 @@ def tagMP3(conf, mediafile):
tag.add(TCOP(encoding = 3, tag.add(TCOP(encoding = 3,
text = [conf['tags']['copyright']])) text = [conf['tags']['copyright']]))
tag.save() tag.save()
img_stream.seek(0)


def tagOGG(conf, mediafile): def tagOGG(conf, mediafile):
# https://mutagen.readthedocs.io/en/latest/user/vcomment.html # https://mutagen.readthedocs.io/en/latest/user/vcomment.html
@ -374,6 +375,7 @@ def tagOGG(conf, mediafile):
tag['ENCODER'] = conf['tags']['encoded'] tag['ENCODER'] = conf['tags']['encoded']
tag['METADATA_BLOCK_PICTURE'] = [img_tag] tag['METADATA_BLOCK_PICTURE'] = [img_tag]
tag.save() tag.save()
img_stream.seek(0)


def getSHA256(mediafile): def getSHA256(mediafile):
print('{0}: Generating SHA256 for {1}...'.format(datetime.datetime.now(), print('{0}: Generating SHA256 for {1}...'.format(datetime.datetime.now(),