Project

General

Profile

Advice from other users - how do you deal with recorded TV in Kodi?

Added by A L over 6 years ago

I am still trying to get Kodi and TVHeadend perfectly set up and would be grateful to know what everyone else is doing.

Here is my issue:

I use TVHeadend (with Schedules Direct) to record to a large folder, on my server, containing all my TV Shows.

I use the TVH PVR add-on to watch live TV only, but not for watching recordings, for a couple of reasons:

1. The folder seems to be missing season and episode information and

2. Only recordings that have been made, since my last install of TVH, are listed.

Because of this, I tried linking the folder to Kodi as a TV source. However, I then started to note that some shows would appear missing if they were not as specified according to the TVDB.

I have now come round to adding the recording folder as an unspecified source in Kodi, which seems to have sorted things out, but for two new problems:

1. The parent folder does not receive a watched tick when all the files inside have been marked as watched and

2. I don't get any information about the shows (all I get is the file name).

I was just wondering what other users on here do about keeping everything organised/accessible on their systems.

One specific thing - when recordings are viewed via the PVR add-on, I get all the information that was provided via Schedules Direct. Where is this information kept and is there any way I can link it to the file when watching the video via Kodi's file mode?


Replies (3)

RE: Advice from other users - how do you deal with recorded TV in Kodi? - Added by Robert Cameron over 6 years ago

I believe it was you to whom I just replied in Kodi's forum. There you were not specific as to your reasons for not using the PVR client, but here you are.

As to 1, season/episode information was previously not implemented. It required both an update to Kodi's PVR client as well as an update to Tvheadend (as previously this information was not available over HTSP). If you are using Tvheadend 4.3, and Kodi 18, then you will receive season/episode information for your recordings. Earlier combinations, however, do not have the combination of features necessary to support this.

For 2, it sounds as if you updated your Tvheadend install, but did not properly migrate your recorded shows. In Tvheadend each recorded program is read from a file (a separate file for each recording) at program startup. To get your old recordings into a new install, replicate the file format for an existing recording for each of the old recordings you want to have imported. (There are also several threads in this forum about achieving this, too.)

If you are still determined to use your recordings outside of the PVR client, there are two options.

1. Name your recorded files according to Kodi's conventions so its TVDB scraper will pick them up. The best I have found is to use $t/$t$-e$-s$n.$x as your format string. (Note, this will only apply to new recordings, not existing ones.)

2. Use a post-recording script to generate NFO files for Kodi. However, if you haven't figured out how to import your old recordings into Tvheadend, this option may be more difficult for you as you will need to query Tvheadend for the recording details, and then write that to an XML file. In addition, Kodi requires one file for the series itself, and a separate file for each episode individually. This option can be used for past recordings, but you need to manually provide the data yourself.

As to where the metadata for recordings are stored: see explanation for reason 2 regarding your old recordings. Each recording has an associated JSON-formatted that includes all of the recording's metadata, including the filename. It is generated at recording-time, and the files are read into Tvheadend at startup. These files act as the persistent storage for the recording database.

RE: Advice from other users - how do you deal with recorded TV in Kodi? - Added by A L over 6 years ago

Thanks Robert - as always, a really clear and concise response from you:) . I did indeed start a similar thread on the Kodi forum (thanks, also, for replying there).

It is really encouraging that Season and Episode information is being implemented for TVH 4.3 and Kodi 18 - this was a bit of a deal-breaker thing for me, but I can certainly live with it for the time-being until I upgrade.

In hindsight, I realise that viewing recordings by any other way than via the PVR client is more than hassle than it is perhaps worth, so I am going to stick with that method.

In practice, how difficult/time-consuming is it to try and import old recordings? As you say, there are a few threads on here about it and it seems pretty complex - I am still a bit of a Linux beginner so do you think it is worth avoiding it and just putting all the older stuff in a separate folder as a TV source?

RE: Advice from other users - how do you deal with recorded TV in Kodi? - Added by K Shea over 6 years ago

Robert knows a lot about Tvheadend, he just can't seem to write it down in any manner that is remotely discernible to ordinary humans. Everything he wrote would probably make perfect sense to a Tvheadend developer, but I'm not one and I'm guessing neither are you.

But the important part of what he said was this: "To get your old recordings into a new install, replicate the file format for an existing recording for each of the old recordings you want to have imported. (There are also several threads in this forum about achieving this, too.)"

One way to do this is to go to the Digital Video Recorders tab and then the Timers tab, and create a new timer that is one minute long, with the start time a couple minutes from the current time and the end time one minute after that. The channel doesn't matter as long as it's one you can receive reliably, and of course you would fill out the title the way you want it to appear in the recordings list. Save the timer and wait for it to record one minute (plus any padding you have specified in your recording profile) of the show. You now have a dummy recording and you can delete the timer you just created, or you can (optionally) change the title and the start and end times to create another. Create as many dummy recordings as you need using this method.

Now the secret of making this work is that you have to MOVE, not copy, the new recordings over the dummy recordings. The reason is that if Tvheadend senses that a recording has vanished for even a millisecond, it "forgets" about that recording, and when you copy an existing file over the dummy recording (after you have renamed it to be the same name as the dummy recording) the operating system first deletes the existing file and then copies the new one into its place. Although this is less than the blink of an eye for a human, in computer terms it's long enough for Tvheadend to sense the file is gone and remove it from its internal recordings list. When you move one file over another, though, you aren't making a copy so it happens much faster and Tvheadend won't remove the file.

I use Midnight Commander (install it using sudo apt install mc) to do all my file renaming and moving, it makes it easier and you are less likely to do something dumb like move a file in the wrong direction. The first few times you do this, I would back up any files you are going to attempt to move, until you have the hang of it, just as insurance in case you somehow manage to erase or corrupt the original files. Warning, the FIRST time you run mc after installing it, do it as a user (do NOT do sudo mc on the first run), otherwise you will never be able to use mc as anything but root.

    (1-3/3)