feat: adiciona suporte para definir título e faixa padrão em faixas de áudio e legenda

This commit is contained in:
2026-03-01 01:55:22 -03:00
parent c7031cbdce
commit 1f163ca0fc
15 changed files with 294 additions and 16 deletions
+24 -3
View File
@@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::domain::value_objects::{FilePath, SyncOffset, TrackId, TrackLanguage};
use serde::{Deserialize, Serialize};
/// Faixa de áudio externa adicionada pelo usuário.
#[derive(Clone, Debug, Serialize, Deserialize)]
@@ -8,10 +8,31 @@ pub struct AudioTrack {
pub path: FilePath,
pub offset: SyncOffset,
pub language: TrackLanguage,
/// Quando verdadeiro, emite `-disposition:a:{idx} default` no FFmpeg,
/// tornando esta faixa a padrão para players como Jellyfin.
pub is_default: bool,
/// Título exibido na lista de faixas do player (ex: "Português", "Comentários").
/// String vazia emite `title=` para apagar o título herdado do arquivo fonte
/// (ex: "ISO Media file produced by Google Inc.").
pub title: String,
}
impl AudioTrack {
pub fn new(id: TrackId, path: FilePath, offset: SyncOffset, language: TrackLanguage) -> Self {
AudioTrack { id, path, offset, language }
pub fn new(
id: TrackId,
path: FilePath,
offset: SyncOffset,
language: TrackLanguage,
is_default: bool,
title: String,
) -> Self {
AudioTrack {
id,
path,
offset,
language,
is_default,
title,
}
}
}