TV-Server on WHS - Collection of fixes and workarounds (1 Viewer)

larry_S

MP Donator
  • Premium Supporter
  • December 11, 2008
    1,441
    167
    Home Country
    Germany Germany
    AW: TV-Server on WHS - Collection of fixes and workarounds

    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:
    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;" />
    ...
    The same options as in the script have to be. Also you can paste it here.
     

    vvulture

    MP Donator
  • Premium Supporter
  • June 3, 2006
    483
    8
    51
    Sydney
    Home Country
    Australia Australia
    Re: AW: TV-Server on WHS - Collection of fixes and workarounds

    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:
    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;" />
    ...
    The same options as in the script have to be. Also you can paste it here.
    Thank you again Larry for taking the time...
    My settings in Gentle.config are exactly the same as yours, and also the same as the vbs script..

    I am totally lost.. :(

    This what i do:

    1 - I run vbs script first time and MP_Aufnahmen task is created. <----- OK
    2 - Set MP_Aufnahmen to wake up server and UNTICK " Stop task after 72hrs" <---- OK
    2 - Create WHS_LO_Erw task and configure to run when server starts. Also UNTICK "Stop task after 72hrs" <---- OK

    Now, if recording scheduled, WHS_Standby.log will show ( example ):

    --- Start ---
    Set Taskplaner = 14/02/2010 3:47:00 PM
    Set LightsOut = 1

    However, MP_Aufnahmen does not change....

    cheers
     

    larry_S

    MP Donator
  • Premium Supporter
  • December 11, 2008
    1,441
    167
    Home Country
    Germany Germany
    AW: TV-Server on WHS - Collection of fixes and workarounds

    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.
     

    vvulture

    MP Donator
  • Premium Supporter
  • June 3, 2006
    483
    8
    51
    Sydney
    Home Country
    Australia Australia
    Re: AW: TV-Server on WHS - Collection of fixes and workarounds

    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.

    Ok Larry, i looked inside my database in the "Schedule" table. I founs that most entries are dated 2008 and 2009. Very few 2010.
    Now the strange part is that the schedules dated 2008 and 2009 are set to record everytime they air, some of which record eveyday. How can a show dated 2008 still record ???

    My guess is because the show is set to record "every time", the date is ignored and i can see how it would cause issues with your script..

    let me know what you think..
     

    larry_S

    MP Donator
  • Premium Supporter
  • December 11, 2008
    1,441
    167
    Home Country
    Germany Germany
    AW: TV-Server on WHS - Collection of fixes and workarounds

    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
     

    vvulture

    MP Donator
  • Premium Supporter
  • June 3, 2006
    483
    8
    51
    Sydney
    Home Country
    Australia Australia
    Re: AW: TV-Server on WHS - Collection of fixes and workarounds

    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


    Ok, i will try that.

    But first here is what i have done:

    - Deleted ALL schedules
    - Created one schedule for tonight
    WHS_Standby.log:

    17/02/2010 10:18:04 PM --- Start ---
    17/02/2010 10:18:04 PM Set Taskplaner: 17/02/2010 10:49:00 PM
    17/02/2010 10:18:04 PM Set LightsOut = 1

    MP_Aufnahmen did not change. It is always set for 18/02/2010 12:00AM

    All my schedules are type 3.

    Cheers
     

    larry_S

    MP Donator
  • Premium Supporter
  • December 11, 2008
    1,441
    167
    Home Country
    Germany Germany
    AW: TV-Server on WHS - Collection of fixes and workarounds

    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.
     

    vvulture

    MP Donator
  • Premium Supporter
  • June 3, 2006
    483
    8
    51
    Sydney
    Home Country
    Australia Australia
    Re: AW: TV-Server on WHS - Collection of fixes and workarounds

    Ok.
    I tried you last suggestions ( with the changes to the script ) and things have changed.

    WHS_Standby.log :

    17/02/2010 10:34:06 PM --- Start ---
    17/02/2010 10:34:06 PM Set Taskplaner: 01.01.2020
    17/02/2010 10:34:07 PM Set LightsOut = 0 (keine Aktion)

    The time on MP_Aufnahmen changed to 12AM 1/01/2020

    Now, the problem is that i have no scheduled recordings until 18:30 18/02/2010 so why is the script keeping the sever on ?

    cheers

    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.


    Already tries this.. did nothing.

    How do i send you entries of database ?
     

    Users who are viewing this thread

    Top Bottom