Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a script to reprocess silan on all files. #324

Open
wants to merge 2 commits into
base: archive/airtime/2.5.x
from

Conversation

Projects
None yet
2 participants
@jmtrivial
Copy link

commented Oct 7, 2017

@hairmare

This comment has been minimized.

Copy link
Member

commented Oct 8, 2017

Isn't this very similar to this one:

try:
command = ['silan', '-b' '-f', 'JSON', full_path]
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
out = proc.communicate()[0].strip('\r\n')
info = json.loads(out)
data = {}
data['cuein'] = str('{0:f}'.format(info['sound'][0][0]))
data['cueout'] = str('{0:f}'.format(info['sound'][-1][1]))
data['length'] = str('{0:f}'.format(info['file duration']))
processed_data.append((f['id'], data))
total += 1
if total % 5 == 0:
print "Total %s / %s files has been processed.." % (total, total_files)
except Exception, e:
print e
print traceback.format_exc()

Are you sure it doesn't duplicate any features? The one already in utils/airtime-silan seems to be based off of the forum post with added config reading and it uses the api.

Maybe we should add an additional flag to force it to redo all the files rather than using the dedicated api endpoint "get_files_without_silan_value"

files = api_client.get_files_without_silan_value()

I haven't tested the script from the utils folder so I'm not sure if it works at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.