Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £129! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £179! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

[ET10x00] Recording Directory Deletion Issue 2

EMJB

Forum Supporter
Donated Member
Joined
Dec 21, 2014
Messages
168
Reaction score
2
Points
0
In the main MovieList, it is a list of recordings that is being shown, but when you want to delete a directory the "are you sure" message lists the number of files which will normally be much larger. Hence, for example, a directory being shown a having 4 recordings may well appear as having 16 or more files in the deletion "are you sure" message. Technically correct, but confusing for the technophobe.

As a partial fix, at around line 1973 on MovieSelection.py, I have changed:

if os.path.isdir(ffn):
subdirs += 1
else:
files += 1
if files or subdirs:
folder_filename = os.path.split(os.path.split(name)[0])[1]
mbox=self.session.openWithCallback(self.delete, MessageBox, _("'%s' contains %d file(s) and %d sub-directories.\n") % (folder_filename,files,subdirs) + are_you_sure)

to read:

if os.path.isdir(ffn):
subdirs += 1
else:
if ffn.endswith(".ts"): # New condition to only count recordings
files += 1
if files or subdirs:
folder_filename = os.path.split(os.path.split(name)[0])[1]
mbox=self.session.openWithCallback(self.delete, MessageBox, _("'%s' contains %d recording(s) and %d sub-directories.\n") % (folder_filename,files,subdirs) + are_you_sure)

but this will only work for enigma recordings, and presumably the "if ffn.endswith(".ts"):" statement should be replaced by something like:

fileName, fileExtension = os.path.splitext(ffn)
if fileExtension in KNOWN_EXTENSIONS:

with KNOWN_EXTENSIONS being as defined in MovieList.py.
 
Hi
I think the replies to the OP are terrible. The OP posted a perfectly valid issue and it deserves a better response. If readers have no interest, then it is far easier to just ignore than to bother to type a useless reply.
 
Here's an (untested) patch to ignore all known meta-files.

Code:
--- MovieSelection.py.orig      2016-04-05 00:57:34.904491466 +0100
+++ MovieSelection.py   2016-04-05 01:06:26.087547199 +0100
@@ -1972,10 +1972,16 @@
                                                if os.path.isdir(ffn):
                                                        subdirs += 1
                                                else:
-                                                       files += 1
+                                                       ignore = False
+                                                       for known in ("eit", "ts.ap", "ts.cuts", "ts.meta", "ts.sc"):
+                                                               if ffn.endswith(known):
+                                                                       ignore = True
+                                                                       break
+                                                       if not ignore:
+                                                               files += 1
                                if files or subdirs:
                                        folder_filename = os.path.split(os.path.split(name)[0])[1]
-                                       mbox=self.session.openWithCallback(self.delete, MessageBox, _("'%s' contains %d file(s) and %d sub-directories.\n") % (folder_filename,files,subdirs) + are_you_sure)
+                                       mbox=self.session.openWithCallback(self.delete, MessageBox, _("'%s' contains %d recording(s) and %d sub-directories.\n") % (folder_filename,files,subdirs) + are_you_sure)
                                        mbox.setTitle(self.getTitle())
                                        return
                        else:
 

OpenViX Feeds Status

Back
Top