DVDs working
This commit is contained in:
parent
ede1fd22be
commit
a559e92d3e
13
src/dvd.py
13
src/dvd.py
|
@ -42,9 +42,8 @@ def scan(state, device):
|
|||
if title in ('No', 'unknown'):
|
||||
title = lsdvd["provider_id"]
|
||||
if title == "$PACKAGE_STRING":
|
||||
title = "DVD"
|
||||
now = time.strftime(r"%Y-%m-%dT%H:%M:%S")
|
||||
title = "%s %s" % (title, now)
|
||||
title = "DVD %s" % (title, now)
|
||||
|
||||
# Go through all the tracks, looking for the largest referenced sector.
|
||||
max_sector = 0
|
||||
|
@ -66,7 +65,7 @@ def scan(state, device):
|
|||
collection = []
|
||||
for track in tracks:
|
||||
if track["length"] / max_length > 0.80:
|
||||
collection = collect(track)
|
||||
collection = collect(collection, track)
|
||||
if (max_length < 20 * MINUTE) and (len(collection) < len(track) * 0.6):
|
||||
collection = tracks
|
||||
|
||||
|
@ -118,7 +117,7 @@ def encode(state, directory):
|
|||
"nice",
|
||||
"HandBrakeCLI",
|
||||
"--json",
|
||||
"--input", "%s/VIDEO_TS" % directory,
|
||||
"--input", "%s/%s/VIDEO_TS" % (directory, state["title"]),
|
||||
"--output", tmppath,
|
||||
"--title", str(track),
|
||||
"--native-language", "eng",
|
||||
|
@ -144,8 +143,7 @@ def encode(state, directory):
|
|||
m = progressRe.search(line)
|
||||
if m:
|
||||
progress = float(m[1])
|
||||
complete = (finished_length + progress*length) / total_length
|
||||
state["complete"] = complete
|
||||
yield (finished_length + progress*length) / total_length
|
||||
|
||||
finished_length += length
|
||||
os.rename(
|
||||
|
@ -156,8 +154,7 @@ def encode(state, directory):
|
|||
|
||||
|
||||
def clean(state, directory):
|
||||
pass
|
||||
|
||||
os.removedirs(directory)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import pprint
|
||||
|
|
Loading…
Reference in New Issue