Old TV recordings not being automatically deleted
#1
I'm pretty new to MediaPortal as I have just migrated a old WMC setup to KOdi. But I now have a nicely working setup with Live TV (my primary goal) using MediaPortal TV Server as the live TV backend, and two Hauppauge Colossus cards to capture in HD from my two CTV boxes. Everything works just great, including channel switching via IR on my two CTV boxes.

But one minor problem has popped up. When recording a TV show through the Kodi frontend you have to option to spesify how long the recoring should be kept. I recorvd several newsflicks daily, and I've set them all to delete the recodring after 7 week. But that simply does not happen, Kodi does not delete any of my TV recordings.


Am I missing something here or is this a non-functional function?
Reply
#2
It is implemented. I just checked it in Kodi Krypton by adding a recording with a life time of 1 week. In the database, I see the correct keepData of "2017-01-06" and also the recording has a keepUntilDate of "2017-01-06" so I need more information to reproduce this.

Which version of Kodi, the TVServerKodi plugin and MediaPortal are you using?
How did you create the recording schedule with the limited life time?
Do you have the "Enable old series recording dialog" setting turned on?
Developer of the MediaPortal PVR addon and retired developer of the Argus-TV PVR-addon.
http://www.scintilla.utwente.nl/~marcelg/xbmc
Reply
#3
Thanks for the response. I'm running Kodi Jarvis 16.1 with MediaPortal PVR Client 1.13.6. MediaPortal TV server is version 1.15.

I usually set my recording schedule from the TV -> Guide -> Context Menu -> Add Timer, from there I just set "Lifetime" to what I prefer. Usually that is 7 days for daily recordings like news etc.

I do not have the "Enable old series recording dialog" setting on.

All in all my setup works just great, but the issue of recordings that won't be automatically deleted is most annoying as I have several daily recordings that I don't want to manually delete.

I would rather not upgrade to Kodi Krypton at this point as I don't want to risk other things breaking.

Any idea on what might be wrong or if I'm missing something obvious?
Reply
#4
Hmm, no idea. I would check the keepUntilDate field in the MySQL database "mptvdb" in the "recording" table.
I'm using the HeidiSQL tool for this to inspect the contents of my MediaPortal database.
Developer of the MediaPortal PVR addon and retired developer of the Argus-TV PVR-addon.
http://www.scintilla.utwente.nl/~marcelg/xbmc
Reply
#5
Installed HeidiSQL and on my MP computer and tried to open a connection to the same host on port 3306, username "root" and password "MediaPortal", which should be correct according to Google.'

But all I get from HeidiSQL is an error box with "Permission Denied", I'm kind of lost here, any idea?
Reply
#6
Upgraded to Kody 17 Krypton and this issue still presists, my old TV recordings does not get deleted according to the "keep until" I've set, nothing gets deleted at all.

Exactly how is this supposed to happen? Does anyone know anything about this?

It's super annoying ending up with hundreds of recordings that has to be deleted manually.
Reply
#7
(2017-02-18, 05:13)chjohans Wrote: Upgraded to Kody 17 Krypton and this issue still presists, my old TV recordings does not get deleted according to the "keep until" I've set, nothing gets deleted at all.

Exactly how is this supposed to happen? Does anyone know anything about this?

It's super annoying ending up with hundreds of recordings that has to be deleted manually.

It's up to your pvr backend to handle this. Which backend are you using?

EDIT: Mediaportal it is. You should ask the maintainer if the mp Kodi pvr client add-on, whether this a bug. The add-on can tell Kodi whether it supports this feature. If it does not, you will not see the respective controls in the timer settings dialog. So, either it is supposed to work and needs fixing or it is not ment to work, then the add-on maintainer needs to set the respective timer attributes flags correctly.
Reply
#8
Ok, will give that a try, thanks.
Reply
#9
Hmm the maintainer of this add-on has already responded above. Smile

margro, could you please give some more input on this? Exactly how is the deleting of old recordings supposed to happen?

Am I correct to assume that the Kodi PVR add-on only sets the "KeepUntilDate" field and leave it to the Mediaportal TV Server to delete the recording when that date is reached? I'm have MP 1 TV server version 1.10.0.0 installed and t TVServerKodi version 1.15.0.137. Since I posted I have also upgraded to Kodi Krypton.

