Results 1 to 10 of 10

Thread: VideoConduit - Standalone App to Import Lost TV Recordings into NPVR

  1. #1
    Join Date
    May 2009
    Location
    USA, West Michigan
    Posts
    9

    VideoConduit - Standalone App to Import Lost TV Recordings into NPVR

    Backstory
    I moved some of my 300-400 media files (TV episodes) to a different drive and NPVR dutifully removed them from its database. I didn't catch it in time so all the various methods of fixing the problem didn't work. I played with VidImport.exe but don't recall why I wasn't satisfied with the results. Thus was born VideoConduit.

    What does VideoConduit do?
    VideoConduit (VC) scans a directory for media files, parses episode information from the filenames by configurable settings (Season/Episode details, or by Air Date details), obtains episode details from http://thetvdb.com, and creates scheduled_recording records in the NPVR DB (and/or creates a normal import .XML file too).

    Notes/Usage Tips

    • Backup your NPVR DB before starting to be safe.
    • Adjust the .config if needed. The path to the NPVR DB (NPVRSQLiteConnectionString) must be correct.
    • You can adjust the REGEXs that parse filenames as long as you keep the named capture groupings intact. Out of the box it handles media file names like using:
      • CSI Crime Scene Investigation_20131120_22002300.mkv (RegEx_FileNameAirDateInfoMatcher matches the colored text)
      • The.Blacklist..S03E18.Mr..Solomon.Conclusion.mkv (RegEx_FileNameEpisodeInfoMatcher matches the colored text)

    • If you modify the REGEXs in the .config file, note they are encoded for storage in the XML file so that the < and > signs are encoded.
    • The air date matcher must match the exact original air date of the show.
    • VC scans one directory at a time. Scan a single show directory at a time. I have no plans to scan multiple shows recursively.
    • If you need an exact TV series match by numeric id, name your folder the exact integer of thetvdb.com series id shown. If the folder name is an integer, VC will attempt to use it to locate the series by that id. If it fails, it will fall back to the normal method.
    • Includes a API key to the TheTVDB.com in setting TheTVDBAPIKey. You can get your own for free (at time of post) if it goes defunct.
    • Need the .Net Framework 4.0.
    • Tested on US English environment.
    • Several directories are created in normal execution.
      • ShowInfoCache is of interest if you want to adjust the imported details. You'll have to run VC against an empty directory named after your missing show, or run VC then remove recordings, and then run VC again against the real directory full of files after you adjust the JSON. Software reuses JSON from the ShowInfoCache directory if show file is younger than 24hrs old.

    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by 27InchSony; 2017-05-25 at 03:27 AM.

  2. #2
    Join Date
    Jul 2016
    Location
    USA
    Posts
    148
    This worked good for me. Thanks for sharing.

    I did get an error so I didn't know if it would work or not. It did import most of the files except the file in the error

    I think the error was the " ' "in the file name. s01e13.Wood's.Thirtieth.Reunion.avi

    That episode did not get imported.

    The error was:

    Code:
    Unknown problem: SQL logic error or missing database
    near "s": syntax error System.Data.SQLite    at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
       at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
       at System.Data.SQLite.SQLiteCommand.GetStatement(Int32 index)
       at System.Data.SQLite.SQLiteDataReader.NextResult()
       at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
       at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
       at System.Data.SQLite.SQLiteCommand.ExecuteScalar(CommandBehavior behavior)
       at VideoConduit.Core.DoesFileExistInNPVRDBAlready(String fullFilePath)
       at VideoConduit.Core.Go(String fileDirectoryToProcess)
       at VideoConduit.Form1.btnGo_Click(Object sender, EventArgs e)9/27/2016 4:08:17 AM	File: K:\Serviio\TV\Classic Sitcoms\Evening Shade\s01e13.Wood's.Thirtieth.Reunion.avi
    ~Paul

    Setup: NextPVR, Serviio, WinTV-quadHD and WinTV-HVR-955Q. Custom Roku channel developer. Feeding Tube Advocate. About me or http://chambers.pw.

    If you haven't broken it at least once, you're not doing it right.

  3. #3
    Join Date
    May 2009
    Location
    USA, West Michigan
    Posts
    9
    I just updated the original post with a new version. It cures the problem caused by my laziness by properly using a parameterized query when checking to see if the file exists in the DB.

  4. #4
    Join Date
    Jul 2016
    Location
    USA
    Posts
    148
    Quote Originally Posted by 27InchSony View Post
    I just updated the original post with a new version. It cures the problem caused by my laziness by properly using a parameterized query when checking to see if the file exists in the DB.
    Thank you. I really find this program useful. I am running 2 independent Nextpvr setups sharing Network Storage, I can merge both databases until I figure out how to setup 2 separate boxes with tuners and 1 NPVR server with client.
    ~Paul

    Setup: NextPVR, Serviio, WinTV-quadHD and WinTV-HVR-955Q. Custom Roku channel developer. Feeding Tube Advocate. About me or http://chambers.pw.

    If you haven't broken it at least once, you're not doing it right.

  5. #5
    Join Date
    Oct 2007
    Location
    Redmond, WA USA
    Posts
    132
    This program is superb - thank you so much! I have recordings going back to 2008 (longtime GBPVR/NPVR user). Over the years I've migrated several times, and this summer lost my whole setup. Thanks to you I now have a complete database, with episode information to boot! Really appreciate it -

    Cheers

    Dennis
    2 HD-PVRs, G4400 w/ 4GB RAM, 12 TB HD, Windows 10 Pro, 2 PCH A110, 1 eGreat m34A

  6. #6
    Join Date
    Jul 2016
    Location
    USA
    Posts
    148
    Still loving the App.

    I tried to import some movies I recorded through NPVR to no luck. I assume because they are not in TVDB.

    I was wondering if you plan on making a "MovieConduit" to search IMDB or one of the other movie db's for recorded movies?

    Really like the simplicity of this app though.
    ~Paul

    Setup: NextPVR, Serviio, WinTV-quadHD and WinTV-HVR-955Q. Custom Roku channel developer. Feeding Tube Advocate. About me or http://chambers.pw.

    If you haven't broken it at least once, you're not doing it right.

  7. #7
    Join Date
    May 2009
    Location
    USA, West Michigan
    Posts
    9

    No plans

    Great idea, but no plans at this point. Sorry!

  8. #8
    Join Date
    Nov 2016
    Location
    USA
    Posts
    6
    Great app! Just used it to restore the majority of entries lost by a crash.

    Two series gave me particular problems, and I had an idea for a minimally invasive fix.

    The series were "Marvel's Agents of S.H.I.E.L.D." and the series NextPVR records as "The Librarians", which TheTVDB knows as "The Librarians (2014)". The problem with the latter is obvious, and was solved by renaming the folder to "The Librarians (2014)". The other one was trickier; Windows doesn't allow folder names to end in a period, so there's no way to have the recordings in a folder that matches the name TheTVDB knows.

    What if the app asked to be pointed to a directory, but would accept as input a shortcut to a directory, with the title of the shortcut being the TheTVDB series ID for the series? For instance, if the app is pointed to a shortcut called "281709" pointing to the folder for "The Librarians", it knows that it's dealing with the series "The Librarians (2014)" even if that's not what the folder says.

  9. #9
    Join Date
    May 2009
    Location
    USA, West Michigan
    Posts
    9
    I just released v1.0.2. If you name the folder based on the thetvdb.com integer series id, VC will use the number to lookup the show. A shortcut to the folder will NOT work because windows resolved the shortcut to the real folder. Your real folder must be named the series id. Kinda think everything else still works, but I didn't do a whole lotta testing.

  10. #10
    Join Date
    Jul 2005
    Location
    HK - Pal I
    Posts
    3,229
    Thank you, don't know how I missed it before, but what a great idea!
    ASUS P5K-PRO Q9300 2.5GHz | Win10x64 | 6GB RAM | NVIDIA GEforce 210 | 1 x WinTV DMB-TH | Various HD's | AC68U | USB-UIRT | PCH-A110 | Hauppauge Colossus |
    If you've ever become frustrated because something in NextPVR is not working, take a moment and consider this and this and this and this and this and this. Credit where credit's due; for one guy (with a wife and two kids), most problems are solved outrageously quickly. Patience.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •