-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for single soundscapes the legacy way
- Loading branch information
1 parent
90e1c19
commit 70f229e
Showing
4 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from .config.logs import get_logger | ||
from .config.read_config import read_config | ||
from .old.playlist_to_soundscape import playlist_to_soundscape | ||
from .old.db import connect, get_automated_user, create_job | ||
|
||
log = get_logger() | ||
|
||
def main(config): | ||
conn = connect() | ||
|
||
playlist_id = config['playlist_id'] | ||
job_name = config['job_name'] | ||
soundscape_aggregation = config['soundscape_aggregation'] | ||
soundscape_bin_size = config['soundscape_bin_size'] | ||
soundscape_threshold = config['soundscape_threshold'] | ||
soundscape_normalize = config['soundscape_normalize'] | ||
|
||
user_id = get_automated_user(conn) | ||
|
||
job_id = create_job(conn, playlist_id, user_id, soundscape_aggregation, soundscape_bin_size, soundscape_threshold, soundscape_normalize, job_name) | ||
print('- Created and initialized job', job_id) | ||
|
||
playlist_to_soundscape(job_id) | ||
print('- Completed job', job_id) | ||
|
||
|
||
if __name__ == "__main__": | ||
log.info('PROCESS: Initialization') | ||
config = read_config() | ||
log.info('PROCESS: Job started') | ||
main(config) | ||
log.info('PROCESS: Job completed') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters