Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 494de64f0a |
+1
-1
@@ -106,7 +106,7 @@ async fn process_file(
|
|||||||
bitrate: Set(meta.bitrate),
|
bitrate: Set(meta.bitrate),
|
||||||
file_size: Set(scanned.file_size),
|
file_size: Set(scanned.file_size),
|
||||||
fingerprint: NotSet,
|
fingerprint: NotSet,
|
||||||
musicbrainz_id: NotSet,
|
musicbrainz_id: Set(meta.musicbrainz_recording_id),
|
||||||
artist_id: Set(artist_id),
|
artist_id: Set(artist_id),
|
||||||
album_id: Set(album_id),
|
album_id: Set(album_id),
|
||||||
file_mtime: Set(Some(scanned.mtime)),
|
file_mtime: Set(Some(scanned.mtime)),
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ pub struct MusicMetadata {
|
|||||||
pub duration: Option<f64>,
|
pub duration: Option<f64>,
|
||||||
pub codec: Option<String>,
|
pub codec: Option<String>,
|
||||||
pub bitrate: Option<i32>,
|
pub bitrate: Option<i32>,
|
||||||
|
pub musicbrainz_recording_id: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Map lofty FileType to a human-readable codec string.
|
/// Map lofty FileType to a human-readable codec string.
|
||||||
@@ -74,6 +75,10 @@ pub fn extract_metadata(path: &Path) -> IndexResult<MusicMetadata> {
|
|||||||
meta.album_artist = tag
|
meta.album_artist = tag
|
||||||
.get_string(&lofty::tag::ItemKey::AlbumArtist)
|
.get_string(&lofty::tag::ItemKey::AlbumArtist)
|
||||||
.map(|s| s.to_string());
|
.map(|s| s.to_string());
|
||||||
|
|
||||||
|
meta.musicbrainz_recording_id = tag
|
||||||
|
.get_string(&lofty::tag::ItemKey::MusicBrainzRecordingId)
|
||||||
|
.map(|s| s.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(meta)
|
Ok(meta)
|
||||||
|
|||||||
Reference in New Issue
Block a user