-
Notifications
You must be signed in to change notification settings - Fork 567
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
Add ratio preview to videos #642
base: develop
Are you sure you want to change the base?
Conversation
Just to let you know, there is a different extension that has this feature: Thumbnail Rating Bar for YouTube™ In the above extension they have a delay function to slow down the for-loop for RYD API server queries, and a local cache to temporarily store query results for up to ten minutes. They acknowledged the limits by implementing this feature so individual users don't get banned by RYD API server. It's nice to see you are implementing this function here, but would you consider including the delay and cache as well? That may prevent massive server requests, which is basically 100x traffic amplification. cache: https://github.com/elliotwaite/thumbnail-rating-bar-for-youtube/blob/master/extension/background.js |
Thank you very much for that information. I also thought about that problem and thought that it would be a good idea to allow getting data for multiple videos at once. For example, I send a list with all videos on my start page [Sjfdyj5s, ...] and then get a list with all the data at once by the API. But as far as I know, the API isn't open source. I really appreciate the links to the other extension. I'm not here for the weekend but I will work on this as soon as I come back. |
Another idea from discord (by Ezed)- Most of the time users are going to ignore that extra info. Hence, it isn't necessary display it on all videos. We should probably add some delay to that too. |
Most of the time I ignore the front page and go straight to my subscription and watch list. And I don't watch any instruction videos on Youtube because I find it less effective than more serious websites such as stackoverflow which allows peer review and discussion. Maybe make a switch for the continuous-fire mode (with delay) and semi-auto mode (less or no delay). |
Anarios#641 only for English
Thanks for this suggestion. This is a good idea. Maybe the ability to switch between the modes would be good idea? (Off, Only on hover, Always). With the "always-mode" using the delay and caching. |
Do you mean with "continuous-fire-mode" that the ratio is always displayed and with "semi-auto-mode" that it is only displayed on hover but then without delay? |
That sounds good.
Yeah, but my phrasing is a bit dark. |
Alright, thank you. I will work on the different modes as well as the caching/delaying as soon as I can. |
Great 👍 |
@aaronkerckhoff Thanks for your effort!
Please add default value here:
Also add default value here, with comment:
Once more here:
Please use our custom console log -- in the future it will be turned off by default
import it from
I suggest you return a boolean false here
If I'm getting it right, if I choose "always" for the custom option, and when I open a list like subscription list, where there're hundreds of videos, then this for loop will be called hundreds of times. Even if my cache is less than 10 minutes old, the first test in the first iteration will always be executed, with time now being very close (batch executed for a list of videos). It's a small amount of wasted computation, which will add to the heat. It's pretty hot in the northern hemisphere now, and I hope not to waste too much electricity.
Here's a challenge: How to run cache cleanup only once for each page load?
to prevent divide by zero error:
(More in my next post)
What's your plan with variable
(don't forget)
Here in event.js (will be merged into content-script.js), implement again the storage change handler. I don't remember exactly, but this part may be different than other appearances, although they are all called "storage change handlers". So be patient. |
It's an on-going and one of our longest debates: whether or not to use API like data instead of official like data. The current implementation uses official, meaning (1) We don't use API by default, and (2) if official is unavailable we won't use API instead. An example usage can be found here:
Also take a look at the few lines below; that's why I suggested returning false when response data is invalid.
To really manage invalid cases:
|
Thank you very much for all your suggestions! I'm currently working on the implementation. |
* Set default value * Remove debug console logs * Return false if data is invalid * Only clean cache on page change * Fix possible divide by zero error * Use official likes istead of API data * Prevent invalid cases in ratio calculation
Thank you very much for all of your suggestions and the time you spend on them. I fixed everything you mentioned.
|
Revert "Add ratio display to new design"
Create FUNDING.yml
Update Guide__Troubleshooting.md
Add Czech and fix Japanese
Revert "Add Czech and fix Japanese"
TEMPORARILY UNAVAILABLE -> TEMP N/A
Sorry that I didn't update this PR sooner, I was really busy in the last few months. I now added the ability to toggle the different modes: always, hover, never. Everything works fine so far, if there are still some bugs, let me know. Thanks to all that helped me and contributed to this PR. |
I added the ability to see the like/dislike ratio next to every video: