9369881016ec0c9b4753ebdc7b406c202adea782 hiram Tue Feb 8 13:53:13 2011 -0800 proper display of data last updated time for trackUi information diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index c2396a5..0e56d5a 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -25,30 +25,32 @@ #include "liftOver.h" #include "liftOverChain.h" #include "grp.h" #include "twoBit.h" #include "ra.h" #include "genbank.h" #include "chromInfo.h" #ifndef GBROWSE #include "axtInfo.h" #include "ctgPos.h" #include "hubConnect.h" #include "customTrack.h" #include "hgFind.h" #endif /* GBROWSE */ #include "hui.h" +#include "bigBed.h" +#include "bigWig.h" static char const rcsid[] = "$Id: hdb.c,v 1.433 2010/05/21 16:39:57 angie Exp $"; #ifdef LOWELAB #define DEFAULT_PROTEINS "proteins060115" #define DEFAULT_GENOME "Pyrobaculum aerophilum" #else #define DEFAULT_PROTEINS "proteins" #define DEFAULT_GENOME "Human" #endif static struct sqlConnCache *hdbCc = NULL; /* cache for primary database connection */ static struct sqlConnCache *centralCc = NULL; static char *centralDb = NULL; @@ -4940,30 +4942,49 @@ void printUpdateTime(char *database, struct trackDb *tdb, struct customTrack *ct) /* display table update time */ { struct sqlConnection *conn = NULL; char *tableName = NULL; if (isCustomTrack(tdb->track)) { if (ct) { conn = hAllocConn(CUSTOM_TRASH); tableName = ct->dbTableName; } } +else if (startsWith("big", tdb->type)) + { + char *tableName = hTableForTrack(database, tdb->table); + struct sqlConnection *conn = hAllocConnTrack(database, tdb); + char *bbiFileName = bbiNameFromSettingOrTable(tdb, conn, tableName); + hFreeConn(&conn); + struct bbiFile *bbi = NULL; + if (startsWith("bigBed", tdb->type)) + bbi = bigBedFileOpen(bbiFileName); + if (startsWith("bigWig", tdb->type)) + bbi = bigWigFileOpen(bbiFileName); + time_t timep = 0; + if (bbi) + { + timep = bbiUpdateTime(bbi); + bbiFileClose(&bbi); + } + printBbiUpdateTime(&timep); + } else { tableName = hTableForTrack(database, tdb->table); conn = hAllocConnTrack(database, tdb); } if (tableName) { char *date = firstWordInLine(sqlTableUpdate(conn, tableName)); if (date != NULL) printf("<B>Data last updated: </B>%s<BR>\n", date); } hFreeConn(&conn); } void printBbiUpdateTime(time_t *timep)