redlib
redlib copied to clipboard
✨ Feature parity: Saving Posts
Can you explain what saving posts mean. I am willing to work on it.
Sorry; I haven't been on here for some time.
It just means, that if you have read a post and liked it you can save it and read it later again. As of right now, I just bookmark the url of the post in my browser, but implementing it as a feature in redlib to see the post directly there would be much more convenient. For that I would maybe also be necessary to implement the account feature (like invidious, as someone else mentioned), so that when the redlib serveradress changes, the savings don't get lost.
Right now whenever there is a new redlib link, the old settings aren't configured anymore
+1, but particularly for subscriptions. When self hosting, none of my subscriptions are saved across browser sessions. The only way to persist is by using environment variables, which is inconvenient when you want to add/remove subscriptions.
I've put together a small user script for Tampermonkey which mimics a save/unsave feature by storing saved posts to your localStorage. There are still some issues like slow loading of saved posts (which should depend on your network and your chosen redlib/libreddit instance) and showing full posts instead of post previews, but I've tested it for some time and it works alright. More details are on the Greasy Fork page.
When self hosting, none of my subscriptions are saved across browser sessions
Visit the settings page and check out the link at the bottom!
I wonder how I could implement this - the problem is cookie limits of 4k under an entire domain... Saving a few hundred posts would break everything :thinking:
I wonder how I could implement this - the problem is cookie limits of 4k under an entire domain... Saving a few hundred posts would break everything 🤔
How about using localStorage? I believe it has higher storage limit than cookies, and afaik works about the same.
I understand you're against adding local state like databases, but I'm not sure if localStorage falls under that.
However I am not familiar with the code of this project so I'm not sure if/how client-side scripting can be done to manage localStorage. I have made a JS script mentioned above which does this job, if you want to take a look.
localStorage would probably be fine. It's local to the user's browser just like cookies, not local to the server. I'll look into it for more high volume, unbounded things than standard configurations that have pretty finite sizes. For example subscriptions could run out of space in a regular cookie as well... But the subscriptions have to be passed along with most requests (like home page) unlike posts, otherwise we'd have to change a lot of mechanisms around storage.
When self hosting, none of my subscriptions are saved across browser sessions
Visit the settings page and check out the link at the bottom!
I'm aware. https://github.com/redlib-org/redlib/issues/110