I can't find any documentation in the MediaPortal docs regarding this, other than the "Quota" feature which just deletes old recordings (oldest first) when a there is less than X amount of diskspace left.

I managed to check KeepUntilDate in the MP database as you suggested and it appears that this is set correctlyh, but nothing is deleted. Almost all my recordings have a KeepUntilDate that has been passed already, but so far MP has not deleted anything. Do you know exactly how this is supposed to happen?

Also do you know the meaning of the values (1,2,3) in the KeepUntil field? I assume it's something like "Until space needed", "Until date reached" etc, but which value means what?


One thing tho, I seem to have changed the default password "MediaPortal" for root in the SQL database during installation, that was why I couldn't connect at first until I figured I had changed the password to my own "default password". Could this be contributing to the problem, eg is something depending on the default password "MediaPortal"? Sounds a bit odd but you never know.

Other than this my setup works perfectly, but recordings not being auto deleted is a major nuisance. So any input on this would be greatly appreciated!
Reply
#10
If you set a recording in MediaPortal from the EPG, once you've set the recording, the 'Keep until' button is enabled. This is using MP1. I don't use MP2.

The first thing I would do is set a recording in this way inside MediaPortal and see if it works.

At least then, you'll know if this is a Kodi problem.

Then you can check what is in the database for a recording set by MediaPortal and one set by Kodi, and see if they are different. The fact that you are having trouble connecting to the database seems to indicate a problem with your system.

How is it supposed to happen? When a recording gets to the 'keep until' date, it should be deleted.

Does this work? Dunno, never tried it. But since Kodi won't take an active role in deleting the recording, if it doesn't work it is a MediaPortal bug, not a Kodi bug.
Reply
#11
(2017-02-19, 00:54)chjohans Wrote: Am I correct to assume that the Kodi PVR add-on only sets the "KeepUntilDate" field and leave it to the Mediaportal TV Server to delete the recording when that date is reached? I'm have MP 1 TV server version 1.10.0.0 installed and t TVServerKodi version 1.15.0.137. Since I posted I have also upgraded to Kodi Krypton.
Correct. The PVR addon only sets the KeepUntilDate field and as far as I know, it is the backend that should delete it.

(2017-02-19, 00:54)chjohans Wrote: I can't find any documentation in the MediaPortal docs regarding this, other than the "Quota" feature which just deletes old recordings (oldest first) when a there is less than X amount of diskspace left.

I managed to check KeepUntilDate in the MP database as you suggested and it appears that this is set correctlyh, but nothing is deleted. Almost all my recordings have a KeepUntilDate that has been passed already, but so far MP has not deleted anything. Do you know exactly how this is supposed to happen?
Does it work as expected when using the MediaPortal frontend to add a schedule? I must admit that I don't know what the trigger is for the delete. I'm creating the schedules with a keep until date set like the MediaPortal front end does.

(2017-02-19, 00:54)chjohans Wrote: Also do you know the meaning of the values (1,2,3) in the KeepUntil field? I assume it's something like "Until space needed", "Until date reached" etc, but which value means what?
Correct:
Code:
UntilSpaceNeeded = 0,
  UntilWatched = 1,
  TillDate = 2,
  Always = 3

(2017-02-19, 00:54)chjohans Wrote: One thing tho, I seem to have changed the default password "MediaPortal" for root in the SQL database during installation, that was why I couldn't connect at first until I figured I had changed the password to my own "default password". Could this be contributing to the problem, eg is something depending on the default password "MediaPortal"? Sounds a bit odd but you never know.

Other than this my setup works perfectly, but recordings not being auto deleted is a major nuisance. So any input on this would be greatly appreciated!
I would not expect this to be the problem.
Developer of the MediaPortal PVR addon and retired developer of the Argus-TV PVR-addon.
http://www.scintilla.utwente.nl/~marcelg/xbmc
Reply
#12
(2017-02-19, 20:03)mcelliott Wrote: If you set a recording in MediaPortal from the EPG, once you've set the recording, the 'Keep until' button is enabled. This is using MP1. I don't use MP2.

The first thing I would do is set a recording in this way inside MediaPortal and see if it works.

At least then, you'll know if this is a Kodi problem.

Then you can check what is in the database for a recording set by MediaPortal and one set by Kodi, and see if they are different. The fact that you are having trouble connecting to the database seems to indicate a problem with your system.

How is it supposed to happen? When a recording gets to the 'keep until' date, it should be deleted.

Does this work? Dunno, never tried it. But since Kodi won't take an active role in deleting the recording, if it doesn't work it is a MediaPortal bug, not a Kodi bug.

Thanks, I have actually never used the MediaPortal front-end but I'll consider installing it just to try as you suggest. Thanks for the input, much apperciated!
Reply
#13
Thanks for your insight margro, much appreciated and it will be useful trying to track down the cause of this annoying issue.

I have actually never used the MediaPortal front-end, but I will install it and try if I have to.

But I just remembered that all my recording timers were actually created while on Kodi 16 Jarvis, so since I've now upgraded to Krypton I deleted and re-created all my recording timers. The keepUntil and KeepUntilDate looks correct in the database, both for the recording schedules and for the recordings. So I'll monitor and see the next few days if this changes anything, but I suspect it won't,

The only thing I can find in the MediaPortal docs regarding deleting old recordings has to do with Disk Quota and how MediaPortal wil automatically delete old recordings (oldest first it what it says) if a minimum configured disk space is reached. I have this enabled but I will never reach that minimum space as I have a huge share for TV recordings. So I delete more for "housekeeping" and tidyness rather than disk space. Anyhow it might just be that the docs is incomplete and that the delete mechanism is only triggered when the min space is reached, and that it's a bit more complicated than just "delete oldest first" (eg follow the keepUntil and KeepUntilDate flags), but this is purly speculation on my side.

I'll try to ask in the MediaPortal foum as well.

I'll update this thread with my findings.

Thanks again!
Reply
#14
I saw you posted on the MediaPortal forum and mm1352000 answered. He is the lead developer on the TV engine at the moment, so he knows best. He is also very helpful, so as long as you can reproduce the problem, he will be the best person to help.
Reply
#15
Thanks, that's great to know. With both margro and mm1352000 giving input on this I'm sure I'll get it resolved in the end.

So it has been establish that the TV server should automatically delete recordings according to the KeepUntil and KeepUntilDate flags.

One thing mm1352000 mentioned ober at the MP forim is that when KeepUntil=1=Watced then it's the responsibility of the *client* to delete that recording. Do you do this if this flag is set margro?

Another strange thing I noticed, which I also posted in the MP forum: I did notice one thing when I examined the mptvdb though. I created a "timer" to record my daily news, the schedule was created 2017-02-19 and I chose to keep the recordings for 7 days for that schedule.

When I examine the resulting recordings I notice that both the recording made on the 19th and the 21st have KeepUntilDate set to 2016-02-26, eg 7 days after the *recording shedule* was created but for the recording made on the 21st, only 5 days after the recording was made. This does not make sense to me, as I would expect this to be set to 7 days after the *recording* was made. But then again I don't know how the internals of this logic is working, so this might not be an issue.

Not sure who sets KeepUntilDate but if it's the client, then this might be something you want to look into margro. Maybe it should be KeepUntilDate from the "recording schedule" + 7 days? Not at all sure about this tho as again I don't know how the internal logic works here. But the way it is now each new recording will end up with KeepUntilDate set to a date that has already been passed once the number of days to keep the recordings that is specified when created has passed.

If nothing else works I'was thinking of writing a small program that examines the recordings in the database and deletes them (both the file and the DB entry for the recording) based on the values of KeepUntil and KeepUntilDate. But, because of the issue above KeepUntilDate is not strictly correct for the recordings in the database, so I would then have to find (in the DB) the schedule that the recording belongs to look at startTime and keepDate for that schedule, the actual KeepUntilDate for each recording would then be be:

startTime [from the recording] PLUS ( keepDate [from the schedule] MINUS startTime [from the shedule])

Do take note of the parenthesis in that equation, the brackets not included.

Based on this logic I would not be surprised if KeepUntilDate for the recordings are actually set wrong, unless the server does the above math every time it looks for recordings to delete. But that just doesn't make sense to me as I see no reason why not just adding the correct KeepUntilDate for each recording in the first place.

My logic might be warped here, so my apologies if it is, but it looks to me like this is correct.

margro, does any of this make sense?
Reply

Logout Mark Read Team Forum Stats Members Help
Old TV recordings not being automatically deleted0