Commit e5f90639 authored by Manuel Günther's avatar Manuel Günther
Browse files

Implemented proper load function of YoutubeBioFile

parent 4f7b5f04
Pipeline #7465 passed with stages
in 37 minutes and 42 seconds
......@@ -12,7 +12,7 @@
from .database import VideoBioFile
from import ZTBioDatabase
from import FrameContainer
from import FrameContainer, FrameSelector
import os
......@@ -23,12 +23,13 @@ class YoutubeBioFile(VideoBioFile):
super(YoutubeBioFile, self).__init__(client_id=f.client_id, path=f.path,
self._f = f
def load(self, directory=None, extension='.jpg'):
def load(self, directory=None, extension='.jpg', frame_selector=FrameSelector()):
if extension in (None, '.jpg', '/*.jpg'):
files = sorted(os.listdir(self.make_path(directory, '')))
base_dir = self.make_path(directory, '')
files = [os.path.join(base_dir, f) for f in sorted(os.listdir(base_dir))]
fc = FrameContainer()
for f in files:
for f in frame_selector(files):
if extension == os.path.splitext(f)[1]:
file_name = os.path.join(self.make_path(directory, ''), f)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment