feat: atualiza status do progresso de implementação e resolve warnings de código não utilizado
This commit is contained in:
@@ -54,7 +54,6 @@ impl FfmpegCommandBuilder {
|
||||
Track::Subtitle(t) => t.path.to_string_lossy().to_string(),
|
||||
};
|
||||
args.push(path);
|
||||
next_input_idx += 1;
|
||||
}
|
||||
|
||||
// ── Maps ────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -5,8 +5,10 @@ pub mod file_picker;
|
||||
pub use file_picker::FilePickerAdapter;
|
||||
|
||||
/// Implementação concreta do FileSystemPort.
|
||||
#[allow(dead_code)]
|
||||
pub struct RealFileSystem;
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl FileSystemPort for RealFileSystem {
|
||||
fn exists(&self, path: &FilePath) -> bool {
|
||||
path.as_path().exists()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use crate::domain::entities::MediaTrackInfo;
|
||||
use crate::domain::value_objects::FilePath;
|
||||
use anyhow::Result;
|
||||
|
||||
/// Port para inspecionar faixas de um arquivo de mídia (implementado pelo FfprobeGateway).
|
||||
pub trait MediaInfoPort {
|
||||
@@ -13,6 +13,7 @@ pub trait MediaProcessorPort {
|
||||
}
|
||||
|
||||
/// Port para abstrair acesso ao sistema de arquivos.
|
||||
#[allow(dead_code)]
|
||||
pub trait FileSystemPort {
|
||||
fn exists(&self, path: &FilePath) -> bool;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
use crate::domain::entities::Project;
|
||||
use crate::domain::value_objects::{SyncOffset, TrackId};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
/// Ajusta o offset de sincronização de uma faixa externa existente pelo TrackId.
|
||||
#[allow(dead_code)]
|
||||
pub struct AdjustSync;
|
||||
|
||||
impl AdjustSync {
|
||||
#[allow(dead_code)]
|
||||
pub fn execute(project: &mut Project, id: TrackId, offset: SyncOffset) -> Result<()> {
|
||||
let track = project
|
||||
.find_track_mut(id)
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
use anyhow::Result;
|
||||
use crate::application::ports::MediaProcessorPort;
|
||||
use crate::domain::entities::Project;
|
||||
use anyhow::Result;
|
||||
|
||||
/// Constrói o comando FFmpeg a partir do Project e delega a execução ao MediaProcessorPort.
|
||||
#[allow(dead_code)]
|
||||
pub struct GenerateOutput;
|
||||
|
||||
impl GenerateOutput {
|
||||
#[allow(dead_code)]
|
||||
pub fn execute(project: &Project, port: &dyn MediaProcessorPort) -> Result<()> {
|
||||
use crate::adapters::ffmpeg::command_builder::FfmpegCommandBuilder;
|
||||
let args = FfmpegCommandBuilder::build(project);
|
||||
@@ -16,11 +18,11 @@ impl GenerateOutput {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use anyhow::Result;
|
||||
use crate::application::ports::MediaProcessorPort;
|
||||
use crate::application::use_cases::add_audio_track::AddAudioTrack;
|
||||
use crate::domain::entities::{MkvOutput, Project, VideoFile};
|
||||
use crate::domain::value_objects::{FilePath, SyncOffset, TrackLanguage};
|
||||
use anyhow::Result;
|
||||
use std::cell::RefCell;
|
||||
|
||||
struct MockProcessor {
|
||||
|
||||
@@ -3,9 +3,11 @@ use crate::domain::entities::Project;
|
||||
use crate::domain::value_objects::{TrackId, TrackLanguage};
|
||||
|
||||
/// Altera o idioma de uma faixa externa pelo TrackId.
|
||||
#[allow(dead_code)]
|
||||
pub struct SetTrackLanguage;
|
||||
|
||||
impl SetTrackLanguage {
|
||||
#[allow(dead_code)]
|
||||
pub fn execute(project: &mut Project, id: TrackId, language: TrackLanguage) -> Result<()> {
|
||||
let track = project
|
||||
.find_track_mut(id)
|
||||
|
||||
@@ -39,6 +39,7 @@ impl Project {
|
||||
}
|
||||
|
||||
/// Busca uma faixa externa pelo TrackId.
|
||||
#[allow(dead_code)]
|
||||
pub fn find_track_mut(&mut self, id: TrackId) -> Option<&mut Track> {
|
||||
self.tracks.iter_mut().find(|t| t.id() == id)
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ impl Track {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn language(&self) -> &TrackLanguage {
|
||||
match self {
|
||||
Track::Audio(t) => &t.language,
|
||||
@@ -31,6 +32,7 @@ impl Track {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn set_offset(&mut self, offset: SyncOffset) {
|
||||
match self {
|
||||
Track::Audio(t) => t.offset = offset,
|
||||
@@ -38,6 +40,7 @@ impl Track {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn set_language(&mut self, language: TrackLanguage) {
|
||||
match self {
|
||||
Track::Audio(t) => t.language = language,
|
||||
|
||||
@@ -6,6 +6,7 @@ use std::path::PathBuf;
|
||||
pub struct FilePath(PathBuf);
|
||||
|
||||
impl FilePath {
|
||||
#[allow(dead_code)]
|
||||
pub fn new(path: impl Into<PathBuf>) -> Self {
|
||||
FilePath(path.into())
|
||||
}
|
||||
@@ -18,7 +19,7 @@ impl FilePath {
|
||||
self.0.to_str()
|
||||
}
|
||||
|
||||
pub fn to_string_lossy(&self) -> std::borrow::Cow<str> {
|
||||
pub fn to_string_lossy(&self) -> std::borrow::Cow<'_, str> {
|
||||
self.0.to_string_lossy()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ pub struct SyncOffset(i64);
|
||||
|
||||
impl SyncOffset {
|
||||
/// Cria um SyncOffset a partir de milissegundos.
|
||||
#[allow(dead_code)]
|
||||
pub fn from_ms(ms: i64) -> Self {
|
||||
SyncOffset(ms)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user