tags can now be used

filldb: Year and Genre will be read from MP3/ID3 tags and added as Tags.
client: Tags can (and will) be displayed in the status bar.
client: StatusBar text can be configured via ~/.config/musicdb-client/config_gui.toml
client: Added a proper default config file at src/config_gui.toml
        (note: this is in src/ so that include_bytes! can use a path without /, so it will compile on windows)
client: users will need to add the new `[text]` section to their gui_config.toml!
This commit is contained in:
Mark
2023-09-20 22:31:56 +02:00
parent c6b75180bb
commit f429f17876
8 changed files with 484 additions and 179 deletions

Binary file not shown.

View File

@@ -58,6 +58,13 @@ fn main() {
eprintln!("searching for artists...");
let mut artists = HashMap::new();
for song in songs {
let mut general = GeneralData::default();
if let Some(year) = song.1.year() {
general.tags.push(format!("Year={year}"));
}
if let Some(genre) = song.1.genre_parsed() {
general.tags.push(format!("Genre={genre}"));
}
let (artist_id, album_id) = if let Some(artist) = song
.1
.album_artist()
@@ -135,7 +142,7 @@ fn main() {
artist: artist_id,
more_artists: vec![],
cover: None,
general: GeneralData::default(),
general,
cached_data: Arc::new(Mutex::new(None)),
});
}