EMJB
04-04-16, 16:09
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.
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.