ofcourse 
Ill just run a "format e:\" drive.
looking at the code we delete all files with the same name as the recording itself.
eg. myrecording.ts
it will then try and delete :
myrecording.jpg (thumb)
myrecording.xml (meta data)
it then queries folder containing the ts file.
does it anymore contain files ?
does it anymore contain subfolders ?
if no, then it tries do delete the folder.
So the code should handle it.
We could have a situation where we are unable to delete one or more of the files (due to file locks etc).
The delete-folder process then fails and never retries again. The user has to manually seek out those folders and delete them themselves.
how to handle this ?
1) Create a monitoring thread "recording cleanup" which has some public array/list where the failedrecording method is able to notify the thread, simply by inserting a recording object into this array. the monitor thread picks this up, and retries the process each 1 min. or so.. once properly deleted it will remove the recording from the array and cease any further actions.
cons: if you restart tvservice, it will be upon start of the service unaware of these failed-2-delete folders.
2) On tvservice start a method call will take care of the orphaned folders and delete those.
3) 1+2 (as combination.)
Using some SQL table to store this information seems overkill to me.
/gibman
Ill just run a "format e:\" drive.
looking at the code we delete all files with the same name as the recording itself.
eg. myrecording.ts
it will then try and delete :
myrecording.jpg (thumb)
myrecording.xml (meta data)
it then queries folder containing the ts file.
does it anymore contain files ?
does it anymore contain subfolders ?
if no, then it tries do delete the folder.
So the code should handle it.
We could have a situation where we are unable to delete one or more of the files (due to file locks etc).
The delete-folder process then fails and never retries again. The user has to manually seek out those folders and delete them themselves.
how to handle this ?
1) Create a monitoring thread "recording cleanup" which has some public array/list where the failedrecording method is able to notify the thread, simply by inserting a recording object into this array. the monitor thread picks this up, and retries the process each 1 min. or so.. once properly deleted it will remove the recording from the array and cease any further actions.
cons: if you restart tvservice, it will be upon start of the service unaware of these failed-2-delete folders.
2) On tvservice start a method call will take care of the orphaned folders and delete those.
3) 1+2 (as combination.)
Using some SQL table to store this information seems overkill to me.
/gibman
Just please be careful, it is much better to have few left over folders than some non-empty folders getting removed (we have had that at some point in the past).
Ethiopia