LinguaCafe icon indicating copy to clipboard operation
LinguaCafe copied to clipboard

User deletion on admin page.

Open simjanos-dev opened this issue 2 years ago • 2 comments

There is a button on admin page to delete a user, but the functionality is still missing. When a user is deleted, all of that user’s data must be also deleted.

If there's only one admin account left, it should not be deletable.

simjanos-dev avatar Jan 10 '24 14:01 simjanos-dev

I think this one can have some sub-goals or prerequisites. Saving the book covers as individual files complicates user-management and user-deletion logic.

Save the book cover under its unique hash as a blob in the db. That way, if other users import the same book, that hash can be shared (key the hashid in a table which links cover hashes to books using them). Logic like this also may have its own complexities ("any other books in the db using this cover hash?") which is easy to overcome.

Using a db and a filesystem defeats the point of using a db: (roughly) keeping all data in one place.

Perhaps I am missing a design decision that you @simjanos-dev once took to save covers as files (fast loading?).

systemcrash avatar Jan 11 '24 19:01 systemcrash

I've never stored files in the db before. I've thought about it now, and it's not something I would like to do.

It would save some tiny storage space to use one image file for multiple identical covers(whether it's done in the DB or as files), but it would complicate the code much more than it saves in space unless LinguaCafe would have a massive user base. Right now each book's cover file can be deleted with one line of code.

simjanos-dev avatar Jan 11 '24 20:01 simjanos-dev