Video has a new attribute home that is the optimal parent folder for this element.

This commit is contained in:
2018-09-16 23:38:19 +02:00
parent 3e2faadc2f
commit 16afdb4cd8
2 changed files with 11 additions and 4 deletions

View File

@@ -269,13 +269,20 @@ def scan_folder(path):
return videos
def movingToCollege(video, home_path):
video.home = home_path
def pickforgirlscouts(video):
if isinstance(video, Movie):
if video.title != None and video.year != None:
home_path = '{} ({})'.format(video.title, video.year)
movingToCollege(video, home_path)
return True
elif isinstance(video, Episode):
if video.series != None and video.season != None and video.episode != None and type(video.episode) != list:
home_path = '{} S{:02d}E{:02d}'.format(video.series, video.season, video.episode)
movingToCollege(video, home_path)
return True
return False

View File

@@ -23,8 +23,8 @@ class Video(object):
Represent a video, existing or not.
:param str name: name or path of the video.
:param str format: format of the video (HDTV, WEB-DL, BluRay, ...).
:param str release_group: release group of the video.
:param str resolution: resolution of the video stream (480p, 720p, 1080p or 1080i).
:param str home: home is the optimal parent folder.
:param str resolution: resolution of the video stream (480p, 720p, 1080p or 1080i, 4K).
:param str video_codec: codec of the video stream.
:param str audio_codec: codec of the main audio stream.
:param str imdb_id: IMDb id of the video.
@@ -32,7 +32,7 @@ class Video(object):
:param int size: size of the video file in bytes.
:param set subtitles: existing subtitle languages.
"""
def __init__(self, name, hash=None, size=None, format=None, release_group=None, resolution=None, video_codec=None, audio_codec=None,
def __init__(self, name, hash=None, size=None, format=None, home=None, resolution=None, video_codec=None, audio_codec=None,
imdb_id=None, subtitles=None, embeded_subtitles=None):
#: Name or path of the video
self.name = name
@@ -47,7 +47,7 @@ class Video(object):
self.format = format
#: Release group of the video
self.release_group = release_group
self.home = home
#: Resolution of the video stream (480p, 720p, 1080p or 1080i)
self.resolution = resolution