Year is empty if 0

CQTexperiment
vspader 2006-05-12 21:49:51 +00:00
parent 8b1027b63e
commit 269cd05b5f
2 changed files with 15 additions and 7 deletions

View File

@ -18,7 +18,7 @@
NSString *title; NSString *title;
NSString *genre; NSString *genre;
unsigned int year; NSString *year;
unsigned int track; unsigned int track;
NSString *lengthString; NSString *lengthString;
@ -61,8 +61,8 @@
- (NSString *)lengthString; - (NSString *)lengthString;
- (void)setLengthString:(double)l; - (void)setLengthString:(double)l;
-(void)setYear:(int)y; -(void)setYear:(NSString *)y;
-(int)year; -(NSString *)year;
-(void)setTrack:(int)y; -(void)setTrack:(int)y;
-(int)track; -(int)track;

View File

@ -186,11 +186,19 @@
return genre; return genre;
} }
- (void)setYear:(int)y - (void)setYear:(NSString *)y
{ {
[y retain];
[year release];
if ([y intValue] == 0)
{
y = @"";
}
year = y; year = y;
} }
- (int)year - (NSString *)year
{ {
return year; return year;
} }
@ -300,7 +308,7 @@
pGenre = taglib_tag_genre(tag); pGenre = taglib_tag_genre(tag);
pComment = taglib_tag_comment(tag); pComment = taglib_tag_comment(tag);
[self setYear:taglib_tag_year(tag)]; [self setYear:[[NSNumber numberWithInt:taglib_tag_year(tag)] stringValue]];
[self setTrack:taglib_tag_track(tag)]; [self setTrack:taglib_tag_track(tag)];
@ -355,7 +363,7 @@
[self setArtist:[a objectAtIndex:2]]; [self setArtist:[a objectAtIndex:2]];
[self setAlbum:[a objectAtIndex:3]]; [self setAlbum:[a objectAtIndex:3]];
[self setGenre:[a objectAtIndex:4]]; [self setGenre:[a objectAtIndex:4]];
[self setYear:[[a objectAtIndex:5] intValue]]; [self setYear:[[a objectAtIndex:5] stringValue]];
[self setTrack:[[a objectAtIndex:6] intValue]]; [self setTrack:[[a objectAtIndex:6] intValue]];
} }