mamburu: Better titles for game music containers

This commit is contained in:
Chris Moeller 2013-10-11 05:48:19 -07:00
parent eab60596eb
commit 74db595a2d

View file

@ -81,10 +81,18 @@
gme_delete(emu);
NSDictionary * dict = [NSDictionary dictionaryWithObjectsAndKeys:
NSString *title = [NSString stringWithUTF8String: info->song];
if (!title || ![title length])
{
// this is needed to distinguish between different tracks in NSF, for example
// otherwise they will all be displayed as 'blahblah.nsf' in playlist
title = [[url lastPathComponent] stringByAppendingFormat:@" [%d]", track_num];
}
NSDictionary * dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithUTF8String: info->system], @"genre",
[NSString stringWithUTF8String: info->game], @"album",
[NSString stringWithUTF8String: info->song], @"title",
title, @"title",
[NSString stringWithUTF8String: info->author], @"artist",
[NSNumber numberWithInt:track_num+1], @"track",
nil];