fix
This commit is contained in:
parent
634a0dd4a4
commit
a9529f3e4c
@ -56,7 +56,7 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
|
|||||||
im = Image.open(f) # type: Image.Image
|
im = Image.open(f) # type: Image.Image
|
||||||
|
|
||||||
image_hash = imagehash.phash(im)
|
image_hash = imagehash.phash(im)
|
||||||
if self.queued_items.filter(image_hash=image_hash, type='photo').count() > 0:
|
if self.queued_items.filter(image_hash=str(image_hash), type='photo').count() > 0:
|
||||||
return 'duplicate'
|
return 'duplicate'
|
||||||
|
|
||||||
width, height = im.size
|
width, height = im.size
|
||||||
@ -72,7 +72,7 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
|
|||||||
# else:
|
# else:
|
||||||
# bot.send_photo(self.chat_id, open(fpath, 'rb'))
|
# bot.send_photo(self.chat_id, open(fpath, 'rb'))
|
||||||
# QueuedItem.objects.create(config=self, type='photo', args=json.dumps([]), image_hash=image_hash, processed=True)
|
# QueuedItem.objects.create(config=self, type='photo', args=json.dumps([]), image_hash=image_hash, processed=True)
|
||||||
return image_hash
|
return str(image_hash)
|
||||||
|
|
||||||
def rpc_post_gif(self, url, note=''):
|
def rpc_post_gif(self, url, note=''):
|
||||||
config._reload_maybe()
|
config._reload_maybe()
|
||||||
|
Loading…
Reference in New Issue
Block a user