[mythtv-users] Lossless Cut and removing recordings

Doug Vaughan r.d.vaughan at rogers.com
Fri Nov 9 16:09:40 UTC 2012


Stephen,
     During testing I saw something odd with this functionality but 
after a discussion with the dev who supports the python bindings, put it 
down to bad test data as I get that data from different MythTV versions. 
Here is a test I would like you to try. This functionality works under 
MythTV v0.25 as I use it all the time. You made a great suggestion:)

With your additional comments I think there may be a v0.26 bug in either 
the backend or the bindings. The data times never come into play as I 
only use the python bindings to do the deletionand the bindings just 
tell the backend to delete the recording.

Here is what I would like you to try as you have a clean MythTV v0.26 
environment. First find a recording you no longer care about and copy to 
the clipboard the file name plus extension. Youdo not want to include 
the file path. In the lines below replace the string 
"your_recorded_filename.mpg" with the recording file name you copied to 
the clipboard. There are two instances of that name. Then copy all of 
step one and paste into a terminal session.

Step 1:

python
from MythTV import MythDB, MythBE, Recorded
db = MythDB()
be = MythBE(backend=db.gethostname(), db=db)
recorded_list = 
list(db.searchRecorded(basename="your_recorded_filename.mpg"))
recorded_list
recorded = recorded_list[0]
recorded
program = 
be.getRecording(chanid=recorded.chanid,starttime=recorded.starttime)
program
result = be.deleteRecording(program, force=True)
print 'The result should = "-1" which means success. Result(%s)' % result


Step 2:
Wait a couple of minutes to let the backend do its work then cut and 
paste the following statements into your terminal session:

recorded_list = 
list(db.searchRecorded(basename="your_recorded_filename.mpg"))
recorded_list
print 'The recorded_list should be empty if deletion worked. 
Recorded_list: "%s"' % recorded_list


Hit ctrl-D to exit the python session. Check the database and the 
recorded record for that program and recorded video file should be 
deleted. Also check the backend log to see if there were any error 
messages about the delete. I thought I saw some logged messages during 
testingbut disregarded them as they did not occur during a second test.


Here is what happens with a MythTV v0.25 successful deletion. This is 
also what it should look like with v0.26:
 > python
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> from MythTV import MythDB, MythBE, Recorded
 >>> db = MythDB()
 >>> be = MythBE(backend=db.gethostname(), db=db)
 >>> recorded_list = 
list(db.searchRecorded(basename="2559_20121108170000.mpg"))
 >>> recorded_list
[<Recorded 'Sons of Anarchy','2012-11-08 17:00:00' at 0x1cf1890>]
 >>> recorded = recorded_list[0]
 >>> recorded
<Recorded 'Sons of Anarchy','2012-11-08 17:00:00' at 0x1cf1890>
 >>> program = 
be.getRecording(chanid=recorded.chanid,starttime=recorded.starttime)
 >>> program
<Program 'Sons of Anarchy','2012-11-08 17:00:00' at 0x1ce95c0>
 >>> result = be.deleteRecording(program, force=True)
 >>> print 'The result should = "-1" which means success. Result(%s)' % 
result
The result should = "-1" which means success. Result(-1)
 >>>
 >>> recorded_list = 
list(db.searchRecorded(basename="2559_20121108170000.mpg"))
 >>> recorded_list
[]
 >>> print 'The recorded_list should be empty if deletion worked. 
Recorded_list: "%s"' % recorded_list
The recorded_list should be empty if deletion worked. Recorded_list: "[]"
 >>>

If this does not work for you please tell me and I will talk to the 
bindings developer and/or create a ticket. If you had any backend error 
messages please email them in your reply.

Thanks

Doug


More information about the mythtv-users mailing list