treewide: complete book management interface
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: If5a21f16221f3c56a8008e139f93edc46a6a6964
This commit is contained in:
parent
bda36ac152
commit
2f31242442
23 changed files with 1693 additions and 126 deletions
|
|
@ -6,7 +6,7 @@
|
|||
use async_trait::async_trait;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
use thiserror::Error;
|
||||
|
||||
pub mod manifest;
|
||||
|
|
@ -161,7 +161,7 @@ pub trait MediaTypeProvider: Plugin {
|
|||
fn supported_media_types(&self) -> Vec<MediaTypeDefinition>;
|
||||
|
||||
/// Check if this plugin can handle the given file
|
||||
async fn can_handle(&self, path: &PathBuf, mime_type: Option<&str>) -> PluginResult<bool>;
|
||||
async fn can_handle(&self, path: &Path, mime_type: Option<&str>) -> PluginResult<bool>;
|
||||
}
|
||||
|
||||
/// Definition of a custom media type
|
||||
|
|
@ -190,7 +190,7 @@ pub struct MediaTypeDefinition {
|
|||
#[async_trait]
|
||||
pub trait MetadataExtractor: Plugin {
|
||||
/// Extract metadata from a file
|
||||
async fn extract_metadata(&self, path: &PathBuf) -> PluginResult<ExtractedMetadata>;
|
||||
async fn extract_metadata(&self, path: &Path) -> PluginResult<ExtractedMetadata>;
|
||||
|
||||
/// Get the media types this extractor supports
|
||||
fn supported_types(&self) -> Vec<String>;
|
||||
|
|
@ -223,8 +223,8 @@ pub trait ThumbnailGenerator: Plugin {
|
|||
/// Generate a thumbnail for the given file
|
||||
async fn generate_thumbnail(
|
||||
&self,
|
||||
path: &PathBuf,
|
||||
output_path: &PathBuf,
|
||||
path: &Path,
|
||||
output_path: &Path,
|
||||
options: ThumbnailOptions,
|
||||
) -> PluginResult<ThumbnailInfo>;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue