....
-->
<DefaultProvider name="SQLServer" connectionString="Password=********;Persist Security Info=True;User ID=sa;Initial Catalog=MpTvDb;Data Source=server\SQLEXPRESS;Connection Timeout=300;" />
<!--
<DefaultProvider name="Firebird" connectionString="User=SYSDBA;Password=masterkey;Data Source=TvLibrary.fdb;ServerType=1;Charset=UNICODE_FSS;" />
...
Thank you again Larry for taking the time...The Problem is, that the SQL-Select get as result no scheduled recording.
And then the task never changes.
The database exists. There is no error.
Please Look at the file "Gentle.config" in the TV-Server Data Folder. The File can be watsched with the editor.
Look at this part:
The same options as in the script have to be. Also you can paste it here.Code:.... --> <DefaultProvider name="SQLServer" connectionString="Password=********;Persist Security Info=True;User ID=sa;Initial Catalog=MpTvDb;Data Source=server\SQLEXPRESS;Connection Timeout=300;" /> <!-- <DefaultProvider name="Firebird" connectionString="User=SYSDBA;Password=masterkey;Data Source=TvLibrary.fdb;ServerType=1;Charset=UNICODE_FSS;" /> ...
I think I have the solution. The database query produces the lowest start time. In MediaPortal are in the list of scheduled recordings still images from the past who have not worked. Look for and please delete this from the planning recordings.
" and (starttime>current_timestamp or Endtime>current_timestamp) " & _
set rs1=db1.execute("SELECT min(Starttime) as start from " & _
"( select dateadd(mi,(preRecordInterval+"&Zeitdiff&")*-1,Starttime) as starttime, dateadd(mi,PostRecordInterval+"&Zeitdiff&",Endtime) as endtime " & _
" from schedule " & _
" where scheduleType=0 " & _
" and (starttime>current_timestamp or Endtime>current_timestamp) " & _
" union " & _
" select dateadd(mi,datepart(mi,starttime)-(preRecordInterval) -"&Zeitdiff&" ,dateadd(hh,datepart(hh,starttime),heute)) as startime, " & _
" dateadd(mi,datepart(mi,endtime)+(PostRecordInterval)+"&Zeitdiff&" ,dateadd(hh,datepart(hh,endtime),heute)) as endtime " & _
" from schedule " & _
" inner join (SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) as heute,DATEADD(dd, -1, DATEDIFF(dd, 0, GETDATE())) as gestern, DATEADD(dd, +1, DATEDIFF(dd, 0, GETDATE())) as morgen ) as UA " & _
" on 1=1 " & _
" where scheduleType in(1,3,4) or (scheduleType=2 and datepart(dw,heute)=datepart(dw,starttime)) or (scheduleType=6 and datepart(dw,heute) in (1,2,3,4,5)) or (scheduleType=5 and datepart(dw,heute) in (6,7)) " & _
" union " & _
" select dateadd(mi,datepart(mi,starttime)-(preRecordInterval) -"&Zeitdiff&" ,dateadd(hh,datepart(hh,starttime),morgen)) as startime, " & _
" dateadd(mi,datepart(mi,endtime)+(PostRecordInterval)+"&Zeitdiff&" ,dateadd(hh,datepart(hh,endtime),morgen)) as endtime " & _
" from schedule " & _
" inner join (SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) as heute,DATEADD(dd, -1, DATEDIFF(dd, 0, GETDATE())) as gestern, DATEADD(dd, +1, DATEDIFF(dd, 0, GETDATE())) as morgen ) as UA " & _
" on 1=1 " & _
" where scheduleType in(1,3,4) or (scheduleType=2 and datepart(dw,morgen)=datepart(dw,starttime)) or (scheduleType=6 and datepart(dw,morgen) in (1,2,3,4,5)) or (scheduleType=5 and datepart(dw,morgen) in (6,7)) " & _
" union " & _
" select dateadd(mi,datepart(mi,starttime)-(preRecordInterval) -"&Zeitdiff&" ,dateadd(hh,datepart(hh,starttime),gestern)) as startime, " & _
" dateadd(mi,datepart(mi,endtime)+(PostRecordInterval)+"&Zeitdiff&" ,dateadd(hh,datepart(hh,endtime),gestern)) as endtime " & _
" from schedule " & _
" inner join (SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) as heute,DATEADD(dd, -1, DATEDIFF(dd, 0, GETDATE())) as gestern, DATEADD(dd, +1, DATEDIFF(dd, 0, GETDATE())) as morgen ) as UA " & _
" on 1=1 " & _
" where scheduleType in(1,3,4) or (scheduleType=2 and datepart(dw,gestern)=datepart(dw,starttime)) or (scheduleType=6 and datepart(dw,gestern) in (1,2,3,4,5)) or (scheduleType=5 and datepart(dw,gestern) in (6,7)) " & _
") as ua " & _
"where endTime>current_timestamp")
The Problem only exists on schedules scheduleType 0 (One Time).
The Scheduled Series works correctly.
You can also try to change the following in the Script.
Add the line (after the 4.) in the SQL Statement:
Code:" and (starttime>current_timestamp or Endtime>current_timestamp) " & _
Complete SQL:
Code:set rs1=db1.execute("SELECT min(Starttime) as start from " & _ "( select dateadd(mi,(preRecordInterval+"&Zeitdiff&")*-1,Starttime) as starttime, dateadd(mi,PostRecordInterval+"&Zeitdiff&",Endtime) as endtime " & _ " from schedule " & _ " where scheduleType=0 " & _ " and (starttime>current_timestamp or Endtime>current_timestamp) " & _ " union " & _ " select dateadd(mi,datepart(mi,starttime)-(preRecordInterval) -"&Zeitdiff&" ,dateadd(hh,datepart(hh,starttime),heute)) as startime, " & _ " dateadd(mi,datepart(mi,endtime)+(PostRecordInterval)+"&Zeitdiff&" ,dateadd(hh,datepart(hh,endtime),heute)) as endtime " & _ " from schedule " & _ " inner join (SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) as heute,DATEADD(dd, -1, DATEDIFF(dd, 0, GETDATE())) as gestern, DATEADD(dd, +1, DATEDIFF(dd, 0, GETDATE())) as morgen ) as UA " & _ " on 1=1 " & _ " where scheduleType in(1,3,4) or (scheduleType=2 and datepart(dw,heute)=datepart(dw,starttime)) or (scheduleType=6 and datepart(dw,heute) in (1,2,3,4,5)) or (scheduleType=5 and datepart(dw,heute) in (6,7)) " & _ " union " & _ " select dateadd(mi,datepart(mi,starttime)-(preRecordInterval) -"&Zeitdiff&" ,dateadd(hh,datepart(hh,starttime),morgen)) as startime, " & _ " dateadd(mi,datepart(mi,endtime)+(PostRecordInterval)+"&Zeitdiff&" ,dateadd(hh,datepart(hh,endtime),morgen)) as endtime " & _ " from schedule " & _ " inner join (SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) as heute,DATEADD(dd, -1, DATEDIFF(dd, 0, GETDATE())) as gestern, DATEADD(dd, +1, DATEDIFF(dd, 0, GETDATE())) as morgen ) as UA " & _ " on 1=1 " & _ " where scheduleType in(1,3,4) or (scheduleType=2 and datepart(dw,morgen)=datepart(dw,starttime)) or (scheduleType=6 and datepart(dw,morgen) in (1,2,3,4,5)) or (scheduleType=5 and datepart(dw,morgen) in (6,7)) " & _ " union " & _ " select dateadd(mi,datepart(mi,starttime)-(preRecordInterval) -"&Zeitdiff&" ,dateadd(hh,datepart(hh,starttime),gestern)) as startime, " & _ " dateadd(mi,datepart(mi,endtime)+(PostRecordInterval)+"&Zeitdiff&" ,dateadd(hh,datepart(hh,endtime),gestern)) as endtime " & _ " from schedule " & _ " inner join (SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) as heute,DATEADD(dd, -1, DATEDIFF(dd, 0, GETDATE())) as gestern, DATEADD(dd, +1, DATEDIFF(dd, 0, GETDATE())) as morgen ) as UA " & _ " on 1=1 " & _ " where scheduleType in(1,3,4) or (scheduleType=2 and datepart(dw,gestern)=datepart(dw,starttime)) or (scheduleType=6 and datepart(dw,gestern) in (1,2,3,4,5)) or (scheduleType=5 and datepart(dw,gestern) in (6,7)) " & _ ") as ua " & _ "where endTime>current_timestamp")
Please let me know if it works
Can you test the following:
Delete the schedule tasks. Create only one Single Scheduled Task.
If this works correctly, then the Problem is a part of the SQL Statement.
In this case you can create an Scheduled Series Task (Type 3) an send me the Entries in the Database.
I will ad this in my Database and Check the SQL-Statement.