4d2eb49f84199890ac7e679ba67f094cb49bd124
braney
  Thu Apr 6 14:29:02 2023 -0700
Change recommended track sets to merge with the current session.  refs #28525

diff --git src/hg/hgSession/hgSession.c src/hg/hgSession/hgSession.c
index 18262fd..040e72f 100644
--- src/hg/hgSession/hgSession.c
+++ src/hg/hgSession/hgSession.c
@@ -996,60 +996,60 @@
 int convertTestResult = pipelineWait(pl);
 
 if (convertTestResult != 0)
     {
     dyStringPrintf(dyMessage,
          "Note: A thumbnail image for this session was not created because the ImageMagick convert "
          "tool could not be found.  Please contact your mirror administrator to resolve this "
          "issue, either by installing convert so that it is part of the webserver's PATH, "
          "by adding the \"sessionThumbnail.convertPath\" option to the mirror's hg.conf file "
          "to specify the path to that program, or by adding \"sessionThumbnail.suppress=on\" to "
          "the mirror's hg.conf file to suppress this warning.<br>");
     return 0;
     }
 
 sqlSafef(query, sizeof(query),
-    "select firstUse from namedSessionDb where userName = \"%s\" and sessionName = \"%s\"",
-    encUserName, encSessionName);
+    "select firstUse from %s where userName = \"%s\" and sessionName = \"%s\"",
+    namedSessionTable, encUserName, encSessionName);
 char *firstUse = sqlNeedQuickString(conn, query);
 sqlSafef(query, sizeof(query), "select idx from gbMembers where userName = '%s'", encUserName);
 char *userIdx = sqlQuickString(conn, query);
 char *userIdentifier = sessionThumbnailGetUserIdentifier(encUserName, userIdx);
 char *destFile = sessionThumbnailFilePath(userIdentifier, encSessionName, firstUse);
 if (destFile != NULL)
     {
     struct dyString *hgTracksUrl = dyStringNew(0);
     addSessionLink(hgTracksUrl, encUserName, encSessionName, FALSE, FALSE);
     struct dyString *renderUrl =
         dyStringSub(hgTracksUrl->string, "cgi-bin/hgTracks", "cgi-bin/hgRenderTracks");
     dyStringAppend(renderUrl, "&pix=640");
     char *renderCmd[] = {"wget", "-q", "-O", "-", renderUrl->string, NULL};
     char *convertCmd[] = {convertPath, "-", "-resize", "320", "-crop", "320x240+0+0", destFile, NULL};
     char **cmdsImg[] = {renderCmd, convertCmd, NULL};
     pipelineOpen(cmdsImg, pipelineWrite, "/dev/null", NULL, 0);
     }
 return 1;
 }
 
 
 void thumbnailRemove(char *encUserName, char *encSessionName, struct sqlConnection *conn)
 /* Unlink thumbnail image for the gallery.  Leaks memory from a generated filename string. */
 {
 char query[4096];
 sqlSafef(query, sizeof(query),
-    "select firstUse from namedSessionDb where userName = \"%s\" and sessionName = \"%s\"",
-    encUserName, encSessionName);
+    "select firstUse from %s where userName = \"%s\" and sessionName = \"%s\"",
+    namedSessionTable, encUserName, encSessionName);
 char *firstUse = sqlNeedQuickString(conn, query);
 sqlSafef(query, sizeof(query), "select idx from gbMembers where userName = '%s'", encUserName);
 char *userIdx = sqlQuickString(conn, query);
 char *userIdentifier = sessionThumbnailGetUserIdentifier(encUserName, userIdx);
 char *filePath = sessionThumbnailFilePath(userIdentifier, encSessionName, firstUse);
 if (filePath != NULL)
     unlink(filePath);
 }
 
 static struct slName *getUserSessionNames(char *encUserName)
 /* Return a list of unencoded session names belonging to user. */
 {
 struct slName *existingSessionNames = NULL;
 struct sqlConnection *conn = hConnectCentral();
 char query[1024];