39 lines
1.1 KiB
Rust
39 lines
1.1 KiB
Rust
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)]
|
|
pub struct AudioTrack {
|
|
pub id: TrackId,
|
|
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,
|
|
is_default: bool,
|
|
title: String,
|
|
) -> Self {
|
|
AudioTrack {
|
|
id,
|
|
path,
|
|
offset,
|
|
language,
|
|
is_default,
|
|
title,
|
|
}
|
|
}
|
|
}
|