home
·
contact
·
privacy
projects
/
ytplom
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
66897c5
)
Don't try to ffprobe for duration if file is not actually present.
author
Christian Heller
<c.heller@plomlompom.de>
Wed, 25 Dec 2024 20:24:51 +0000
(21:24 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Wed, 25 Dec 2024 20:24:51 +0000
(21:24 +0100)
src/ytplom/misc.py
patch
|
blob
|
history
diff --git
a/src/ytplom/misc.py
b/src/ytplom/misc.py
index a68edbe85bc6f1a20f234baee4340f38bb19f124..12e7953cc712bc694f329cd61bd0c7b80bdab1dd 100644
(file)
--- a/
src/ytplom/misc.py
+++ b/
src/ytplom/misc.py
@@
-447,6
+447,8
@@
class VideoFile(DbData):
@property
def ffprobed_duration(self) -> str:
"""Return human-friendly formatting of file duration as per ffprobe."""
+ if not self.full_path.is_file():
+ return '?'
json = ffprobe(self.full_path)
duration_str = json['format']['duration']
m_seconds_str = duration_str.split('.')[1]