whyboris / Video-Hub-App

Official repository for Video Hub App
https://videohubapp.com
MIT License
591 stars 179 forks source link

Refactor sorting.pipe.ts #820

Open whyboris opened 1 year ago

whyboris commented 1 year ago

Seems like there is a lot of redundancy here: https://github.com/whyboris/Video-Hub-App/blob/main/src/app/pipes/sorting.pipe.ts#L196

Seems like I could create a dictionary from sortingType (e.g. timeAsc) to the sort property (e.g. duration) and reduce the whole if/then mess to a single "if in set of sortingType" perform the search with map.get("timeAsc") 🤔

ps - rename duplicateFinder.pipe.ts using kebab-case

NabilBouazzaoui commented 1 year ago

Hi, can i take this issue ?

whyboris commented 1 year ago

Thank you for the offer @NabilBouazzaoui 👍

I'm happy to answer any questions you have about making this change 🤝

If you write some code, feel free to submit your PR in whatever form you have - even partial work is a welcome contribution 😊