Added checks for potential problems when listing files
This commit is contained in:
17
libtvshow.py
17
libtvshow.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user