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

chore(deps-dev): bump ruff from 0.5.0 to 0.5.2 in the development-dependencies group across 1 directory #182

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions eddrit/reddit/content_parser/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def get_post_video_content(

# Sort: best resolution + non-embed first
parsed_results.sort(
key=lambda x: (x.width * x.height, type(x) != models.EmbedPostContent),
key=lambda x: (x.width * x.height, type(x) is not models.EmbedPostContent),
reverse=True,
)
logger.debug(
Expand All @@ -160,20 +160,20 @@ def get_post_video_content(
# display the embed as it may have sound
if (
embed_content := next(
(x for x in parsed_results if type(x) == models.EmbedPostContent), None
(x for x in parsed_results if type(x) is models.EmbedPostContent), None
)
) and any(getattr(x, "is_gif", False) for x in parsed_results):
return embed_content

# If the best content is an embed, just return it as the frontend
# doesn't handle mix of embed and non embed sources
best_content = parsed_results[0]
if type(best_content) == models.EmbedPostContent:
if type(best_content) is models.EmbedPostContent:
return best_content

# Else return the list of non-embed sources
videos = [
item for item in parsed_results if type(item) != models.EmbedPostContent
item for item in parsed_results if type(item) is not models.EmbedPostContent
]
return models.VideoPostContent(
videos=videos # type: ignore
Expand Down
42 changes: 23 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.