Commit f9ce2683 authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

change back to not use ffmpeginfo all the time -- way too slow

parent dec408d6
......@@ -474,33 +474,31 @@ for folder, deps in depwalk("."):
file_meta = os.path.join(folder, ".index", os.path.basename(d), "metadata.json")
if ext:
if ext in AUDIO_EXTENSIONS or ext in VIDEO_EXTENSIONS:
ffinfo = ffmpeg_get_info(d)
if ffinfo['mediatype'] == "audio":
meta_sources = [d]
play = os.path.join(folder, ".index", os.path.basename(d), "play.mp3")
if os.path.exists(play):
meta_sources.append(play)
env.FFMPEGMeta(target=file_meta, source=meta_sources)
depsmeta.append(file_meta)
elif ffinfo['mediatype'] == "video":
meta_sources = [d]
poster = os.path.join(folder, ".index", os.path.basename(d), "poster.png")
if not os.path.exists(poster): # build iff it doesn't exist
env.VideoPoster(target=poster, source=d)
meta_sources.append(poster)
thumb = os.path.join(folder, ".index", os.path.basename(d), "thumb.png")
if not os.path.exists(thumb): # build iff it doesn't exist
env.VideoThumb(target=thumb, source=d)
meta_sources.append(thumb)
# play: if present include it
play = os.path.join(folder, ".index", os.path.basename(d), "play.mp4")
if os.path.exists(play):
meta_sources.append(play)
env.FFMPEGMeta(target=file_meta, source=meta_sources)
depsmeta.append(file_meta)
if ext in AUDIO_EXTENSIONS:
meta_sources = [d]
play = os.path.join(folder, ".index", os.path.basename(d), "play.mp3")
if os.path.exists(play):
meta_sources.append(play)
env.FFMPEGMeta(target=file_meta, source=meta_sources)
depsmeta.append(file_meta)
elif ext in VIDEO_EXTENSIONS:
meta_sources = [d]
poster = os.path.join(folder, ".index", os.path.basename(d), "poster.png")
if not os.path.exists(poster): # build iff it doesn't exist
env.VideoPoster(target=poster, source=d)
meta_sources.append(poster)
thumb = os.path.join(folder, ".index", os.path.basename(d), "thumb.png")
if not os.path.exists(thumb): # build iff it doesn't exist
env.VideoThumb(target=thumb, source=d)
meta_sources.append(thumb)
# play: if present include it
play = os.path.join(folder, ".index", os.path.basename(d), "play.mp4")
if os.path.exists(play):
meta_sources.append(play)
env.FFMPEGMeta(target=file_meta, source=meta_sources)
depsmeta.append(file_meta)
elif ext in IMAGE_EXTENSIONS:
meta_sources = [d]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment