|
|
@ -18,6 +18,7 @@ def mp3_sources(data_dir, pattern, kbits):
|
|
|
|
length = timedelta(minutes=size / (1000*kbits/8) / 60)
|
|
|
|
length = timedelta(minutes=size / (1000*kbits/8) / 60)
|
|
|
|
return length
|
|
|
|
return length
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_sources():
|
|
|
|
# Get a sorted list of all source files with start time and length
|
|
|
|
# Get a sorted list of all source files with start time and length
|
|
|
|
sources = []
|
|
|
|
sources = []
|
|
|
|
for fn in os.listdir(data_dir):
|
|
|
|
for fn in os.listdir(data_dir):
|
|
|
@ -29,6 +30,8 @@ def mp3_sources(data_dir, pattern, kbits):
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
return sources
|
|
|
|
return sources
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return get_sources
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
class Config:
|
|
|
|
SECRET_KEY = os.environ.get('SECRET_KEY') or \
|
|
|
|
SECRET_KEY = os.environ.get('SECRET_KEY') or \
|
|
|
@ -43,7 +46,7 @@ class Config:
|
|
|
|
|
|
|
|
|
|
|
|
# Here's the interesting part: configuring the source.
|
|
|
|
# Here's the interesting part: configuring the source.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# We need to return a list of dicts of source files with metadata, e.g.
|
|
|
|
# We need to return a function that returns a list of dicts of source files with metadata, e.g.
|
|
|
|
# [ {"fn": "/path/to/foo-20:01.mp3", "start_time": datetime(...), "length": timedelta(hours=1)} ]
|
|
|
|
# [ {"fn": "/path/to/foo-20:01.mp3", "start_time": datetime(...), "length": timedelta(hours=1)} ]
|
|
|
|
|
|
|
|
|
|
|
|
data_dir = os.environ.get('DATA_DIR') or '/var/tmp/prolefeeder-test-data'
|
|
|
|
data_dir = os.environ.get('DATA_DIR') or '/var/tmp/prolefeeder-test-data'
|
|
|
|