[mythtv] Patch to DO deletion when file doesn't exit
kuphal at dls.net
Wed Feb 16 22:30:54 UTC 2005
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> The current behaviour appears to be if the file of a recording doesn't
> exist then the backend will refuse to remove the data from the database.
> I can't see any sense in this, what else would you want to do with
> useless metadata?
> How else do I get rid of these darn empty programs?
> Patch attched leaves the "file didn't exist" warning in, but now removes
> the metadata too.
> It's trivial, but hasn't been tested more than once
This behavior was changed, and explained, multiple times. If you use a
mounted filesystem, as most people do, and your drive was not mounted
for some reason, the auto-expire code would see your mountpoint as the
empty directory it is on your main root drive. If your root drive is
small, as many are, the auto-expire would kick in seeing the lack of
disk space and start deleting programs. Since the physical files didn't
exist, it would fail but the metadata would be deleted. This would
repeat as the free space would not be increasing (no files actually
deleted) until your entire database was wiped of metadata. The behavior
now prevents this from occuring which is highly desired over an empty
database (which I encountered).
If you'd like, submit a patch that corrects the behavior on the
*recording* side that results in metadata without a physical file either
by not inserting data for a recording that never started or, perhaps a
better end user method, leave a zero byte file or a recording that says
"no program recorded" so the user is aware of the problem.
You can get rid of your files (as has been posted numerous times on the
-users list and here) by using the "touch" command to create a zero byte
file of the filename that is missing and the system will happily delete it.
More information about the mythtv-dev