Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
django-panik-emissions
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
django-panik-emissions
Commits
f650277f
Commit
f650277f
authored
Mar 24, 2020
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
management: also compute durations of non-podcastable files
parent
cad17f07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
emissions/management/commands/create-sound-files.py
emissions/management/commands/create-sound-files.py
+12
-1
No files found.
emissions/management/commands/create-sound-files.py
View file @
f650277f
...
...
@@ -56,7 +56,7 @@ class Command(BaseCommand):
self
.
copy
=
copy
self
.
link
=
link
for
soundfile
in
SoundFile
.
objects
.
select_related
()
.
exclude
(
podcastable
=
False
)
:
for
soundfile
in
SoundFile
.
objects
.
select_related
():
if
emission
and
soundfile
.
episode
.
emission
.
slug
!=
emission
:
continue
if
episode
and
soundfile
.
episode
.
slug
!=
episode
:
...
...
@@ -66,6 +66,17 @@ class Command(BaseCommand):
continue
except
ValueError
:
# no file associated with it
continue
if
not
soundfile
.
podcastable
:
# get duration using initial file
if
not
soundfile
.
duration
:
cmd
=
[
'soxi'
,
'-D'
,
soundfile
.
file
.
path
]
try
:
soundfile
.
duration
=
int
(
float
(
subprocess
.
check_output
(
cmd
)))
except
(
ValueError
,
subprocess
.
CalledProcessError
):
pass
else
:
soundfile
.
save
()
continue
for
format
in
formats
.
split
(
','
):
file_path
=
soundfile
.
get_format_path
(
format
)
created
=
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment