*всё работает

This commit is contained in:
K1ndWha1e committed 2026-10-07 23:03:27 +03:00
1 parent aa04fd4df0
commit ffa8d80875
6 files changed
+124 -154

No files matched your search

+5 -3
View File
@@ -99,7 +99,8 @@ pub fn encode_header[T](mut id3v T) {
// Минорная версия и спец. флаги
id3v.encoded_header << []u8{len: 2}
id3v.encoded_header << metadata.encode_header_size(id3v.size, id3v.version)
// Размер всего тэга в заголовке всегда syncsafe (по 7 бит в байте), в том числе в v2.3
id3v.encoded_header << metadata.encode_header_size(id3v.size, 4)
}
// Количество нулей в конце тэга
@@ -110,7 +111,8 @@ pub fn encode_embed_tags[T](mut id3v2 T) {
// Проход по всем полям стуктуры
mut tag_bytes := []u8{}
$for field in id3v2.fields {
// Именно T.fields: с id3v2.fields V пропускает поля, которых нет в другом типе (tyer в ID3v24)
$for field in T.fields {
$if field.typ is Frame {
// Читаются только заполненные тэги
if id3v2.$(field.name).cur_size > 0 {
@@ -133,4 +135,4 @@ pub fn encode_embed_tags[T](mut id3v2 T) {
id3v2.encoded_header = []u8{}
encode_header(mut id3v2)
id3v2.encoded_header << tag_bytes
}
}