tvOS: fix a crash when a history playlist item does not have a label (#16336)

This commit is contained in:
Eric Warmenhoven 2024-03-06 17:37:11 -05:00 committed by GitHub
parent 89c6e23f5f
commit 0e8d60ba3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -905,7 +905,8 @@ static NSDictionary *topshelfDictForEntry(const struct playlist_entry *entry, gf
{
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:@{
@"id": [NSString stringWithUTF8String:entry->path],
@"title": [NSString stringWithUTF8String:entry->label],
@"title": [NSString stringWithUTF8String:
(string_is_empty(entry->label) ? path_basename(entry->path) : entry->label)],
}];
if (!string_is_empty(path_data->content_db_name))
{