Alexandre Pasmantier edd9df4e29
fix(entry): always preserve raw input + match ranges conversions (#62)
* fix(entry): preserve raw input

* chore(version): bump workspace crates and television

* test: add tests for replace_non_printable and cleanup commented out code

* chore(changelog): update changelog (auto)

* chore(deps): update cargo dependencies

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-24 00:20:04 +01:00

29 lines
690 B
Rust

use std::sync::Arc;
use crate::previewers::{Preview, PreviewContent};
use television_channels::entry::Entry;
#[derive(Debug, Default)]
pub struct BasicPreviewer {
_config: BasicPreviewerConfig,
}
#[derive(Debug, Default)]
pub struct BasicPreviewerConfig {}
impl BasicPreviewer {
pub fn new(config: Option<BasicPreviewerConfig>) -> Self {
BasicPreviewer {
_config: config.unwrap_or_default(),
}
}
pub fn preview(&self, entry: &Entry) -> Arc<Preview> {
Arc::new(Preview {
title: entry.name.clone(),
content: PreviewContent::PlainTextWrapped(entry.name.clone()),
icon: entry.icon,
})
}
}