mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-20 20:16:38 +00:00
Fix using enum on sqlite instead its value
This commit is contained in:
parent
1a3feec481
commit
7e707dbbd9
@ -445,7 +445,7 @@ class Session:
|
|||||||
tuple_ = self._conn.execute(
|
tuple_ = self._conn.execute(
|
||||||
'select id, hash from sent_files '
|
'select id, hash from sent_files '
|
||||||
'where md5_digest = ? and file_size = ? and type = ?',
|
'where md5_digest = ? and file_size = ? and type = ?',
|
||||||
(md5_digest, file_size, _SentFileType.from_type(cls))
|
(md5_digest, file_size, _SentFileType.from_type(cls).value)
|
||||||
).fetchone()
|
).fetchone()
|
||||||
if tuple_:
|
if tuple_:
|
||||||
# Both allowed classes have (id, access_hash) as parameters
|
# Both allowed classes have (id, access_hash) as parameters
|
||||||
@ -459,7 +459,7 @@ class Session:
|
|||||||
self._conn.execute(
|
self._conn.execute(
|
||||||
'insert into sent_files values (?,?,?,?,?)', (
|
'insert into sent_files values (?,?,?,?,?)', (
|
||||||
md5_digest, file_size,
|
md5_digest, file_size,
|
||||||
_SentFileType.from_type(type(instance)),
|
_SentFileType.from_type(type(instance)).value,
|
||||||
instance.id, instance.access_hash
|
instance.id, instance.access_hash
|
||||||
))
|
))
|
||||||
self.save()
|
self.save()
|
||||||
|
Loading…
Reference in New Issue
Block a user