[mythtv-users] Cleaning up orphan database records

Michael T. Dean mtdean at thirdcontact.com
Thu Apr 19 17:46:21 UTC 2007


On 04/19/2007 01:34 PM, Astie, Sebastien wrote:
> If you read carefully, he doesn't have the files in his filesystem.
> References to files not in his filesystem are in the database.
> So this is not really about orphan files but orphan references in his
> DB.
> <quote>
> I have about 35 records in the database pointing to old LiveTV
> recordings that no longer exist on disk.
> </quote>
>   

I saw that.  However, you said:

> I wanted to delete all my items in the LiveTV group.
> In order to do so, you can login in MySQL and do 
> DELETE from record where group = 'LiveTV';

And, even if you had manually deleted the files (which you should 
/never/ do), you still left a bunch of orphan records...

> I used that because mythtv didn't clean those references, even after
> going through the process of selecting the livetv group and choosing to
> delete each file within the frontend.
>
> I know that you are trying to help, but attacking people because you
> haven't read carefully is unjustified.
>   

Still telling people to use Myth incorrectly is not the right solution.  
If part of Myth is not working properly, please post a question about 
it--i.e. "Why won't Myth let me delete a record for a recording whose 
file is missing?"--and we will work with you to find out what's 
happening, and--if necessary--fix Myth so it works for everyone.

My personal opinion:  if you want to use Myth incorrectly and you want 
to mess with its files and its data, that's your prerogative (and you 
can live with the consequences).  However, please don't encourage others 
to do so.  After all, do you really want to take responsibility for a 
user who breaks his/her database after executing the SQL commands you 
post?  This is especially possible when you're posting untested SQL from 
memory.

Leaving quoted message so you can verify I didn't change any of your 
words...

Mike

> -----Original Message-----
> From: mythtv-users-bounces at mythtv.org
> [mailto:mythtv-users-bounces at mythtv.org] On Behalf Of Michael T. Dean
> Sent: Thursday, April 19, 2007 1:25 PM
> To: Discussion about mythtv
> Subject: Re: [mythtv-users] Cleaning up orphan database records
>
> On 04/19/2007 12:40 PM, Astie, Sebastien wrote:
>   
>> I had the same issue.
>>
>> I wanted to delete all my items in the LiveTV group.
>> In order to do so, you can login in MySQL and do 
>> DELETE from record where group = 'LiveTV';
>>   
>>     
>
> And people wonder how they get orphaned records/orphaned files...
>
>   
>> If I remember correctly that this is the appropriate table and column
>> name.
>>   
>>     
>
> Nope.
>
> Besides, if you used, "the appropriate table and column" you would have 
> orphan files.  And, if you delete the files and the data from "the 
> appropriate table and column", you're still leaving orphaned records 
> (potentially > 7200 per hour of recording) in various other tables.
>
> So, let Myth clean it up for you.  The LiveTV recordings are expired in 
> one day (by default, so you'd have to explicitly make them last longer),
>
> so don't worry about them.  They'll go away on their own.
>
> If you're impatient and you can't wait 'til tomorrow, go into Watch 
> Recordings or Delete Recordings and change the recording group to 
> LiveTV, then while on the left hand side, use the menu button to add all
>
> the shows to the playlist, then Menu|Playlist Options|Delete to delete 
> them all.
>
> This approach--letting Myth delete the recordings--will delete the 
> files, the recording information, the markup information, the seektable 
> information, etc.  Any other approach is flat out wrong.
>
> These "magical" scripts are a last resort that should not be required.
>
> Mike
>   

But deleting list sigs and "Notice for Sales & Trading Communication" 
garbage...


More information about the mythtv-users mailing list