Removed unused field
This commit is contained in:
parent
1bbeee7f39
commit
91152fdc08
5 changed files with 7 additions and 13 deletions
|
@ -139,7 +139,11 @@ impl Builder {
|
|||
return;
|
||||
};
|
||||
|
||||
let Some(virtual_parent) = (&song.virtual_parent).get_or_intern(strings) else {
|
||||
let Some(virtual_parent) = song
|
||||
.virtual_path
|
||||
.parent()
|
||||
.and_then(|p| p.get_or_intern(strings))
|
||||
else {
|
||||
return;
|
||||
};
|
||||
|
||||
|
@ -192,7 +196,6 @@ mod test {
|
|||
for path in songs {
|
||||
let mut song = scanner::Song::default();
|
||||
song.virtual_path = path.clone();
|
||||
song.virtual_parent = path.parent().unwrap().to_owned();
|
||||
builder.add_song(&mut strings, &song);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ pub struct Album {
|
|||
pub struct Song {
|
||||
pub path: PathBuf,
|
||||
pub virtual_path: PathBuf,
|
||||
pub virtual_parent: PathBuf,
|
||||
pub track_number: Option<i64>,
|
||||
pub disc_number: Option<i64>,
|
||||
pub title: Option<String>,
|
||||
|
|
|
@ -39,7 +39,6 @@ pub struct Album {
|
|||
pub struct Song {
|
||||
pub path: PathKey,
|
||||
pub virtual_path: PathKey,
|
||||
pub virtual_parent: PathKey,
|
||||
pub track_number: Option<i64>,
|
||||
pub disc_number: Option<i64>,
|
||||
pub title: Option<lasso2::Spur>,
|
||||
|
@ -98,10 +97,6 @@ pub fn store_song(strings: &mut Rodeo, song: &scanner::Song) -> Option<Song> {
|
|||
return None;
|
||||
};
|
||||
|
||||
let Some(virtual_parent) = (&song.virtual_parent).get_or_intern(strings) else {
|
||||
return None;
|
||||
};
|
||||
|
||||
let artwork = match &song.artwork {
|
||||
Some(a) => match a.get_or_intern(strings) {
|
||||
Some(a) => Some(a),
|
||||
|
@ -113,7 +108,6 @@ pub fn store_song(strings: &mut Rodeo, song: &scanner::Song) -> Option<Song> {
|
|||
Some(Song {
|
||||
path,
|
||||
virtual_path,
|
||||
virtual_parent,
|
||||
track_number: song.track_number,
|
||||
disc_number: song.disc_number,
|
||||
title: song.title.as_ref().map(|s| strings.get_or_intern(s)),
|
||||
|
@ -159,7 +153,6 @@ pub fn fetch_song(strings: &RodeoReader, song: &Song) -> super::Song {
|
|||
super::Song {
|
||||
path: PathBuf::from(strings.resolve(&song.path.0)),
|
||||
virtual_path: PathBuf::from(strings.resolve(&song.virtual_path.0)),
|
||||
virtual_parent: PathBuf::from(strings.resolve(&song.virtual_parent.0)),
|
||||
track_number: song.track_number,
|
||||
disc_number: song.disc_number,
|
||||
title: song.title.map(|s| strings.resolve(&s).to_string()),
|
||||
|
|
|
@ -22,7 +22,6 @@ pub struct Directory {
|
|||
pub struct Song {
|
||||
pub path: PathBuf,
|
||||
pub virtual_path: PathBuf,
|
||||
pub virtual_parent: PathBuf,
|
||||
pub track_number: Option<i64>,
|
||||
pub disc_number: Option<i64>,
|
||||
pub title: Option<String>,
|
||||
|
@ -282,7 +281,6 @@ fn process_directory<P: AsRef<Path>, Q: AsRef<Path>>(
|
|||
songs.push(Song {
|
||||
path: entry_real_path.clone(),
|
||||
virtual_path: entry_virtual_path.clone(),
|
||||
virtual_parent: entry_virtual_path.parent().unwrap().to_owned(),
|
||||
track_number: metadata.track_number.map(|n| n as i64),
|
||||
disc_number: metadata.disc_number.map(|n| n as i64),
|
||||
title: metadata.title,
|
||||
|
|
|
@ -352,7 +352,8 @@ impl From<index::Album> for Directory {
|
|||
let path = album
|
||||
.songs
|
||||
.first()
|
||||
.map(|s| s.virtual_parent.clone())
|
||||
.and_then(|s| s.virtual_path.parent())
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_default();
|
||||
|
||||
Self {
|
||||
|
|
Loading…
Add table
Reference in a new issue