diff --git a/libtransmission/metainfo.c b/libtransmission/metainfo.c index 57d788563..83c4e3518 100644 --- a/libtransmission/metainfo.c +++ b/libtransmission/metainfo.c @@ -221,6 +221,7 @@ int tr_metainfoParse( tr_info_t * inf, const char * path, val = tr_bencDictFind( beInfo, "name" ); strcatUTF8( inf->name, val->val.s.s ); + inf->multifile = 1; inf->fileCount = list->val.l.count; inf->files = calloc( inf->fileCount * sizeof( tr_file_t ), 1 ); @@ -243,6 +244,7 @@ int tr_metainfoParse( tr_info_t * inf, const char * path, else { /* Single-file mode */ + inf->multifile = 0; inf->fileCount = 1; inf->files = calloc( sizeof( tr_file_t ), 1 ); diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index d97e5f000..ace6dd87c 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -261,6 +261,7 @@ struct tr_info_s uint8_t * pieces; /* Files info */ + int multifile; int fileCount; tr_file_t * files; }; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 076e01698..cab0b4823 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -571,7 +571,7 @@ fRatioLimit = ratioLimit ? [ratioLimit floatValue] : [fDefaults floatForKey: @"RatioLimit"]; fFinishedSeeding = NO; - NSString * fileType = ( fInfo->fileCount > 1 ) ? + NSString * fileType = fInfo->multifile ? NSFileTypeForHFSTypeCode('fldr') : [[self name] pathExtension]; fIcon = [[NSWorkspace sharedWorkspace] iconForFileType: fileType]; [fIcon retain];