LinHES Forums
http://forum.linhes.org/

manual database delete?
http://forum.linhes.org/viewtopic.php?f=6&t=6150
Page 1 of 5

Author:  badgers [ Thu Sep 22, 2005 5:19 pm ]
Post subject:  manual database delete?

I have a strange situation, Tripping the rift is shown as recorded but every time I have tried to delete it in mythfrontend has failed.
The box locked up right as it started to record the show. I think that is what is causing the problem.
Is it possible to open mysql and delete it manually? Is there a diagram of the database structure?

in the recorded table I see the show listed, but I am not sure what other tables are pointing at this record or if this is the best course of action.
thanks

Author:  Xsecrets [ Thu Sep 22, 2005 5:33 pm ]
Post subject: 

easiest way is to go to mythweb and see where the link is pointing. then go to the directory and see if that file exists (most likely not) if not then touch longfilename.nuv then go back and try to delete it should work at that point.

Author:  mjl [ Thu Sep 22, 2005 7:26 pm ]
Post subject: 

Hi,

I think I understand the problem.. some how in your web page of recorded show is displaying a show and you can't delete it, if you click on delete it stays?

If this is true, I find the easiest way to make things happy is to run mythlink.sh (may have to be root) mythlink.sh will complain about missing .nuv files and if you do a ls -al on the /myth/pretty/<missing-pretty-filename>.mpg it will then showw you the real file name.
simply copy the long string of numbers and paste
# echo " " > /myth/tv/paste the -lots of numbers here.nuv
this creates the missing file and now you may delete it.

Once in a while this seems to happen that the file is deleted however the database entry is not cleaned of that entry, (when it happens to me, my wife says I had a senior moment) forget to finish something because of a thousand reasons :)

Here are a couple links to maybe help you along.

Mike
Pretty script
http://mysettopbox.tv/phpBB2/viewtopic.php?t=4865&

Adding pretty
http://mysettopbox.tv/phpBB2/viewtopic.php?p=31031&

Author:  badgers [ Fri Sep 23, 2005 7:06 am ]
Post subject: 

Sorry it took me so long to get back, I was watching my shows :D

I don't have mythweb running...
I am not comfortable securing apache2 and I know it is a skill that I don't have so I never started it.

I issue
mysql -u mythtv -p

and then enter the password when prompted
USE mythconverg;
SELECT * FROM recorded;

this is where I can see the listing but the file doesn't exist.

