Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/lyric_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,17 @@ void LyricAutosearchManager::on_playback_new_track(metadb_handle_ptr track)

const bool search_postponed_for_dynamic_info = track_is_remote(
track); // If this is an internet radio then don't search until we get dynamic track info
const bool should_search = track_changed && !search_postponed_for_dynamic_info;
const bool search_skipped_for_missing_local_file = !search_postponed_for_dynamic_info && !track_exists_on_filesystem(
track); // Skip search for missing local files as it can create lyric files and directories for missing paths
const bool should_search = track_changed && !search_postponed_for_dynamic_info && !search_skipped_for_missing_local_file;
if(!should_search)
{
LOG_INFO("Skipping new-playback search. %s, %s",
LOG_INFO("Skipping new-playback search. %s, %s, %s",
track_changed ? "The track has changed" : "The track didn't change",
search_postponed_for_dynamic_info ? "the search is being postponed waiting for dynamic info"
: "we're not waiting for dynamic track info");
: "we're not waiting for dynamic track info",
search_skipped_for_missing_local_file ? "the search is being skipped due to a missing local file"
: "the search is not being skipped due to a missing local file");
return;
}

Expand Down
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ namespace
out += "\nChangelog:\n";
// out += "Version " OPENLYRICS_VERSION " (" __DATE__ "):\n"
// "\n";
out += "Version " OPENLYRICS_VERSION " (" __DATE__ "):\n"
"- Fix auto-search triggering for missing local files\n"
"\n";
out += "Version 1.13 (2026-01-17):\n"
"- Enable searching local sources with no visible panels by default\n"
"- Add some clarifying help to the 'Exclude trailing brackets' search option\n"
Expand Down
13 changes: 13 additions & 0 deletions src/tag_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,19 @@ bool track_is_remote(metadb_handle_ptr track)
#endif
}

bool track_exists_on_filesystem(metadb_handle_ptr track)
{
try
{
const char* path = track->get_path();
return filesystem::g_exists(path, fb2k::noAbort);
}
catch(const std::exception&)
{
return false;
}
}

bool starts_with_ignore_case(std::string_view input, std::string_view prefix)
{
if(input.length() < prefix.length())
Expand Down
1 change: 1 addition & 0 deletions src/tag_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ bool tag_values_match(std::string_view tagA, std::string_view tagB);
std::optional<int> track_duration_in_seconds(const metadb_v2_rec_t& track);

bool track_is_remote(metadb_handle_ptr track);
bool track_exists_on_filesystem(metadb_handle_ptr track);
Loading