diff --git a/src/main.cpp b/src/main.cpp index 171705e..f5fa2cd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,6 +35,10 @@ void OpenLyricsVersion::get_about_message(pfc::string_base & out) out += "You can support development at https://www.buymeacoffee.com/jacquesheunis\n"; out += "\nChangelog:\n"; // out += "Version " OPENLYRICS_VERSION " (" __DATE__ "):\n" + // "\n"; + out += "Version 1.10.2 (2024-09-01):\n" + "- Fix a crash when attempting to edit lyrics on a track with none saved\n" + "\n"; out += "Version 1.10.1 (2024-08-30):\n" "- Fix version 1.10 not having any version at all in the fb2k components UI\n" "\n"; diff --git a/src/ui_contextmenu.cpp b/src/ui_contextmenu.cpp index 8083c0a..44211b6 100644 --- a/src/ui_contextmenu.cpp +++ b/src/ui_contextmenu.cpp @@ -151,8 +151,21 @@ class OpenLyricsContextSubItem : public contextmenu_item_simple bool success = search_handle.wait_for_complete(30'000); if(success) { - LyricData lyrics = search_handle.get_result(); - lyric_metadata_log_retrieved(track_info, lyrics); + // If we don't already have lyrics for a track then search will return no results, + // so we need to construct our own blank lyric data + LyricData lyrics; + if(search_handle.has_result()) + { + lyrics = search_handle.get_result(); + lyric_metadata_log_retrieved(track_info, lyrics); + } + else + { + lyrics.artist = track_metadata(track_info, "artist"); + lyrics.album = track_metadata(track_info, "album"); + lyrics.title = track_metadata(track_info, "title"); + lyrics.duration_sec = track_duration_in_seconds(track_info); + } fb2k::inMainThread2([lyrics, track, track_info]() {