Skip to content

Commit

Permalink
chore(deps-dev): bump ruff
Browse files Browse the repository at this point in the history
Bumps the development-dependencies group with 1 update in the / directory: [ruff](https://github.com/astral-sh/ruff).

Updates `ruff` from 0.5.0 to 0.5.2
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.5.0...0.5.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
  • Loading branch information
dependabot[bot] authored and corenting committed Jul 15, 2024
1 parent d6373d9 commit 5844edb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
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.

0 comments on commit 5844edb

Please sign in to comment.