Skip to content

prepare_input strips all special characters, resulting in empty name_lower for certain track names (e.g., ?) #80

@lesydimitri

Description

@lesydimitri

Problem Description

Searches for tracks whose titles consist solely of special characters fail to return any matches.

Example affected track

  • Title: ?
  • Artist: Outkast
  • Album: Stankonia

Database inspection

After downloading the latest SQLite dump, I examined the entries for these tracks. All affected entries have an empty name_lower field:

SELECT id, name, name_lower, artist_name, artist_name_lower, album_name, album_name_lower, duration, last_lyrics_id, created_at, updated_at
FROM tracks
WHERE artist_name = "Outkast" AND name = "?";
id name name_lower artist_name artist_name_lower album_name album_name_lower duration last_lyrics_id created_at updated_at
4195533 ? Outkast outkast Stankonia (20th Anniversary Edition) [Deluxe] (Deluxe Version) stankonia 20th anniversary edition deluxe deluxe version 89.0 1847333 2023-11-07 23:48:20.373+00:00 2022-11-14 11:46:45.978+00:00
4867163 ? Outkast outkast Original Album Classics original album classics 89.0 2082217 2023-12-13 05:01:08.299+00:00 2022-11-14 11:46:45.978+00:00
8903481 ? Outkast outkast 1999 - Stankonia 1999 stankonia 89.0 3608804 2024-04-28 02:36:21.302+00:00 2022-11-14 11:46:45.978+00:00
9206686 ? Outkast outkast Stankonia (Deluxe Version) stankonia deluxe version 89.0 3870394 2024-05-18 12:27:37.962822473+00:00 2024-05-18 12:27:37.962822473+00:00
11932871 ? Outkast outkast Stankonia (20th Anniversary Edition) [Deluxe] stankonia 20th anniversary edition deluxe 89.0 6600635 2024-08-30 06:04:05.740215130+00:00 2024-08-30 06:04:05.740215130+00:00
13151573 ? Outkast outkast Stankonia (20th Anniversary) stankonia 20th anniversary 88.626667 7820875 2024-10-11 17:53:25.834091356+00:00 2024-10-11 17:53:25.834091356+00:00

Lyrics table check

Synced lyrics do exist for these tracks in the lyrics table:

SELECT id, plain_lyrics, synced_lyrics, track_id, has_plain_lyrics, has_synced_lyrics, instrumental, source, created_at, updated_at
FROM lyrics
WHERE track_id = 4195533;
id plain_lyrics synced_lyrics track_id has_plain_lyrics has_synced_lyrics instrumental source created_at updated_at
1847333 (Andre 3000) Want can make ... [00:17.58] (Andre 3000) [00:19.69] Want can make ... 4195533 1 1 0 2023-11-07 23:48:20.373+00:00 2022-11-14 11:46:45.978+00:00

Possible cause

It appears that the prepare_input function strips special characters from track names.
For titles consisting solely of special characters (like ?), this results in an empty string. Therefore, the matching logic that relies on track_lower fails, making these tracks impossible to find during searches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions