2011-12-03 15:09:55 +00:00
|
|
|
#!/usr/bin/ruby -w
|
|
|
|
|
2021-07-07 14:06:32 +00:00
|
|
|
class T_0324propedit_chapters < Test
|
2011-12-03 15:09:55 +00:00
|
|
|
def description
|
|
|
|
"mkvpropedit / chapters"
|
|
|
|
end
|
|
|
|
|
|
|
|
def _hash_chapters erase = false
|
|
|
|
sys "../src/mkvextract --engage no_variable_data chapters #{tmp} > #{tmp}-x"
|
|
|
|
hash_x = hash_file("#{tmp}-x")
|
|
|
|
[ hash_tmp(erase), hash_x ]
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
hashes = []
|
|
|
|
sys "cp data/mkv/complex.mkv #{tmp}"
|
|
|
|
hashes += _hash_chapters
|
|
|
|
|
|
|
|
%w{chap1.txt chap2.txt vmap.chapters.xml}.each do |chapters|
|
|
|
|
propedit "--chapters data/text/#{chapters}"
|
|
|
|
hashes += _hash_chapters
|
|
|
|
end
|
|
|
|
|
|
|
|
propedit "--chapters ''"
|
|
|
|
hashes += _hash_chapters(true)
|
|
|
|
|
|
|
|
hashes.join '-'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|