Added checks for potential problems when listing files
This commit is contained in:
parent
df4aefeca1
commit
35ca21e4e4
4 changed files with 58 additions and 15 deletions
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue