CC-3630: Deleting files from organize folder if they don't have

correct Meta data

- done
This commit is contained in:
James 2012-04-20 10:56:51 -04:00
parent 4fcb4a530f
commit c1a6202da8
1 changed files with 25 additions and 4 deletions

View File

@ -142,8 +142,15 @@ class AirtimeProcessEvent(ProcessEvent):
#delete files from organize if they can not be read properly. #delete files from organize if they can not be read properly.
if pathname is None: if pathname is None:
os.remove(oldPath) try:
return self.logger.info("Deleting file because it cannot be read properly: %s", oldPath)
os.remove(oldPath)
return
except Exception, e:
import traceback
top = traceback.format_exc()
self.logger.error('Exception: %s', e)
self.logger.error("traceback: %s", top)
self.mmc.set_needed_file_permissions(pathname, dir) self.mmc.set_needed_file_permissions(pathname, dir)
is_recorded = self.mmc.is_parent_directory(pathname, self.config.recorded_directory) is_recorded = self.mmc.is_parent_directory(pathname, self.config.recorded_directory)
@ -245,7 +252,14 @@ class AirtimeProcessEvent(ProcessEvent):
#delete files from organize if they can not be read properly. #delete files from organize if they can not be read properly.
if filepath is None: if filepath is None:
os.remove(event.pathname) try:
self.logger.info("Deleting file because it cannot be read properly: %s", event.pathname)
os.remove(event.pathname)
except Exception, e:
import traceback
top = traceback.format_exc()
self.logger.error('Exception: %s', e)
self.logger.error("traceback: %s", top)
else: else:
filepath = event.pathname filepath = event.pathname
@ -258,7 +272,14 @@ class AirtimeProcessEvent(ProcessEvent):
#delete files from organize if they can not be read properly. #delete files from organize if they can not be read properly.
if filepath is None: if filepath is None:
os.remove(event.pathname) try:
self.logger.info("Deleting file because it cannot be read properly: %s", event.pathname)
os.remove(event.pathname)
except Exception, e:
import traceback
top = traceback.format_exc()
self.logger.error('Exception: %s', e)
self.logger.error("traceback: %s", top)
else: else:
#show dragged from unwatched folder into a watched folder. Do not "organize".:q! #show dragged from unwatched folder into a watched folder. Do not "organize".:q!
if self.mmc.is_parent_directory(event.pathname, self.config.recorded_directory): if self.mmc.is_parent_directory(event.pathname, self.config.recorded_directory):