Added checks for potential problems when listing files

This commit is contained in:
2013-07-15 22:27:06 +10:00
parent df4aefeca1
commit 35ca21e4e4
4 changed files with 58 additions and 15 deletions

View File

@@ -5,6 +5,9 @@ Created on Sat Jul 6 20:26:22 2013
@author: shanef
"""
import os
#from libfilemanager import FileManager
class TVShow(object):
"""
@@ -24,3 +27,17 @@ class TVShow(object):
def __str__(self):
return "Input: {0} -> Output: {1}".format(self.inputfile,
self.outputfile)
def checkproblems(self):
"""
Check the TVShow object for any potential problems.
"""
errors = []
if self.episode == "E00" or self.season == "S00" or not self.subtitle:
errors.append("NO_EPISODE")
if os.path.exists(self.outputfile):
errors.append("FILE_EXISTS")
return errors