Added subtitle_path function which finds the dirpath based on video sibling and subtitle name.

This commit is contained in:
2018-09-23 21:26:57 +02:00
parent 4e055403d1
commit b40f0f91ef

View File

@@ -58,7 +58,6 @@ def search_external_subtitles(path, directory=None):
filecontent = pattern.sub('', f.read())
filecontent = filecontent[0:1000]
language = langdetect.detect(filecontent)
print(language)
f.close()
subtitles[p] = language
@@ -121,6 +120,10 @@ def scan_subtitle(path):
return subtitle
def subtitle_path(sibling, subtitle):
parent_path = os.path.dirname(sibling)
return os.path.join(parent_path, subtitle)
def scan_videos(path):
"""Scan `path` for videos and their subtitles.