MJL- I created a script and I made the directory(I used gentoo and I called the video directory mythtv, not myth.... and in mythtv all the videos I record are in the video directory and not the tv directory.

I have the mythlink.sh script in the contrib directory. could you post back whe mythlink.sh does? Since my install isn't standard I am afraid to run some script files.
thanks for your help, If I know what field in the recorded table has the file name is, maybe I could just get it and then create an empty file
for the frontend to delete.
thanks for your help.

Author:  badgers [ Fri Sep 23, 2005 7:33 am ]
Post subject: 

thanks I got it.
I looked at the mythlink script and I issued the
Select title,subtitle,chanid,starttime,endtime from recorded where title like 'Tripping%'
I got the list and the subtile told me which episode it was, I knew what I was looking for.
I took the chanid_starttime_endtime.nuv(removed the mysql formatting. and did the echo that you recommended now the file is there.
when I get home I will try the delete, thanks for your help and taking it step by step.

Author:  Xsecrets [ Fri Sep 23, 2005 8:45 am ]
Post subject: 

no problem you should be good now, once the file exist 0byte or not it should delete fine.

Author:  badgers [ Fri Sep 23, 2005 8:50 am ]
Post subject: 

do I need the .png file as well?

Author:  Greg Frost [ Fri Sep 23, 2005 4:06 pm ]
Post subject: 

no you dont need the png

Author:  mjl [ Fri Sep 23, 2005 7:42 pm ]
Post subject: 

Hi,

What would be nice is if a kind hearted perl guru would modify the pretty script and change the error trapping to just simply fix the missing file(s). Then it would be a transparent and totally forgotten issue. It does happen more frequently than you think also.

It would also fix a side issue that when mythlink.sh runs (manually have to set it up in crontab), that if it finds a missing .nuv it aborts doing the rest of the pretty names. So if there was an error, and you were to record several shows a day and then on the weekend go to review what was recorded, they won't be there, but really they are recorded.

Anyway, glad it helped.
Mike

Author:  Greg Frost [ Fri Sep 23, 2005 7:48 pm ]
Post subject: 

The reason it doesnt delete the thing from the database is that the recordings may be stored on a network share that is temporarily unavailable. Deleting it from the database in that case would be a bad thing. I think the latest version of myth prompts you to ask if you still want to delete it when the file is not there.

If mythlink has a problem with this it is mythlink that should be fixed.

Author:  mjl [ Fri Sep 23, 2005 8:19 pm ]
Post subject: 

Hi Greg Frost,

A totally valid point,
Quote:
stored on a network share
and I have to agree. My system is a simple one machine frontend / backend so for this situation it is desired to fix a missing file. I have found that over a period of time an occasonal .nuv is gone however still hangs in the db. With R5A16 you must have the correct.nuv before it will be cleared.

Maybe make it an optional mythlink.sh tweak, fix or no fix, just add a #. Either way, I would love to see it fix the missing file and resume however, just to skip the missing file and resume would be great also and still work for the network share. I just don't have the perl skill to make that tweak.

Thanks for the different perspective!
Mike

Author:  marc.aronson [ Sat Sep 24, 2005 8:49 am ]
Post subject: 

In the mythlink file look for a line of code that looks like this:

Code:
      if (!-s "$altpath/$nfn".".mpg"){
                  #  print "Creating $altpath/$nfn\n";
                  symlink "$mythpath/$ofn", "$altpath/$nfn".".mpg" or die "Failed to create symlink $altpath/$nfn".".mpg".": $!";


Change the "if" statement so that it looks like this:

Code:
if ((!-s "$altpath/$nfn".".mpg") && (-e "$mythpath/$ofn")) {


Warnings: This code change is untested; I have not done a lot of perl programming in my lifetime; I answered this question after finishing my second glass of wine.

Having said all that, I would give this a try...

Marc

Author:  mjl [ Sun Oct 02, 2005 5:33 pm ]
Post subject: 

Hi marc.aronson,
I was hoping to say, "have one more to celibrate" however the syntax isn't quite correct :(

root@mythtv-20:/myth/tools# /usr/local/bin/mythlink.sh
Missing files...
Skipping /myth/tv/1101_20050921231800_20050921232300.nuv
Skipping /myth/tv/1101_20050921235100_20050922000000.nuv
Skipping /myth/tv/1010_20050921020500_20050921030400.nuv
Skipping /myth/tv/1102_20050922233000_20050922234500.nuv
These files are valid
Argument "1101_20050927233500_20050927233800.nuv" isn't numeric in division (/) at -e line 41, <> line 8.
Argument "/myth/tv" isn't numeric in division (/) at -e line 41, <> line 8.
Argument "1643_20050929231800_20050929232800.nuv" isn't numeric in division (/) at -e line 41, <> line 9.
Argument "2010_20050930222500_20050930225400.nuv" isn't numeric in division (/) at -e line 41, <> line 10.
Argument "2010_20051001200200_20051001210000.nuv" isn't numeric in division (/) at -e line 41, <> line 11.
Argument "2010_20051001210000_20051001220000.nuv" isn't numeric in division (/) at -e line 41, <> line 12.
Did not create the missing files
Manually
echo " " > /myth/tv/1101_20050921231800_20050921232300.nuv
root@mythtv-20:/myth/tools# /usr/local/bin/mythlink.sh
Argument "1101_20050921231800_20050921232300.nuv" isn't numeric in division (/) at -e line 41, <> line 2.

Any adjustments I can make?
Thanks
Mike

Author:  marc.aronson [ Sun Oct 02, 2005 8:54 pm ]
Post subject: 

Mike:

Whoops -- my mistake. I forgot to put quotes around the $mythpath/$ofn construct. I've edited my original post and corrected it, so if you use what's there now, it should work. Now that I'm back home I was able to run a test. I was able to reproduce the problem you encountered, and make the problem go away with the added quotes.

Marc

Author:  mjl [ Sun Oct 02, 2005 9:18 pm ]
Post subject: 

Hi Marc,

Can't celebrate quite yet, but looks better!

root@mythtv-20:/myth/tools# /usr/local/bin/mythlink.sh
The next trick is to make it create the files instead of skipping them.
Skipping /myth/tv/1101_20050921235100_20050922000000.nuv
Skipping /myth/tv/1010_20050921020500_20050921030400.nuv
Skipping /myth/tv/1102_20050922233000_20050922234500.nuv
Failed to create symlink
Also would like to get rid of the double stamp..
/myth/pretty/The_Tonight_Show_With_Jay_Leno-Sep27_2005_2335_2005_2335.mpg: File exists at -e line 45, <> line 7.

Other files exsist, what makes it complain about this one?
The_Tonight_Show_With_Jay_Leno-Sep27_2005_2335_2005_2335.mpg -> /myth/tv/1101_20050927233500_20050928003700.nuv

I really appreciate the help. Once it works properly, it will mean that on a frontend/backend system, if there is a dead wood, you will have no issue deleting it.

Mike

Page 1 of 5 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/