[Wepg-devel] mythcond/src PalmAppInfo.C,1.3,1.4 wepgsync.C,1.3,1.4
Brought to you by:
leonvs
|
From: Leon v. S. <le...@us...> - 2004-08-07 18:53:59
|
Update of /cvsroot/wepg/mythcond/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5990/src Modified Files: PalmAppInfo.C wepgsync.C Log Message: ok Index: wepgsync.C =================================================================== RCS file: /cvsroot/wepg/mythcond/src/wepgsync.C,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wepgsync.C 3 Aug 2004 17:15:25 -0000 1.3 --- wepgsync.C 7 Aug 2004 18:53:50 -0000 1.4 *************** *** 215,219 **** int f = atol( row[ mysql_field_index( rs, "flags" ) ] ); ! // if (row[ mysql_field_index( rs, "willrecord" ) ] != NULL) f |= FLAG_SYSRECORD; if (row[ mysql_field_index( rs, "isrecorded" ) ] != NULL) f |= FLAG_RECORDED; m_storage.flags.watched = (f & FLAG_WATCHED) != 0; --- 215,219 ---- int f = atol( row[ mysql_field_index( rs, "flags" ) ] ); ! if (row[ mysql_field_index( rs, "willrecord" ) ] != NULL) f |= FLAG_SYSRECORD; if (row[ mysql_field_index( rs, "isrecorded" ) ] != NULL) f |= FLAG_RECORDED; m_storage.flags.watched = (f & FLAG_WATCHED) != 0; *************** *** 410,414 **** char sql[1024]; sprintf( sql, ! "UPDATE wepgbc " "SET user_rating=%i, flags=%i, rec_status=%i " "WHERE user_id=%i AND rec_id=%lu", --- 410,414 ---- char sql[1024]; sprintf( sql, ! "UPDATE UserBroadcast " "SET user_rating=%i, flags=%i, rec_status=%i " "WHERE user_id=%i AND rec_id=%lu", *************** *** 465,469 **** sprintf( sql, "SELECT rec_id " ! "FROM wepgbc " "WHERE %s", cond --- 465,469 ---- sprintf( sql, "SELECT rec_id " ! "FROM UserBroadcast " "WHERE %s", cond *************** *** 498,502 **** // archive all sprintf( sql, ! "UPDATE wepgbc " "SET archived='Y' " "WHERE %s", --- 498,502 ---- // archive all sprintf( sql, ! "UPDATE UserBroadcast " "SET archived='Y' " "WHERE %s", *************** *** 538,541 **** --- 538,546 ---- } + + //////// + dlp_DeleteRecord(pilot_socket, palmdb.getHandle(), 1, (recordid_t) 0); + //////// + retval = dlp_CleanUpDatabase( pilot_socket, palmdb.getHandle() ); if ( retval < 0 ) *************** *** 577,581 **** sprintf( sql, "SELECT rec_id " ! "FROM wepgbc " "WHERE user_id=%i AND rec_id=%lu", (int)hostuser.getInternalId(), --- 582,586 ---- sprintf( sql, "SELECT rec_id " ! "FROM UserBroadcast " "WHERE user_id=%i AND rec_id=%lu", (int)hostuser.getInternalId(), *************** *** 634,660 **** MYSQL_ROW row; ! char sql[1024]; ! //first seed wepgbc with any new programs; dups will be avoided via PK sprintf(sql, ! "INSERT INTO wepgbc (user_id,chanid,starttime)" "SELECT %i,chanid,starttime FROM program WHERE starttime>="DLIM"%s"DLIM" ", hostuser.getInternalId(), threshold.getPast() ); ! mymysql_exec( hostdb, sql ); ! ! //table 'record' does not contain what i thought.. ! // "LEFT JOIN record ON (program.chanid=record.chanid AND UNIX_TIMESTAMP(program.starttime)=UNIX_TIMESTAMP(record.startdate)+TIME_TO_SEC(record.starttime)) " ! //select programs sprintf( sql, ! "SELECT program.chanid,program.starttime,program.endtime,program.title,program.category,CONCAT(program.subtitle,';',program.description) AS info," ! "wepgbc.rec_id,wepgbc.rec_status,wepgbc.flags,wepgbc.system_rating,wepgbc.user_rating," ! "recorded.chanid AS isrecorded " ! "FROM program INNER JOIN wepgbc ON (program.chanid=wepgbc.chanid AND program.starttime=wepgbc.starttime) " "LEFT JOIN recorded ON (program.chanid=recorded.chanid AND program.starttime=recorded.starttime) " ! "WHERE " ! "user_id=%i AND archived='N' AND wepgbc.starttime>"DLIM"%s"DLIM" AND wepgbc.starttime<="DLIM"%s"DLIM" ", hostuser.getInternalId(), threshold.getPast(), --- 639,671 ---- MYSQL_ROW row; ! char sql[4096]; ! //first seed UserBroadcast with any new programs; dups will be avoided via PK sprintf(sql, ! "INSERT INTO UserBroadcast (user_id,chanid,starttime) " "SELECT %i,chanid,starttime FROM program WHERE starttime>="DLIM"%s"DLIM" ", hostuser.getInternalId(), threshold.getPast() ); + // mymysql_exec( hostdb, sql ); ! ! // enum RecordingType{ kNotRecording = 0, kSingleRecord = 1, ! // kTimeslotRecord 2, kChannelRecord 3, kAllRecord 4, kWeekslotRecord 5, ! // kFindOneRecord, kOverrideRecord, kDontRecord}; ! //select programs sprintf( sql, ! "SELECT DISTINCT program.chanid,program.starttime,program.endtime,program.title,program.category,CONCAT(program.subtitle,';',program.description) AS info," ! "UserBroadcast.rec_id,UserBroadcast.rec_status,UserBroadcast.flags,UserBroadcast.system_rating,UserBroadcast.user_rating," ! "record.title AS willrecord, recorded.chanid AS isrecorded " ! "FROM program INNER JOIN channel ON (program.chanid=channel.chanid) " ! "INNER JOIN UserBroadcast ON (program.chanid=UserBroadcast.chanid AND program.starttime=UserBroadcast.starttime) " "LEFT JOIN recorded ON (program.chanid=recorded.chanid AND program.starttime=recorded.starttime) " ! "LEFT JOIN record ON (program.title=record.title AND (record.type=4 OR " ! "(record.station=channel.callsign AND (record.type=3 OR " ! "(TIME_TO_SEC(record.starttime)=TIME_TO_SEC(program.starttime) AND (record.type=2 OR " ! "(DAYOFWEEK(record.startdate)=DAYOFWEEK(program.starttime) AND record.type=5))))))) " ! "WHERE channel.visible=1 AND " ! "user_id=%i AND archived='N' AND UserBroadcast.starttime>"DLIM"%s"DLIM" AND UserBroadcast.starttime<="DLIM"%s"DLIM" ", hostuser.getInternalId(), threshold.getPast(), *************** *** 665,671 **** return 1; } ! while( (row = mysql_fetch_row(rs)) != NULL ) { IntermedRec intrec; intrec.init( appinfo, hostdb, rs, row ); --- 676,688 ---- return 1; } ! if (rs == NULL) { ! logprintf("no bcs\n"); ! return 1; ! } ! while( (row = mysql_fetch_row(rs)) != NULL ) { + printf("row %s %s %s %s\n", row[0], row[1], row[2], row[3]); + IntermedRec intrec; intrec.init( appinfo, hostdb, rs, row ); *************** *** 692,696 **** char sql2[1024]; sprintf( sql2, ! "UPDATE wepgbc " "SET rec_id=%lu " "WHERE user_id=%i AND starttime="DLIM"%s"DLIM" and chanid=%i", --- 709,713 ---- char sql2[1024]; sprintf( sql2, ! "UPDATE UserBroadcast " "SET rec_id=%lu " "WHERE user_id=%i AND starttime="DLIM"%s"DLIM" and chanid=%i", *************** *** 757,761 **** TimeThreshold threshold( hostuser ); ! retval = saveModified( pilot_socket, hostdb, palmdb, hostuser ); if ( retval != 0 ) { --- 774,778 ---- TimeThreshold threshold( hostuser ); ! printf("savemod\n"); retval = saveModified( pilot_socket, hostdb, palmdb, hostuser ); if ( retval != 0 ) { *************** *** 763,767 **** return retval; } ! retval = archiveOldRecs( pilot_socket, hostdb, palmdb, hostuser, threshold ); if ( retval != 0 ) { --- 780,784 ---- return retval; } ! printf("archive\n"); retval = archiveOldRecs( pilot_socket, hostdb, palmdb, hostuser, threshold ); if ( retval != 0 ) { *************** *** 769,773 **** return retval; } ! retval = remoteRecSanityCheck( pilot_socket, hostdb, palmdb, hostuser ); if ( retval != 0 ) { --- 786,790 ---- return retval; } ! printf("remoterec\n"); retval = remoteRecSanityCheck( pilot_socket, hostdb, palmdb, hostuser ); if ( retval != 0 ) { *************** *** 775,779 **** return retval; } ! retval = loadNewBcs( pilot_socket, hostdb, palmdb, hostuser, threshold, palmappinfo ); if ( retval != 0 ) { --- 792,796 ---- return retval; } ! printf("loadnew\n"); retval = loadNewBcs( pilot_socket, hostdb, palmdb, hostuser, threshold, palmappinfo ); if ( retval != 0 ) { *************** *** 781,785 **** return retval; } ! return 0; } --- 798,802 ---- return retval; } ! printf("ret0\n"); return 0; } Index: PalmAppInfo.C =================================================================== RCS file: /cvsroot/wepg/mythcond/src/PalmAppInfo.C,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PalmAppInfo.C 3 Aug 2004 17:15:25 -0000 1.3 --- PalmAppInfo.C 7 Aug 2004 18:53:50 -0000 1.4 *************** *** 98,102 **** sprintf( sql, "SELECT chanid,callsign,channum " ! "FROM channel " ); --- 98,102 ---- sprintf( sql, "SELECT chanid,callsign,channum " ! "FROM channel WHERE visible=1 ORDER BY channum" ); |