In the past quality was maintained because it cost money to publish a book.
The solution is to charge a nominal fee to self-publishing a book. Maybe $100. The author now has to be confident in the quality of the book and is betting it’ll generate at least $100 in profits.