Moved checks for sufficient info in order to move series or movie to the class. Homelocation in now a class function for each movie and series class.

This commit is contained in:
2018-09-23 16:29:41 +02:00
parent 379d789adc
commit a106a35d42
2 changed files with 27 additions and 21 deletions

View File

@@ -272,28 +272,11 @@ def scan_folder(path):
return videos
def movingToCollege(video, home_path):
video.home = titlecase(home_path)
def pickforgirlscouts(video):
if isinstance(video, Movie):
if video.title != None and video.year != None:
home_path = '{} ({})'.format(video.title, video.year)
try:
movingToCollege(video, home_path)
return True
except:
return False
elif isinstance(video, Episode):
if video.series != None and video.season != None and video.episode != None and type(video.episode) != list:
# Handle the list problems
home_path = '{} S{:02d}E{:02d}'.format(str(video.series), str(video.season), str(video.episode))
try:
movingToCollege(video, home_path)
return True
except:
return False
if video.sufficientInfo():
video.moveLocation()
print(video.home)
return True
return False