# HG changeset patch # User leo_sobral # Date 1173190624 0 # Node ID ab427801f05823c561d267af871ccbd3e3c9c9d9 # Parent 0298ee6b74498e4f1b87dfe038a064757fbf20a2 [svn r396] ...more tabs removed diff -r 0298ee6b7449 -r ab427801f058 gmyth/src/gmyth_scheduler.c --- a/gmyth/src/gmyth_scheduler.c Tue Mar 06 14:06:16 2007 +0000 +++ b/gmyth/src/gmyth_scheduler.c Tue Mar 06 14:17:04 2007 +0000 @@ -105,13 +105,13 @@ { GMythScheduler *scheduler = GMYTH_SCHEDULER (object); - if (scheduler->backend_info) { - g_object_unref (scheduler->backend_info); + if (scheduler->backend_info) { + g_object_unref (scheduler->backend_info); scheduler->backend_info = NULL; } - if (scheduler->msqlquery) { - g_object_unref (scheduler->msqlquery); + if (scheduler->msqlquery) { + g_object_unref (scheduler->msqlquery); scheduler->msqlquery = NULL; } @@ -264,7 +264,7 @@ schedule->category = g_string_new (row[10]); (*schedule_list) = g_list_append (*(schedule_list), schedule); - } + } } mysql_free_result (msql_res); @@ -326,7 +326,7 @@ record->basename = g_string_new (row[12]); (*recorded_list) = g_list_append ((*recorded_list), record); - } + } } mysql_free_result (msql_res); @@ -387,7 +387,7 @@ schedule_info->channel_id,//station (gmyth_util_time_val_to_date( schedule_info->start_time ))->tm_wday, //findday gmyth_util_time_to_string_only_time( schedule_info->start_time ), //findtime - (gint)(schedule_info->start_time->tv_sec/60/60/24 + 719528)//findid + (gint)(schedule_info->start_time->tv_sec/60/60/24 + 719528)//findid ); gmyth_debug ( "Sending query to MySQL = %s.", query_str->str ); @@ -441,8 +441,8 @@ msql_res = gmyth_query_process_statement (scheduler->msqlquery, query_str->str); if (msql_res == NULL) { - g_warning ("[%s] Error while trying to delete a schedule in the database", __FUNCTION__); - return FALSE; + g_warning ("[%s] Error while trying to delete a schedule in the database", __FUNCTION__); + return FALSE; } update_backend(scheduler, record_id);// Notify the backend of the changes @@ -530,58 +530,54 @@ msql_res = gmyth_query_process_statement (scheduler->msqlquery, query_str->str); if (msql_res /*&& query.size() > 0*/) { - - MYSQL_ROW msql_row = mysql_fetch_row (msql_res); - if (msql_row) { + MYSQL_ROW msql_row = mysql_fetch_row (msql_res); + if (msql_row) { + proginfo = gmyth_program_info_new(); - proginfo = gmyth_program_info_new(); - - proginfo->chanid = g_string_new (msql_row[0]); - proginfo->startts = gmyth_util_string_to_time_val (msql_row[23]); - proginfo->endts = gmyth_util_string_to_time_val (msql_row[24]); - proginfo->recstartts = gmyth_util_string_to_time_val (msql_row[1]); - proginfo->recendts = gmyth_util_string_to_time_val (msql_row[2]); - proginfo->title = g_string_new (msql_row[3]); - proginfo->subtitle = g_string_new (msql_row[4]); - proginfo->description = g_string_new (msql_row[5]); + proginfo->chanid = g_string_new (msql_row[0]); + proginfo->startts = gmyth_util_string_to_time_val (msql_row[23]); + proginfo->endts = gmyth_util_string_to_time_val (msql_row[24]); + proginfo->recstartts = gmyth_util_string_to_time_val (msql_row[1]); + proginfo->recendts = gmyth_util_string_to_time_val (msql_row[2]); + proginfo->title = g_string_new (msql_row[3]); + proginfo->subtitle = g_string_new (msql_row[4]); + proginfo->description = g_string_new (msql_row[5]); - proginfo->chanstr = g_string_new (msql_row[6]); - proginfo->chansign = g_string_new (msql_row[7]); - proginfo->channame = g_string_new (msql_row[0]); - proginfo->chancommfree = (gint) g_ascii_strtoull (msql_row[9], NULL, 10); - proginfo->chanOutputFilters = g_string_new (msql_row[10]); - proginfo->seriesid = g_string_new (msql_row[11]); - proginfo->programid = g_string_new (msql_row[12]); - proginfo->filesize = g_ascii_strtoull (msql_row[13], NULL, 10); - - proginfo->lastmodified = gmyth_util_string_to_time_val (msql_row[14]); - - proginfo->stars = g_ascii_strtod (msql_row[15], NULL); - proginfo->repeat = (gint) g_ascii_strtoull (msql_row[16], NULL, 10); - - if (msql_row[17] == NULL) { - proginfo->originalAirDate = 0; - proginfo->hasAirDate = FALSE; - } else { - proginfo->originalAirDate = gmyth_util_string_to_time_val (msql_row[17]); - proginfo->hasAirDate = TRUE; - } - - proginfo->hostname = g_string_new (msql_row[18]); - proginfo->recordid = (gint) g_ascii_strtoull (msql_row[19], NULL, 10); - proginfo->transcoder = (gint) g_ascii_strtoull (msql_row[20], NULL, 10); + proginfo->chanstr = g_string_new (msql_row[6]); + proginfo->chansign = g_string_new (msql_row[7]); + proginfo->channame = g_string_new (msql_row[0]); + proginfo->chancommfree = (gint) g_ascii_strtoull (msql_row[9], NULL, 10); + proginfo->chanOutputFilters = g_string_new (msql_row[10]); + proginfo->seriesid = g_string_new (msql_row[11]); + proginfo->programid = g_string_new (msql_row[12]); + proginfo->filesize = g_ascii_strtoull (msql_row[13], NULL, 10); - //proginfo->spread = -1; - ////proginfo->programflags = proginfo->getProgramFlags(); - - proginfo->recgroup = g_string_new (msql_row[26]); - proginfo->playgroup = g_string_new (msql_row[21]); - proginfo->recpriority = (gint) g_ascii_strtoull (msql_row[22], NULL, 10); + proginfo->lastmodified = gmyth_util_string_to_time_val (msql_row[14]); + proginfo->stars = g_ascii_strtod (msql_row[15], NULL); + proginfo->repeat = (gint) g_ascii_strtoull (msql_row[16], NULL, 10); - proginfo->pathname = g_string_new (msql_row[25]); + if (msql_row[17] == NULL) { + proginfo->originalAirDate = 0; + proginfo->hasAirDate = FALSE; + } else { + proginfo->originalAirDate = gmyth_util_string_to_time_val (msql_row[17]); + proginfo->hasAirDate = TRUE; + } - gmyth_debug ("One program info loaded from mysql database\n"); - } + proginfo->hostname = g_string_new (msql_row[18]); + proginfo->recordid = (gint) g_ascii_strtoull (msql_row[19], NULL, 10); + proginfo->transcoder = (gint) g_ascii_strtoull (msql_row[20], NULL, 10); + //proginfo->spread = -1; + //proginfo->programflags = proginfo->getProgramFlags(); + + proginfo->recgroup = g_string_new (msql_row[26]); + proginfo->playgroup = g_string_new (msql_row[21]); + proginfo->recpriority = (gint) g_ascii_strtoull (msql_row[22], NULL, 10); + + proginfo->pathname = g_string_new (msql_row[25]); + + gmyth_debug ("One program info loaded from mysql database\n"); + } } mysql_free_result (msql_res); diff -r 0298ee6b7449 -r ab427801f058 gmyth/src/gmyth_scheduler.h --- a/gmyth/src/gmyth_scheduler.h Tue Mar 06 14:06:16 2007 +0000 +++ b/gmyth/src/gmyth_scheduler.h Tue Mar 06 14:17:04 2007 +0000 @@ -98,18 +98,18 @@ }; typedef struct { - guint record_id; - guint program_id; - guint channel_id; - + guint record_id; + guint program_id; + guint channel_id; + GTimeVal *start_time; - GTimeVal *end_time; - - GString *title; - GString *subtitle; - GString *description; - GString *category; - + GTimeVal *end_time; + + GString *title; + GString *subtitle; + GString *description; + GString *category; + } ScheduleInfo; typedef struct {