Skip to content

Commit

Permalink
use pyrogram utils for get peer id from raw and bump version for hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew (from workstation) committed Dec 28, 2020
1 parent 48709dc commit d19c2e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setuptools.setup(
name="smart_tv_telegram",
version="1.2.0.dev0",
version="1.2.1.dev0",
setup_requires=["wheel"],
author="andrew-ld",
author_email="[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions smart_tv_telegram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from .bot import Bot


__version__ = "1.2.0"
__version_info__ = ("1", "2", "0")
__version__ = "1.2.1"
__version_info__ = ("1", "2", "1")
__author__ = "https://github.com/andrew-ld"


Expand Down
3 changes: 2 additions & 1 deletion smart_tv_telegram/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from aiohttp.web_request import Request
from aiohttp.web_response import Response, StreamResponse
from pyrogram.raw.types import MessageMediaDocument, Document
from pyrogram.utils import get_peer_id

from . import Config, Mtproto
from .devices import DeviceFinder
Expand Down Expand Up @@ -227,7 +228,7 @@ async def _stream_handler(self, request: Request) -> typing.Optional[Response]:
await stream.prepare(request)

while offset < max_size:
self._feed_timeout(message_id, message.from_id, local_token, size)
self._feed_timeout(message_id, get_peer_id(message.peer_id), local_token, size)
block = await self._mtproto.get_block(message, offset, self._config.block_size)
new_offset = offset + len(block)

Expand Down

0 comments on commit d19c2e3

Please sign in to comment.