~tom-gall/+junk/ubuntuone-ios-music

« back to all changes in this revision

Viewing changes to Models/Song.m

  • Committer: Zachery Bir
  • Date: 2012-02-22 19:14:07 UTC
  • mfrom: (215.1.74 fixes-for-release)
  • Revision ID: zachery.bir@canonical.com-20120222191407-8nv37f9n45we1grp
Tags: 2.2-release
Merged ALL THE BRANCHES prior to 2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#import "Artist.h"
18
18
#import "Album.h"
19
19
#import "NSString+Extras.h"
 
20
#import "U1CacheFileManager.h"
20
21
 
21
22
@implementation Song
22
23
 
48
49
        }
49
50
}
50
51
 
51
 
- (NSURL*)cachedSongURL
52
 
{
53
 
        return [CachedMusicDirectory() URLByAppendingPathComponent:self.songId];
54
 
}
55
 
 
56
52
- (BOOL)cachedSongExists
57
53
{
58
 
        return self.cachedSongPath != nil;
 
54
        return [[U1CacheFileManager sharedCacheFileManager] cachedPathForFileId:self.idPath offline:NULL] != nil;
59
55
}
60
56
 
61
57
- (NSComparisonResult)compare:(Song*)s
93
89
    return [self.title dearticlizedString];
94
90
}
95
91
 
 
92
- (NSString*)idPath;
 
93
{
 
94
        NSArray *components = [NSArray arrayWithObjects:
 
95
                                                   self.artist,
 
96
                                                   self.album,
 
97
                                                   self.songId,
 
98
                                                   nil];
 
99
        return [NSString pathWithComponents:components]; 
 
100
}
 
101
 
96
102
@end