From 9324d4bb226a730f4aad3aad9a61e18c36eb6ae5 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 12 Apr 2013 14:26:13 +0200 Subject: [PATCH] Adjusted file name for Newsstand or Opt-In reports --- Core/Source/DTITCFunctions.m | 2 +- Core/Source/DTITCReportDownloader.m | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Core/Source/DTITCFunctions.m b/Core/Source/DTITCFunctions.m index 878c036..3ce8980 100644 --- a/Core/Source/DTITCFunctions.m +++ b/Core/Source/DTITCFunctions.m @@ -173,4 +173,4 @@ ITCReportDateType reportDateTypeFromString(NSString *reportDateTypeString) return @"yyyy"; } } -} \ No newline at end of file +} diff --git a/Core/Source/DTITCReportDownloader.m b/Core/Source/DTITCReportDownloader.m index 9e239c3..e0c8d8d 100644 --- a/Core/Source/DTITCReportDownloader.m +++ b/Core/Source/DTITCReportDownloader.m @@ -189,10 +189,17 @@ - (NSString *)predictedFileNameForDate:(NSDate *)date { NSMutableString *retString = [NSMutableString string]; - // always Sales (or is this - [retString appendString:@"S"]; + NSString *reportTypeString = [NSStringFromITCReportType(reportType) substringToIndex:1]; + [retString appendString:reportTypeString]; [retString appendString:@"_"]; + + if (reportType != ITCReportTypeSales) + { + NSString *reportSubTypeString = [NSStringFromITCReportSubType(reportSubType) substringToIndex:1]; + [retString appendString:reportSubTypeString]; + [retString appendString:@"_"]; + } NSString *dateTypeString = NSStringFromITCReportDateType(reportDateType);