Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Dec 14, 2021

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from MRK-YT December 14, 2021 12:19
Comment on lines -3 to +5
class Config(object):


class Config((object)):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 3-16 refactored with the following changes:

try:
t = SESSION.query(Thumbnail).get(id)
return t
return SESSION.query(Thumbnail).get(id)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function thumb refactored with the following changes:

Comment on lines -145 to +151
if metadata is not None:
if metadata.has("duration"):
duration = metadata.get('duration').seconds
if metadata is not None and metadata.has("duration"):
duration = metadata.get('duration').seconds
if duration > min_duration:
images = []
ttl_step = duration // no_of_photos
current_ttl = ttl_step
for looper in range(0, no_of_photos):
for _ in range(no_of_photos):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function generate_screen_shots refactored with the following changes:

r = requests.get(url, allow_redirects=True, stream=True)
total_size = int(r.headers.get("content-length", 0))
return total_size
return int(r.headers.get("content-length", 0))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DetectFileSize refactored with the following changes:

Comment on lines -34 to +49
if client is not None:
if ((total_size // downloaded_size) % 5) == 0:
time.sleep(0.3)
try:
client.edit_message_text(
chat_id,
message_id,
text="{}: {} of {}".format(
ud_type,
humanbytes(downloaded_size),
humanbytes(total_size)
)
if (
client is not None
and ((total_size // downloaded_size) % 5) == 0
):
time.sleep(0.3)
try:
client.edit_message_text(
chat_id,
message_id,
text="{}: {} of {}".format(
ud_type,
humanbytes(downloaded_size),
humanbytes(total_size)
)
except:
pass
)
except:
pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DownLoadFile refactored with the following changes:

])
)
return
return
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function convert_to_video refactored with the following changes:

This removes the following comments ( why? ):

#   chat_id=update.chat.id,
# ref: message from @Mo_Tech_Group
# get the correct width, height, and duration for videos greater than 10MB
#  text=Translation.UPLOAD_START,
# await bot.edit_message_text(
# don't care about the extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant