MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal TV-Server 1 » Help on Development » Development


Development You want to code something for the TV-Server? Share it in here!

Reply
 
LinkBack Thread Tools Display Modes
Old 2008-03-21, 14:44   #1 (permalink)
MP Donator
 
MoPhat's Avatar
 
Join Date: Jun 2007
Location: Berg, Switzerland
Age: 35
Posts: 644
Thanks: 4
Thanked 41 Times in 10 Posts

Country:

My System

Help us Schedule Corrector Plugin (automaticly)

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

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

Attached Files
File Type: rar Schedule Corrector.rar (659.8 KB, 5 views)

Last edited by MoPhat; 2008-03-21 at 21:29.
MoPhat is offline   Reply With Quote
Old 2008-03-24, 08:20   #2 (permalink)
MP Donator
 
MoPhat's Avatar
 
Join Date: Jun 2007
Location: Berg, Switzerland
Age: 35
Posts: 644
Thanks: 4
Thanked 41 Times in 10 Posts

Country:

My System

Default

No one a idea?



MoPhat
MoPhat is offline   Reply With Quote
Old 2008-03-24, 13:15   #3 (permalink)
Portal Developer
 
gemx's Avatar
 
Join Date: Oct 2006
Age: 32
Posts: 1,233
Thanks: 22
Thanked 184 Times in 97 Posts

Country:

My System

Default

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
__________________
ACCENT HT-100 | 2x16 VFD | ADM Athlon 64 3500+ | Win XP SP2 | SkyStar 2 DVB-S PCI | TT connect S2-3600
gemx is online now   Reply With Quote
Old 2008-03-24, 14:14   #4 (permalink)
MP Donator
 
MoPhat's Avatar
 
Join Date: Jun 2007
Location: Berg, Switzerland
Age: 35
Posts: 644
Thanks: 4
Thanked 41 Times in 10 Posts

Country:

My System

Default

Thank you gemx

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

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

What do you think about that?

thank you for your help
MoPhat
MoPhat is offline   Reply With Quote
Old 2008-04-05, 21:39   #5 (permalink)
MP Donator
 
MoPhat's Avatar
 
Join Date: Jun 2007
Location: Berg, Switzerland
Age: 35
Posts: 644
Thanks: 4
Thanked 41 Times in 10 Posts

Country:

My System

Default

No one a tip?
MoPhat is offline   Reply With Quote
Old 2008-04-16, 21:32   #6 (permalink)
MP Donator
 
MoPhat's Avatar
 
Join Date: Jun 2007
Location: Berg, Switzerland
Age: 35
Posts: 644
Thanks: 4
Thanked 41 Times in 10 Posts

Country:

My System

Default

bump, no one any tips for me?



MoPhat
MoPhat is offline   Reply With Quote
Old 2008-04-18, 07:53   #7 (permalink)
Portal Member
 
dvdfreak's Avatar
 
Join Date: Jun 2006
Posts: 527
Thanks: 0
Thanked 29 Times in 16 Posts

Country:

My System

Default

Have you considered using TV Scheduler?

Rule-based TvScheduler service

It does exactly what you want, and so much more...
dvdfreak is online now   Reply With Quote
Old 2008-04-18, 08:11   #8 (permalink)
MP Donator
 
MoPhat's Avatar
 
Join Date: Jun 2007
Location: Berg, Switzerland
Age: 35
Posts: 644
Thanks: 4
Thanked 41 Times in 10 Posts

Country:

My System

Default

Hi dvdfreak, i know that , but its now fully integrated in to MP?
I use my MP only with my remote control (and my wife too).

MoPhat
MoPhat is offline   Reply With Quote
Old 2008-04-18, 08:49   #9 (permalink)
Portal Member
 
dvdfreak's Avatar
 
Join Date: Jun 2006
Posts: 527
Thanks: 0
Thanked 29 Times in 16 Posts

Country:

My System

Default

Quote:
Originally Posted by MoPhat View Post
Hi dvdfreak, i know that , 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...
dvdfreak is online now   Reply With Quote
Old 2008-04-18, 14:24   #10 (permalink)
MP Donator
 
MoPhat's Avatar
 
Join Date: Jun 2007
Location: Berg, Switzerland
Age: 35
Posts: 644
Thanks: 4
Thanked 41 Times in 10 Posts

Country:

My System

Default

Ok.... should i stop my dev on this plugin?

MoPhat
MoPhat is offline   Reply With Quote
Reply

Bookmarks

Tags
automaticly, corrector, plugin, schedule

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Set automaticly the Folder-Views noxx2 General Support 1 2007-10-30 13:54
View multi-file movies as one, and/or automaticly play all Al_Capone Improvement Suggestions 4 2007-10-18 17:02
MP is downloading album art automaticly , how do i stop it. ohdarklord General Support 8 2007-09-28 11:21
TV-Engine 0230-RC1 MP Plugin starts automaticly timeshift grobi Get Support 2 2007-06-24 12:32
How to start WebEPG automaticly? Steffen WebEPG 9 2006-10-08 16:02


All times are GMT +1. The time now is 11:36.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress