Closed wagnered closed 1 year ago
Oops, milestones aren't what I expected.
Got the database configured ( mostly).
Got the web interface configured. I think the display logic is correct.
Found the logic to select and display the user's selected landing page.
Last step is to apply logic to allow/deny user of using the selected landing page.
Ampache's logic is so unbelievably convoluted, it's "unreal" as we ex hippies used to say. Laravel's logic would be so, so, so much easier to follow and modify.
While going through the code, I came across something I don't understand. Preference::init() is called by lib/init.php. its sql refers to the table syspref. I couldn't find that table in Ampache. It doesn't seem to be hidden and it's not a view. I don't know how much info sysref is supposed to provide, but it seems a lot to store in the _SESSION variable. That is, if the query doesn't actually fail.
You got any idea about this? What might I be missing?
a database user pref would be easiest i think.
something like user_start_page. then an admin could overwrite it with something but then each user if allowed could say.
"on login; goto smartlists"
i'll do an array for the setting based on pretty much the primary sidebar. that way it won't need to be translated
okay doing this now, should be the last database update for this release
so in my testing i have one issue. when you set a master page the only way i can do it easily is by changing index.php login.php is too early to get the preferences
so then that changes the index for every link when sending it. i could get around that by setting up a redirect to an intermediary page that redirects to index or others based on preference but it's a bit convoluted.
I have it almost finished. Everything is done on show_index.inc.php. With both php and html on the same page, it was a little more difficult than needed to be. Laravel has a view compiler which makes creating mixed content much easier.
There is one little thing that needs to be worked out. It should be ready for a PR in a day or two. I just want to make sure I'm seeing the whole picture before submitting it.
If you look closer at the issue, you'll see that I assigned this to myself. I just thought that, since I'm the one who complained, I should be the one who offers a compromise.🙂
I went through the logic several times before deciding on the current solution. It's minimally invasive, gets the user to the chosen landing page on login and leaves the show_browse_form in place. Laravel has what's called "middleware" which the request is subject to before it is fulfilled. This feature would make a modification much easier I think.
Nice! Glad you're working on it
BTW I am so happy to see everyone contributing again so i look forward to your next PR!
I pushed the new branch "landing-page" to my github fork.
Are there any more pages that would be nice to add: such as the tag cloud?
In terms of ergonomics, the landing page doesn't seem enough. To get from playlists to albums requires a minimum of two clicks via the "Browse Library" item. Three via artists or albums.
Everything that is on your stats page is on the "information" drop-down list except "trending" which could be easily added relatively speaking.
The information drop-down might be renamed "what's happening now", or "what's trending" or something similar..
I can envision your page as a landing page( with my PR it actually is) and the "classic" interface back in place with maybe minor changes.
Because the music drop-down is labeled so, a new user would probably expect to see what Is clicked: be it actual albums, artists or songs.
Just my thoughts . I guess the statistics would mean more if there were many users: statistics on my own music habits are meaningless. Also, back in my early years the internet didn't exist yet so we actually had to talk to people one at a time.
I see how you've set it up that's much cleaner by making the actual index changeable. 'popular' is the same as a trending browse. it just includes all songs, artists, albums, playlists on the same page.
i tested it out by just pasting in the stats browse code. which in your branch would just be adding the get_top_sql to the set type $browse->set_type($page); so you could do trending and browse from the same block.
$sql = Stats::get_top_sql('artist', $thresh_value, 'stream', $user_id);
$browse = new Browse();
$browse->set_threshold($thresh_value);
$browse->set_type('artist', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
I'd probably just remove of_the_moment if you set a browse page?
i tested it out by just pasting in the stats browse code.
I'm not sure what's going on here. I can't see the URL on the image. Does the the image represent the Browse code you pasted in?
It looks like the URL was set to browse artists. As it is now, "of the moment" only displays if the trending landing page is selected. I try to prevent the code from reaching the following section which is your status(?) Code and my trending landing page. I assumed that's the only location that the "of the moment" are displayed. So I don't understand why the above image includes Albums of the moment.
I'll include your example and see what I get.
yeah, i just put it in between the current index page to try and match your branch. it was pretty fast too.
I'm pruning some inactive issues and it looks like this fizzled out, reopen if its still relevant
I'm sure I'm o not the only one who doesn't care at all about statistics. I just wanna listen to my music.😷
I've assigned this to myself and will enter milestones of my progress.