mirror of
https://github.com/KrumpetPirate/AAXtoMP3.git
synced 2024-11-17 18:58:58 +01:00
Merge pull request #207 from bismark/fix-chapters-jq
Fixes for jq command generating chapters.txt
This commit is contained in:
commit
f65fddebc2
3
AAXtoMP3
3
AAXtoMP3
@ -551,9 +551,10 @@ save_metadata() {
|
||||
jq -r \
|
||||
'def pad(n): tostring | if (n > length) then ((n - length) * "0") + . else . end;
|
||||
.content_metadata.chapter_info.chapters |
|
||||
reduce .[] as $c ([]; if $c.chapters? then .+[$c | del(.chapters)]+[$c.chapters] else .+[$c] end) | flatten |
|
||||
to_entries |
|
||||
.[] |
|
||||
"CHAPTER\((.key))=\(((.value.start_offset_ms / (1000*60*60)) %24 | floor | pad(2))):\(((.value.start_offset_ms / (1000*60)) %60 | floor | pad(2))):\(((.value.start_offset_ms / 1000) %60 | floor | pad(2))).\((.value.start_offset_ms % 1000 | pad(3)))
|
||||
"CHAPTER\((.key))=\((((((.value.start_offset_ms / (1000*60*60)) /24 | floor) *24 ) + ((.value.start_offset_ms / (1000*60*60)) %24 | floor)) | pad(2))):\(((.value.start_offset_ms / (1000*60)) %60 | floor | pad(2))):\(((.value.start_offset_ms / 1000) %60 | floor | pad(2))).\((.value.start_offset_ms % 1000 | pad(3)))
|
||||
CHAPTER\((.key))NAME=\(.value.title)"' "${extra_chapter_file}" > "${tmp_chapter_file}"
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user