mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 01:26:43 +01:00
store source tag
This commit is contained in:
parent
72607e482c
commit
300cc8864a
2 changed files with 5 additions and 5 deletions
|
|
@ -2,7 +2,6 @@ use crate::*;
|
|||
use std::cmp::{Eq, PartialEq, Ord, PartialOrd, Ordering};
|
||||
use lofty::tag::TagItem;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Entry {
|
||||
/// How many levels deep is this from the working directory
|
||||
pub depth: usize,
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@ use crate::*;
|
|||
use std::fs::File;
|
||||
use std::io::{BufReader, Read};
|
||||
use byte_unit::{Byte, Unit::MB};
|
||||
use lofty::{file::TaggedFileExt, probe::Probe, tag::{Accessor, TagItem, ItemKey, ItemValue}};
|
||||
use lofty::{file::TaggedFileExt, probe::Probe, tag::{Accessor, Tag, TagItem, ItemKey, ItemValue}};
|
||||
|
||||
#[derive(Ord, Eq, PartialEq, PartialOrd, Debug)]
|
||||
pub enum Metadata {
|
||||
Directory {
|
||||
hash_file: Option<()>,
|
||||
|
|
@ -13,8 +12,10 @@ pub enum Metadata {
|
|||
release_file: Option<()>,
|
||||
},
|
||||
Music {
|
||||
invalid: bool,
|
||||
hash: Arc<str>,
|
||||
size: Arc<str>,
|
||||
tag: Arc<Option<Tag>>,
|
||||
artist: Option<Arc<str>>,
|
||||
album: Option<Arc<str>>,
|
||||
track: Option<u32>,
|
||||
|
|
@ -25,14 +26,13 @@ pub enum Metadata {
|
|||
publisher: Option<Arc<str>>,
|
||||
key: Option<Arc<str>>,
|
||||
bpm: Option<Arc<str>>,
|
||||
invalid: bool,
|
||||
},
|
||||
Image {
|
||||
invalid: bool,
|
||||
hash: Arc<str>,
|
||||
size: Arc<str>,
|
||||
title: Option<String>,
|
||||
author: Option<String>,
|
||||
invalid: bool,
|
||||
},
|
||||
Unknown {
|
||||
hash: Arc<str>,
|
||||
|
|
@ -66,6 +66,7 @@ impl Metadata {
|
|||
key: None,
|
||||
bpm: None,
|
||||
invalid: false,
|
||||
tag: tag.map(|t|t.clone()).into(),
|
||||
})
|
||||
} else {
|
||||
Self::new_fallback(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue