Schedule Corrector Plugin (automaticly) (1 Viewer)

MoPhat

Retired Team Member
  • Premium Supporter
  • June 17, 2007
    816
    226
    Berg
    Home Country
    Switzerland Switzerland
    Hi i have started to delvelop a plugin witch checks the recording (schedule) table and if the recording time has changed will the plugin change the schedule time to a new one.

    the goal is that no more recordings g to manual recordings :D

    I have now a few probs...

    1. How do i am using the gentle.config to receive the connection string?
    2. how do i am fire the schedule update to the TVServer, im just change the SQL table entry?

    the solution has a test form for testing purpose.

    thanks for any feedback
    MoPhat

    :D
     

    gemx

    Retired Team Member
  • Premium Supporter
  • October 31, 2006
    1,972
    539
    Home Country
    Germany Germany
    1)
    Have a look at "SetupDatabaseForm.cs" and there at the function "public bool TestConnection()" starting at line 167 and "LoadConnectionDetails"
    but you said you intend to write a plugin (i think for TvServer) because then you don't need to bother with the connection details. TvServer establishes the connection upon starting up. You can just use the DB wrapper classes

    2)
    Just call "RemoteControl.Instance.OnNewSchedule();".

    Hope this helps.
    I like your idea very much :)
     

    MoPhat

    Retired Team Member
  • Premium Supporter
  • June 17, 2007
    816
    226
    Berg
    Home Country
    Switzerland Switzerland
    Thank you gemx

    I hate that if the recordings going to "manual", my wife asks me everytime: where is my recording??? :mad:

    In my code i have normaly sql statements like this:

    Code:
    public static void update_ScheduleEntry(cProgram schedule)
            {
                SqlConnection SqlCon = new SqlConnection(myConnection);
                try
                {
                    SqlCon.Open();
                    SqlCommand SqlCmd = new SqlCommand("UPDATE Schedule SET  startTime = @startTime, endTime = @endTime WHERE id_Schedule = @id_Schedule", SqlCon);
                    SqlCmd.Parameters.AddWithValue("@id_Schedule", schedule.id_Schedule);
                    SqlCmd.Parameters.AddWithValue("@startTime", schedule.startTime);
                    SqlCmd.Parameters.AddWithValue("@endTime", schedule.endTime);
                    SqlCmd.ExecuteNonQuery();
                }
                catch (Exception exp)
                {
                    Log.Error(exp.Message, new object[0]);
                }
                finally
                {
                    if (SqlCon.State == ConnectionState.Open)
                    {
                        SqlCon.Close();
                    }
                }
            }
    and i need just for the "myConnection" the connection string of Gentle.Config

    Do i get with "LoadConnectionDetails" a SqlConnection object?

    Can i fire at last the method RemoteControl.Instance.OnNewSchedule();" or on every table change?


    P.S.

    I have a idea for documentations:
    Everyone ho create/change a interface / namespace / method etc. must update/create a wiki entry for this piece of code.

    Without that, the code/patch etc. is not inserted in the SVN!
    Then we had a well docu of all this classes :p

    What do you think about that?

    thank you for your help :D :D :D :D :D :D
    MoPhat
     

    MoPhat

    Retired Team Member
  • Premium Supporter
  • June 17, 2007
    816
    226
    Berg
    Home Country
    Switzerland Switzerland
    Hi dvdfreak, i know that :D , but its now fully integrated in to MP?
    I use my MP only with my remote control (and my wife too).

    MoPhat
     

    dvdfreak

    Portal Pro
    June 13, 2006
    979
    178
    Home Country
    Belgium Belgium
    Hi dvdfreak, i know that :D , but its now fully integrated in to MP?
    I use my MP only with my remote control (and my wife too).

    Stay tuned then, announcement coming soon(ish)... :) Hope you will like it... :D
     

    MoPhat

    Retired Team Member
  • Premium Supporter
  • June 17, 2007
    816
    226
    Berg
    Home Country
    Switzerland Switzerland
    Ok.... should i stop my dev on this plugin? :cool:

    MoPhat
     

    Users who are viewing this thread

    Top Bottom