# HG changeset patch # User melunko # Date 1188478019 -3600 # Node ID fb7baa0b3d2d01057252085eea65ac6557f0c9a7 # Parent 36720270b3682f4a6ed2aee9a5e402ce1c501994 [svn r842] Added some more fields at ScheduleInfo structure diff -r 36720270b368 -r fb7baa0b3d2d gmyth/src/gmyth_scheduler.c --- a/gmyth/src/gmyth_scheduler.c Thu Aug 30 12:51:31 2007 +0100 +++ b/gmyth/src/gmyth_scheduler.c Thu Aug 30 13:46:59 2007 +0100 @@ -219,7 +219,7 @@ g_string_printf(query_str, "SELECT recordid,programid,chanid,starttime,startdate," - "endtime,enddate,title,subtitle,description,category FROM record;"); + "endtime,enddate,title,subtitle,description,category,type,parentid FROM record;"); if (scheduler->msqlquery == NULL) { g_warning("[%s] Scheduler db connection not initialized", @@ -240,6 +240,7 @@ while ((row = mysql_fetch_row(msql_res)) != NULL) { schedule = g_new0(ScheduleInfo, 1); + gint type = 0; schedule->schedule_id = (guint) g_ascii_strtoull(row[0], NULL, 10); @@ -267,6 +268,15 @@ schedule->subtitle = g_string_new(row[8]); schedule->description = g_string_new(row[9]); schedule->category = g_string_new(row[10]); + type = g_ascii_strtoull (row[11], NULL, 10); + if (type == 4) { + schedule->type = GMYTH_SCHEDULE_ALL_OCCURRENCES; + } else if (type == 1) { + schedule->type = GMYTH_SCHEDULE_ONE_OCCURRENCE; + } else if (type == 8) { + schedule->type = GMYTH_SCHEDULE_EXCEPTION; + schedule->parentid = (gint) g_ascii_strtoull (row[12], NULL, 10); + } (*schedule_list) = g_list_append(*(schedule_list), schedule); } @@ -505,7 +515,7 @@ _set_int_value(scheduler->msqlquery, "type", 1, rec_id); } else if (type == GMYTH_SCHEDULE_EXCEPTION) { _set_int_value(scheduler->msqlquery, "type", 8, rec_id); - _set_int_value(scheduler->msqlquery, "parentid", schedule_info->parentid, + _set_int_value(scheduler->msqlquery, "parentid", schedule_info->parentid, rec_id); } @@ -535,9 +545,7 @@ schedule_info->schedule_id = rec_id; - /* - * Notify the backend of changes - */ + /* Notify the backend of changes */ return update_backend(scheduler, rec_id); } diff -r 36720270b368 -r fb7baa0b3d2d gmyth/src/gmyth_scheduler.h --- a/gmyth/src/gmyth_scheduler.h Thu Aug 30 12:51:31 2007 +0100 +++ b/gmyth/src/gmyth_scheduler.h Thu Aug 30 13:46:59 2007 +0100 @@ -110,6 +110,8 @@ GString *description; GString *category; + GMythScheduleType type; + gint parentid; } ScheduleInfo;