[Info] New: Ability to watch ArgusTV (formerly ForTheRecord) Recordings in MPExtended (web or aMPdroid) (1 Viewer)

hairlesshobo

MP Donator
  • Premium Supporter
  • March 18, 2012
    66
    22
    Jacksonville, FL
    Home Country
    United States of America United States of America
    I am a faithful MediaPortal user who also utilizes ForTheRecord as the scheduling engine. I love my HTPC setup, but was bummed out when I found that it was not possible to watch any recordings that were made by ForTheRecord on the MPExtended web interface or in aMPdroid.

    For anyone else who has been in this predicament, I am happy to share the solution I came up with for my own setup. Using the SQL script that I wrote, I am able to synchronize all recordings from the ForTheRecord database to the MediaPortal database. Since ForTheRecord does not use the stock MP TV client, it should be perfectly safe to insert the necessary information.

    Long story short, when this script runs it synchronizes all recordings that are present in the ForTheRecord database into the MediaPortal database. By doing this, MPExtended can then "see" the recordings that are present on the hard disk and is able to stream it as if the recording were made natively by MediaPortal. I really do hope that this script is able to be useful to someone else as much as it is for me.

    Anyone who decides to try this out, please let me know how it goes!

    Notes:
    1. This script only synchronizes in ONE direction. Every time this script is ran, it ensures that the MediaPortal database reflects exactly what the ForTheRecord database shows at the time the script is ran. In order to help prevent situations where a recording originated from MediaPortal itself instead of being added by this script, ALL recordings that are added by this script are marked with a idSchedule of -102.
    2. This script was written for MySQL only, there's an extremely high chance that it will not work at all with MSSQL installations without first being rewritten.
    3. The MediaPortal and ForTheRecord database both must reside on the same MySQL server instance.
    4. When using MediaPortal as the recording engine, the script will not work properly if any of the channels are manually mapped in the MediaPortal TV Server ForTheRecord plugin. This is because the mappings are stored in a XML file that this script cannot access. The best workaround is to make sure that ALL channel names
    5. When using ForTheRecord as the recording engine (untested), the MediaPortal TV server must be installed on the same machine that hosts MPExtended. This is because MPExtended will only access a MediaPortal TV server instance. You should not need to import any EPG or XMLTV data, but you WILL need to make sure that that all channels that exist in ForTheRecord, must also be present in the MediaPortal TV Server. I do not believe that you will need to map any channels to cards, but again, this entire setup is untested. I ask that someone try and let me know how it works out.
    6. If your MySQL database is not on the same machine where MediaPortal and ForTheRecord are located, you will need to install the MySQL client utilities or find another way to run this script and ignore most of the directions here.
    Installation:
    1. Unpack this zip file to anywhere you want.
    2. Edit Synchronize.bat and locate the following lines toward the top of the file:
      • set SQLhost=localhost
      • set SQLuser=root
      • set SQLpassword=changeme
    3. Change the host, username, and password for your MySQL database server. This password is usually 'MediaPortal'
    4. Schedule the bat file to run (see below)
    5. Login to MPExtended Web and/or open aMPdroid on Android and verify that recorded TV shows all the recordings that are available in ForTheRecord.
    Scheduling:
    • To schedule in Windows (tested method), you will need to add a new scheduled task in Windows Task Scheduler. I recommend having the task run every 5 minutes. Just make sure that you specify the start path to the location that you unpacked the zip file to above.
    • This script could also be scheduled in Window's Task Scheduler or setup to run at the start and the end of any recording in ForTheRecord, but this is untested.

    -Steve
     

    Attachments

    • FTR to MP Sync Script v1.0.zip
      3.5 KB

    Captain Dunsel

    Portal Member
    January 26, 2014
    6
    4
    New York
    Home Country
    United States of America United States of America
    MANY thanks for this! I was looking for a solution for this exact problem. Of course, I am using SQL Server instead of MySQL...

    ...so I took up the gauntlet and ported your SQL script and batch file for use with SQL Server. I am currently using it with Argus TV 2.2.1, MediaPortal 1.6, and SQL Server 2012 Express with SP1 on Windows 8.1 x64 and it works flawlessly.

    I hope that my work honors yours. Again, thanks for doing the heavy lifting!


    CD
     

    Attachments

    • ArgusTVtoMpTVDBSync.zip
      4.5 KB

    Peter2

    MP Donator
  • Premium Supporter
  • September 18, 2006
    848
    53
    Home Country
    Belgium Belgium
    Hi Steve,
    Good for you that you found a solution and nice that you are sharing it.
    Just out of curiosity: I have heard about 4TR but do not know a lot about it, so what is the reason/advantage of using it for recording instead of MePo?
    P.
     

    hairlesshobo

    MP Donator
  • Premium Supporter
  • March 18, 2012
    66
    22
    Jacksonville, FL
    Home Country
    United States of America United States of America
    MANY thanks for this! I was looking for a solution for this exact problem. Of course, I am using SQL Server instead of MySQL...

    ...so I took up the gauntlet and ported your SQL script and batch file for use with SQL Server. I am currently using it with Argus TV 2.2.1, MediaPortal 1.6, and SQL Server 2012 Express with SP1 on Windows 8.1 x64 and it works flawlessly.

    I hope that my work honors yours. Again, thanks for doing the heavy lifting!

    Awesome!! Thanks for your help with this one. Question, aside from the usual converting from MySQL to MSSQL, did you have to do anything in particular to make the script compatible with MP 1.6.0 and Argus 2.2.1? I haven't yet updated my server to the latest version of both apps and was wondering if I should expect to need to make changes to this script in the process.

    Hi Steve,
    Good for you that you found a solution and nice that you are sharing it.
    Just out of curiosity: I have heard about 4TR but do not know a lot about it, so what is the reason/advantage of using it for recording instead of MePo?
    P.

    I found that the power of the scheduling engine in 4TR (Now ArgusTV) is much more powerful than MediaPortal's. I still use MediaPortal as the actual recorder but Argus is used to tell the server when to start and stop recording. Plus there is a handy Android and iOS app available that lets you control the scheduler remotely so you can search for programs and schedule them while you're out and about.
     

    Captain Dunsel

    Portal Member
    January 26, 2014
    6
    4
    New York
    Home Country
    United States of America United States of America
    Awesome!! Thanks for your help with this one. Question, aside from the usual converting from MySQL to MSSQL, did you have to do anything in particular to make the script compatible with MP 1.6.0 and Argus 2.2.1? I haven't yet updated my server to the latest version of both apps and was wondering if I should expect to need to make changes to this script in the process.

    There was nothing Argus-release- or MP-release-specific that I found. The changes were all subtle syntax, substitution of similar verbs and appropriate parameter massaging, explicitly specify default collation in some places, etc. I also globally replaced reference to "ForTheRecord" to "Argus", just because I'm anal retentive. :)


    CD
     

    hairlesshobo

    MP Donator
  • Premium Supporter
  • March 18, 2012
    66
    22
    Jacksonville, FL
    Home Country
    United States of America United States of America
    Awesome!! Thanks for your help with this one. Question, aside from the usual converting from MySQL to MSSQL, did you have to do anything in particular to make the script compatible with MP 1.6.0 and Argus 2.2.1? I haven't yet updated my server to the latest version of both apps and was wondering if I should expect to need to make changes to this script in the process.

    There was nothing Argus-release- or MP-release-specific that I found. The changes were all subtle syntax, substitution of similar verbs and appropriate parameter massaging, explicitly specify default collation in some places, etc. I also globally replaced reference to "ForTheRecord" to "Argus", just because I'm anal retentive. :)


    CD

    Awesome, great to know. And again, thanks for taking the time to port this for all the other SQL server users out there!

    -Steve
     

    Users who are viewing this thread

    Top Bottom