Skip to content

Conversation

@martincaron
Copy link
Contributor

Added sorting option for aspect ratio. ( Issue #399 )

  • New setting option under Search Settings -> Sorting options in the dropdown
  • For every video compute aspectRatio = ImageElement.width / ImageElement.height
  • Implemented Ascending and Descending order
  • Division by Zero doesn't seem possible because we have AllowedScreenshotHeight type upstream preventing a height of 0, but I can add some checks to be safe. Feedback ?

@whyboris
Copy link
Owner

whyboris commented May 14, 2020

Thank you for the PR 🙇
Code looks good -- I'll test locally and likely merge in before releasing 2.2.3 🎉

Minor notes (no need to change, just food for thought):

👋 🙂 👍

@martincaron
Copy link
Contributor Author

All makes sense ! 👍
I should be able to make these changes

@whyboris
Copy link
Owner

@martincaron -- I tested things out on 10,000 videos in a hub and the sorting is so fast I don't think we need to optimize anything.

If you think it may be worth doing, please feel free to open a new PR. I'm eagerly merging this one as it concludes the version 2.2.3 release :tada

Copy link
Owner

@whyboris whyboris left a comment

Choose a reason for hiding this comment

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

Works beautifully!
Tested on a 10,000-large video hub and the sort speed is fine, no need to optimize anything 👌

@whyboris whyboris merged commit cc1e362 into whyboris:master May 15, 2020
@whyboris whyboris mentioned this pull request May 15, 2020
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.

2 participants