Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery refactored main branch #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Jan 15, 2024

Branch main 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 main branch, then run:

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from yasirarism January 15, 2024 00:19
if stream_type in ("audio", "subtitle"):
pass
else:
if stream_type not in ("audio", "subtitle"):
Copy link
Author

Choose a reason for hiding this comment

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

Function download_file refactored with the following changes:

Comment on lines -136 to +134
if stream_type in ("audio", "subtitle"):
pass
else:
if stream_type not in ("audio", "subtitle"):
Copy link
Author

Choose a reason for hiding this comment

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

Function download_url_link refactored with the following changes:

Comment on lines -21 to +31
seconds, milliseconds = divmod(int(milliseconds), 1000)
seconds, milliseconds = divmod(milliseconds, 1000)
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
days, hours = divmod(hours, 24)
tmp = (((str(days) + "d, ") if days else "") +
((str(hours) + "h, ") if hours else "") +
((str(minutes) + "m, ") if minutes else "") +
((str(seconds) + "s, ") if seconds else "") +
((str(milliseconds) + "ms, ") if milliseconds else ""))
tmp = (
(f"{str(days)}d, " if days else "")
+ (f"{str(hours)}h, " if hours else "")
+ (f"{str(minutes)}m, " if minutes else "")
+ (f"{str(seconds)}s, " if seconds else "")
+ (f"{str(milliseconds)}ms, " if milliseconds else "")
)
Copy link
Author

Choose a reason for hiding this comment

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

Function time_formatter refactored with the following changes:

Comment on lines -79 to +81
if total_length < downloaded:
total_length = downloaded
total_length = max(total_length, downloaded)
Copy link
Author

Choose a reason for hiding this comment

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

Function download_coroutine refactored with the following changes:

return str(round(size, 2)) + " " + Dic_powerN[n] + 'B'
return f"{str(round(size, 2))} {Dic_powerN[n]}B"
Copy link
Author

Choose a reason for hiding this comment

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

Function humanbytes refactored with the following changes:

Comment on lines -46 to +56
seconds, milliseconds = divmod(int(milliseconds), 1000)
seconds, milliseconds = divmod(milliseconds, 1000)
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
days, hours = divmod(hours, 24)
tmp = ((str(days) + "d, ") if days else "") + \
((str(hours) + "h, ") if hours else "") + \
((str(minutes) + "m, ") if minutes else "") + \
((str(seconds) + "s, ") if seconds else "") + \
((str(milliseconds) + "ms, ") if milliseconds else "")
tmp = (
(f"{str(days)}d, " if days else "")
+ (f"{str(hours)}h, " if hours else "")
+ (f"{str(minutes)}m, " if minutes else "")
+ (f"{str(seconds)}s, " if seconds else "")
+ (f"{str(milliseconds)}ms, " if milliseconds else "")
)
Copy link
Author

Choose a reason for hiding this comment

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

Function TimeFormatter refactored with the following changes:

Comment on lines -25 to +30
title = None
artist = None
thumb = None
duration = 0

metadata = extractMetadata(createParser(file_loc))
if metadata and metadata.has("title"):
title = metadata.get("title")
title = metadata.get("title") if metadata and metadata.has("title") else None
Copy link
Author

Choose a reason for hiding this comment

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

Function upload_audio refactored with the following changes:

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.

None yet

0 participants