IgnisDa / ryot

Roll your own tracker!
https://ryot.io
GNU General Public License v3.0
1.86k stars 48 forks source link

Reduce reliance on external connections #1021

Open Millio345 opened 1 week ago

Millio345 commented 1 week ago

One of my main goals with self-hosting is that as many things as possible keep working, after initial setup, without relying on external internet access. Obviously, Ryot will always need external API's to add things to the collection. But I think for general browsing, some improvements could be made:

The first 3 should be pretty easy I believe and would already be a big improvement. I fully understand the fourth one is a lot more work and should maybe even be optional because of the increased disk usage, but it would also help to make the media pages load much faster and make ryot feel a lot snappier.

Would be great if at least some of these could be changed.

IgnisDa commented 1 week ago

Are you willing to work on a PR addressing these?

Millio345 commented 1 week ago

Are you willing to work on a PR addressing these?

Sure, I'm willing to give it a try if you're open to accepting it if it's done well.

IgnisDa commented 1 week ago

I'm open to accepting PRs. How do you plan to localize the external images (from TMdb etc)?

Edit: You should be aware that any code you contribute will also be made part of the Ryot Pro offerring.

Jacob-Tate commented 1 week ago

In the meantime for number 4 I solve this problem with my reverse proxy caching.

Currently we are using caddy for the reverse proxy so youll need to setup a directory these files are stored in then serve them through this. A consideration to make may be to do something similar to Reverse Proxy Caching so we still store the urls of the images (to allow for updated images which happens sometimes with monitored shows) but if local storage is enabled serve a local url in its place For example:

Normally ryot.acme.com/media/item/met__mNPhBWJ7P_p will serve https://image.tmdb.org/t/p/original/exKzfiKzMdQBHrdd7zNmKauJkbg.jpg but when local storage is enable react will rewrite the served image to be ryot.acme.com/assets/tmdb/t/p/original/exKzfiKzMdQBHrdd7zNmKauJkbg.jpg this allows us to easily see where images are coming from and track when tmdb gets new images. This also allows users to switch easily between local urls and remote urls

Jacob-Tate commented 1 week ago

Id also recommend making a background task that handles this caching process on the backend similar to the metadata process not sure how we would want to handle stale images or things like that but I suppose thats a future problem