Delete Database item

Got an idea, post it here

Delete Database item

Postby lar282 on Wed Dec 27, 2006 10:43 am

I want to be able to delete a database item from within XL. Or even better, when I delete a movie from the hardrive the item in the datasbe should be deleted.


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby m_ski on Tue Jan 02, 2007 12:38 pm

Lasse, there is a built in command to delete a database item. Steven uses it in the default skin on the musicviewer overlay.
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby lar282 on Tue Jan 02, 2007 12:47 pm

thanks for the tip
I must be blind cause I couldn't find it. Can u give me a hint where the command is?
categorie
xlobby??


regards

//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby tswhite70 on Wed Jan 03, 2007 4:14 pm

I think it's OS:Delete which physically deletes the item based on Parameter value from the hard drive. There's an optional Category for the command. I've never used the command though so I'm not sure if you have to do a category refresh to see the change.

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby Atlas on Thu Jan 04, 2007 3:56 am

I use this function for my HD recordings. You are correct in using OS:Delete and put in the category name. It will delete the database item and the file. Since you are wanting to delete the movie you will need a script to "clean up" the rest. If you have IFO files it will only delete your video_ts.ifo file. If it is .iso then you are probably fine with just the OS:delete.

In my event I use the OS:delete then OS:execute to execute a batch file. I pass in info from the category for it to clean up the rest of the directory(ies).
Atlas
 
Posts: 134
Joined: Wed Apr 14, 2004 3:43 am
Location: McKinney, TX

Postby lar282 on Thu Jan 04, 2007 7:40 am

Atlas wrote:I use this function for my HD recordings. You are correct in using OS:Delete and put in the category name. It will delete the database item and the file. Since you are wanting to delete the movie you will need a script to "clean up" the rest. If you have IFO files it will only delete your video_ts.ifo file. If it is .iso then you are probably fine with just the OS:delete.

In my event I use the OS:delete then OS:execute to execute a batch file. I pass in info from the category for it to clean up the rest of the directory(ies).


thanks u all.
Atlas:
U willing to share the script that cleans up folder an files?


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

noop

Postby lar282 on Thu Jan 04, 2007 10:26 am

I looked at my command and I actually had a categorie set already. In my case it is movies2. Still the categorie entry does not get deleted.
Are u sure your still works with the latest EXE

Image


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby lar282 on Mon Jan 15, 2007 1:01 pm

bump
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby Atlas on Mon Jan 29, 2007 12:42 am

Haven't been around the forum for awhile.

I took a closer look and I too have a problem deleting w/o a refresh for a single item. I use it on tv shows and my directory looks like

show1/episode1.tp
/episode2.tp
/episode3.tp
show2/episode1.tp
etc.


Now when I delete an episode it disappears from the database (I only see remaining entries) but when I delete the last episode the "show" level stays in the db. It will only disappear when I do 'refresh'. This is probably how your movies are behaving.

My order for the event is

OS::execute file-- File: delrec.bat Arguments "%myHDcat>name%" "%myHDcat>episode%" Window Type: hidden
OS::delete -- Category: myHDcat

Then my bat file is straight forward

del D:\pvr\%1\%2_*.tp

Note that I just do a _* since the OS::delete took care of deleting the main file that is recognized as a db item (determined by my metamasks).

You could just have an event for delete that executes a batch file to delete the directory and then a refresh. This might not be good based on how big your movie collection is.
Atlas
 
Posts: 134
Joined: Wed Apr 14, 2004 3:43 am
Location: McKinney, TX