Kodi Community Forum

Full Version: Recorded TV gone after reinstall
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Last weekend I had to reinstall my HTPC containing my tuners. I have reinstalled DVBLogic as well. Live TV is working on my Kodi clients. However, my Recorded TV is gone. I do still see the files when I go there using Windows Explorer, but in Kodi I don't see any recordings.
Next to that I have put some other files in my recorded tv folder; is it possible to have those show up as Recorded TV as well?
You will have lost the database during the reinstall. If you check the DVBLogic forum there is a post there about recovery but from memory it isn't easy.

If you post on the DVBLogic forum, Oberon or the_man will usually respond.
Yes, the database is lost. Perhaps I should back that up first as well. Why isn't that done during the creation of a backup of DVBLogic?

I have posted on the DVBLogic forum. Oberon gave me some pointers (as he always does!) and I figured out a way to manipulate the recordings database using SQLite 2009 Pro. That way I cannot only restore the recorded items database, but I can also add files recorded with my Humax PVR and even my .wtv Windows Media Center recordings! This really works great!

Few hickups still with Kodi, but I will figure out how to get that done as well. Then move to Kodi 15 and install DVBLink server and components version 5.1 and I should be good for the coming years Smile
Plantje, could you please publish a 'How to' for updating the DVBlink recorded TV database?

I am in the same situation as you, moving from WMC and having to reinstall DVBLink just to find an emtpy recording list.
On a side note: my last DVBLink server install from one 5.5.0 build to another actually kept the recordings, but the Timer list was emptied. (sigh)

How technical are you? Are you comfortable working with tooling like Access? Then you will most likely be able to work your way around in SQLite 2009 Pro. Unfortunately currently I am very busy at work so I hope I will be able to write up something (including some screen shots perhaps) today or tomorrow.

Just let me know how technical I can get Smile
I'm an IT professional so bring it on Smile
I also consider Google a close friend...

Perfect! I am not an expert at all, but I have fiddled around with it somewhat.

First you go to http://sqlite2009pro.azurewebsites.net/ and download SQLite2009 Pro. It's freeware and you can make a donation if you like it. I think it is just a VB6 project.

Then you go to your DVB installation and look for the "dlrecorder.db" file which is typically in "\\[Machine]\Users\Public\Documents\DVBLink" (I opened it from a share). Make sure you first start working in a copy of the file and backup the original before placing the copy in the aforementioned location. Double click it and you will see SQLite2009 Pro opens it.

Open the table "completed_recording" by single clicking it in the tree on the left. Go to "Table Data". This should tell you a lot!

I don't know everything by heart anymore, but this is what it comes down to: add a new line just by right clicking and click "insert" and fill out as much as possible about a .wtv file. Just take the next id, with regards to the schedule_id I had a hard time figuring out what it means, but I believe you need to have a value there. The state should be 1 I guess. For the filename just enter the entire path including the full file name and extension. It is ok to keep the .wtv extension. From the .wtv file you can extract the channel_num, channel_name, name. You can think of a short_desc if needed. The start_time comes from the .wtv file as well and to calculate you can use the following code:
Sub test()
Dim dblStart_Time As Double
Dim dteNulpunt As Date
Dim dteAndereDatum As Date
Dim dblVerschil As Double
Dim dteStartTijdOpname As Date
Dim dteStartTijdOpname2 As Date

dblStart_Time = 1433347942
dteNulpunt = CDate("1-1-1970 00:00:00")
dteAndereDatum = CDate("3-6-2015 18:12:22")
dteStartTijdOpname = DateAdd("s", dblStart_Time, dteNulpunt)
dteStartTijdOpname = DateAdd("h", 2, dteStartTijdOpname)
dteStartTijdOpname2 = DateAdd("s", dblStart_Time + 7200, dteNulpunt) '2 hours need to be added and this can be done in two ways
dblVerschil = (DateDiff("s", dteNulpunt, dteAndereDatum)) - 7200 'You can use this to go from a date time to the value that needs to be inserted. The rest of the code was just some playing around
Debug.Print dteStartTijdOpname Debug.Print dteStartTijdOpname2 Debug.Print dblVerschil
End Sub

You can run this in Excel using VBA or something.

The duration is in seconds I guess. A lot of other stuff can remain 0's

If you have been able to enter some of these new lines you can backup your original dlrecorder.db and put this file instead of it. Kodi (and DVBLink for that matter) should now pick up the newly entered recording and it works exactly the same as the DVBLink recordings. If you figured that out it is easy-peasy to write a script to pick up all .wtv files, read them and write an insert statement for it. You can run those in SQLite 2009 Pro as well.

On a related matter I have found myself not doing this anymore at all! All the .wtv files that I really wanted to keep were movies. In order to get those way better in Kodi there is a very easy way! Put the .wtv file in the directory that you have appointed as your videos directory that will be scraped by Kodi then from the filename that is for example "Pirates of the Caribbean- The curse of the Black Pearl_SBS 6_2011_01_07_20_26_43.wtv" throw away all the "useless" data. Only "Pirates of the Caribbean- The curse of the Black Pearl.wtv" should remain. Have Kodi recheck the library and you will see it end up as a movie. Do you still need it in your "Recorded TV" list then? I don't!

Hope this quick start is of use for you. If you need more information please point that out. I am willing to provide more information, but you should be good now! Smile