Ticket #153 (assigned change)

Opened 8 months ago

Last modified 4 months ago

Advanced Random Play - Multiple Catalogs

Reported by: el_lobo Owned by: vollmerk
Priority: major Milestone: 3.5 Alpha Release
Component: Interface Design Version: SVN
Keywords: Cc:

Description

Latest SVN (Feb 14)

I have multiple catalogs, but am unable to random play from more than one. It would be nice to be able to select which catalogs to create the random playlist from (just like you can with genres now - all, some, one)

El

Attachments

Change History

Changed 8 months ago by gwynnebaer

I made this change to SVN and it picks from any catalog correctly:

--- /var/www/src/ampache/ampache-svn/svn.ampache.org/trunk/lib/ui.lib.php       2008-02-20 07:52:57.000000000 -0800
+++ ui.lib.php  2008-02-21 09:14:01.000000000 -0800
@@ -594,4 +594,6 @@
        $db_results = Dba::query($sql);

+        echo "\t<option value=\"" . '-1' . "\" $selected>" . 'All' . "</option>\n";
+
        while ($r = Dba::fetch_assoc($db_results)) {
                $selected = '';

Changed 8 months ago by gwynnebaer

I notice that the "selected" code does not appear to work with or without my changes, so that after selecting "Enqueue" using any catalog but "All", the search will revert to "All" still.

Changed 8 months ago by gwynnebaer

Is this a duplicate of ticket #100?

Changed 8 months ago by gwynnebaer

This is fixed in SVN and looks like a duplicate of #100.

Changed 4 months ago by bkirkman

I tend to disagree that this is fixed in #100, although I might be missing something. I use random play nearly all the time, and having several catalogs, I like to be able to randomly play 20 songs from a certain genre(s) from all catalogs. The current SVN does not allow this from advanced random right now, as it will only allow a selection from one catalog, as far as I can tell. Without this, it is a deal breaker for me, and I have still been running 3.3.3.5 because of it. But, gwynnebaer, you seem to be on the right track. Version 3.3.3.5 uses a function called show_catalog_pulldown, but this has been replaced by show_catalog_select in 3.4.x. Comparing the two functions, and just as gwynnebaer suggested above, I added All to the selection menu. In order to include the All selection, the first few lines of show_catalog_select of ui.lib.php should be as follows.

function show_catalog_select($name='catalog',$catalog_id=0,$style='') { 

	echo "<select name=\"$name\" style=\"$style\">\n";
	
	echo "<option value=\"-1\">All</option>\n";

	$sql = "SELECT `id`, `name` FROM `catalog` ORDER BY `name`";
	$db_results = Dba::query($sql);

with

	echo "<option value=\"-1\">All</option>\n";

being the only line of code added. I apologize for not knowing how to write a diff file, but I hope the above makes sense. It does work, and the random function will select from All catalogs OR one individually selected catalog, so something might have changed in between gwynnebaer's post and now.

Let me know if I'm off base here or not seeing this correctly. I use random select for nearly all music I listen to, so the All catalog selection is a necessity for me. Digging a little deeper into the code, though, I'm not sure how this will affect other parts of the application interface. I know it's called from show_add_live_stream.inc.php, which probably asks to which catalog the user wants to add a radio station. Obviously if All is selected, this would not be good and I'd guess would cause an error. Perhpas bringing back show_catalog_pulldown, or some semblance thereof would be an overall possible solution. For now I'm using the above change to fill my needs. I guess I'll wait for others that know a lot more about the project than I to comment and decide.

Changed 4 months ago by vollmerk

  • status changed from new to assigned
  • version set to SVN
  • milestone set to 3.5 Alpha Release

I agree that it's not fixed. Thanks for the descriptive comment.

Add/Change #153 (Advanced Random Play - Multiple Catalogs)

Author



Action
as assigned
 
Note: See TracTickets for help on using tickets.