Compare commits
1 Commits
dev
...
f/poc-trac
Author | SHA1 | Date |
---|---|---|
Yves G. | e4ab70bf39 |
|
@ -399,11 +399,13 @@ while read -r tlist; do
|
|||
STREAMS_TO_REF[$strid]=$ref
|
||||
done <"$BUILD/.titlelist"
|
||||
|
||||
declare -A STREAMS_TO_OFFSET
|
||||
declare -A STREAMS_TO_OFFSET STREAMS_TO_TRACKID
|
||||
|
||||
ref=0
|
||||
id=1
|
||||
for strid in "${STREAMS_LIST[@]}"; do
|
||||
STREAMS_TO_OFFSET[$strid]=$ref
|
||||
STREAMS_TO_TRACKID[$strid]=$id; id=$((id+1))
|
||||
file="${STREAMS_TO_FILES[$strid]##*|}"
|
||||
tnum=$(sed -r 's#.*/t.([0-9]+).ch.[0-9]+.mkv#\1#' <<<"$file")
|
||||
streamcount=$(jq -r '.tracks | length' <"${file%mkv}json")
|
||||
|
@ -419,9 +421,9 @@ for strid in "${STREAMS_LIST[@]}"; do
|
|||
IFS='|' read -r -a files <<<"${STREAMS_TO_FILES[$strid]#|}"
|
||||
MKVMRGARGS+=("${files[@]}")
|
||||
MKVMRGARGS+=(']')
|
||||
for file in "${files[@]}"; do
|
||||
ref=$(bc -lq <<<"$ref+$(jq -r '.container.properties | .duration/.timestamp_scale' <"${file%mkv}json")+1")
|
||||
done
|
||||
# for file in "${files[@]}"; do
|
||||
# ref=$(bc -lq <<<"$ref+$(jq -r '.container.properties | .duration/.timestamp_scale' <"${file%mkv}json")")
|
||||
# done
|
||||
done
|
||||
|
||||
# generate MKV editions XML file
|
||||
|
@ -473,6 +475,9 @@ ENDOFXML
|
|||
<ChapterDisplay>
|
||||
<ChapterString>$tnum.$chnum — ${CHNAMES[$tnum.$chnum]}</ChapterString>
|
||||
</ChapterDisplay>
|
||||
<ChapterTrack>
|
||||
<ChapterTrackNumber>${STREAMS_TO_TRACKID[$strid]}</ChapterTrackNumber>
|
||||
</ChapterTrack>
|
||||
</ChapterAtom>
|
||||
ENDOFXML
|
||||
|
||||
|
|
Loading…
Reference in New Issue