[mythtv-users] mythtv database and video file clean up

Stephen Shelton stephen at stephenashelton.com
Sat Aug 15 17:54:32 UTC 2009


I've got a slight mess on my hands for several reasons:

1) Many video files no longer exist. not sure how I've managed that, but it's 
the case.

2) Many files are duplicate. I have a script that transcodes video, and then
moves it to "some_dir/<title> - <subtitle>". Whenever title & subtitle fails to
be unique, I end up overwriting that file.

3) Many video files exist on disk, but are not referenced in the database.

4) Many preview images have not been cleaned up, and many do not exist where
they should.

I'd like to clean this up. 

First off, is anyone familiar with a script (etc) to accomplish this? 

Second, I'm a little scared of / intimidated by / untrusting of the schema 
documentation out there. I have no problem writing such a script myself, but 
the last thing I want is to compound the problem by dirtying my database. Can 
anyone either point me in the direction for relevant documentation for my
mythtv version (listed below), or explain exactly what tables I need to touch
to do this?

Basically I need to go through each recorded show in the database, make sure it
(a) exists and (b) is unique, and delete otherwise. Then go through each file
on my filesystem, and make sure it exists in the database, and if not, delete
it.

My mythbackend version:

mythbackend --version
Please include all output in bug reports.
MythTV Version   : 19961
MythTV Branch    : branches/release-0-21-fixes
Library API      : 0.21.20080304-1
Network Protocol : 40
Options compiled in: 
 linux profile using_oss using_alsa using_backend using_dbox2 using_dvb using_frontend
 using_hdhomerun using_iptv using_ivtv using_joystick_menu using_lirc using_opengl_vsync using_v4l
 using_x11 using_xrandr using_xv using_xvmc using_xvmcw using_glx_proc_addr_arb using_bindings_perl
 using_bindings_python using_opengl using_ffmpeg_threads using_live

Thanks much!

-- 
Stephen Shelton
stephen at stephenashelton.com
http://www.stephenashelton.com/


More information about the mythtv-users mailing list