-
Notifications
You must be signed in to change notification settings - Fork 877
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
Move local API player cache internals into the main process #5068
Conversation
I cant seem to find the request in the Network tab, also tried filtering for it without any luck. Any suggestions how I can easily find the request? |
Don't copy the exact text, as the Filtering for |
Filtering by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step 5: Opened first vid, confirmed that item appeared inside it. Also saw a base.js request that matched the item.
Step 6: Opened second vid, saw another request to base.js. So that means that it didnt use the cached one
After that i opened a few other videos and no other base.js requests were made. 2nd video somehow not using the already cached request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving as the id was different and thats why i saw a new base.js file
Move local API player cache internals into the main process
Pull Request Type
Description
Currently the player cache implementation that we use in Electron, writes to the file system in the renderer process (the stuff that actually runs inside of the window), this pull request moves it to the main process with IPC calls. That allows us to add checks to ensure that the player cache can only be used to read and write files in the
player_cache
directory. It also avoids exposing where theplayer_cache
directory is located on the file system.As an added bonus this pull request shaves off 1591 bytes from the
renderer.js
file but only adds 240 bytes to themain.js
file.Testing
Electron
folder instead of theFreeTube
one)player_cache
folderyarn run dev
player_cache
folder gets created and an item appears inside of ithttps://www.youtube.com/s/player/{identifier}/player_ias.vflset/en_US/base.js
. If there was only one, that means the second video used the cached player data.After step 5 you've tested that adding an item to the cache works and after step 7 that reading from the cache works.
Desktop