Closed davebiffuk closed 5 years ago
Just checked out this to try but I can't see the random albums row in the albums view.
Did you restart the web server after making the change? I had to restart Apache to make this show up (and when I made other changes, e.g. https://github.com/Sonerezh/sonerezh/issues/170#issuecomment-204693051 )
Are there any messages in the web server logs?
I'm sorry I don't have any other suggestions. I can let you have an account on my server if you want to see it working.
Not sure what I did wrong the first time but looks & works fine for me now. I think it'd be a good idea if features were database independent, can you add the same functionality for SQLite & PostgreSQL databases?
Thanks for the feedback, I think that's a good idea and I will have a go.
Is it optional? Because personally I would go the other way and remove the Recently Added line.
I know what I added, it takes a precious vertical space. As for the random line, it really depends on the way you listen to your music. I often choose my music based on my mood, so I don't really need the random line (and, also, the vertical space argument)
Could this be optional on the settings page? A checkbox for recently added and another one for random?
That would be very nice. It could even be per user.
I've updated my branch to add checkboxes for "random" and "recently added" on the settings page. Thanks for the suggestion!
NB. as I wrote in the commit message:
This involves a change to the database schema. In theory,
deleting the contents of sonerezh/app/tmp/cache/models
is sufficient to get that noticed; but in my experience,
setting Configure::write('debug', 2); in
sonerezh/app/Config/core.php (briefly) was necessary.
Still only for MySQL I'm afraid, I will look at other backends next.
I've added (completely untested) support for SQLite and PostgreSQL. Any testers please?
Looks good but sonerezh_pgsql.php is missing the two new columns. Once they were added it seems to be working just fine with sqlite.
This PR should fix #299
This is a copy of the "Random albums" feature in Subsonic. A row of randomly-selected albums is displayed on the "Albums" page, after "Recently added" and before "All albums".
The MySQL "order by rand()" is reportedly inefficient, but it takes ~0.1s to select from ~700 albums/~7000 songs on a small ARM-based system which seems acceptable.
I included the (small!) translations but I don't know if I did it right.
This change doesn't handle a SQLite backend, only MySQL.