abbeycode / UnrarKit

Easily read RAR archives on Mac and iOS
BSD 2-Clause "Simplified" License
313 stars 93 forks source link

Fill hasMultipleVolumes on init #66

Closed aonez closed 6 years ago

aonez commented 6 years ago

https://github.com/abbeycode/UnrarKit/blob/2861c62e6c44569fb0f129e3b0b27fc9b4a70584/Classes/URKArchive.h#L157

Since the multivolume check is now done on init, I think this property should be filled there. Also would be useful to have another property like "firstVolumeNotFound", also filled on init.

I can code it if you think like.

abbeycode commented 6 years ago

What do you mean by "filling" it? It's a dynamic property, querying the archive's volume info when you call it.

aonez commented 6 years ago

I mean remove the dynamic functionality, since in the init we already do the check.

abbeycode commented 6 years ago

That's an interesting idea, thanks. I'll consider it

abbeycode commented 6 years ago

@aonez I was looking into this, and I don't see the spot in init where we were talking about doing this check. Could you send the line number in URKArchive.mm from the current revision of the v2.9 branch?

aonez commented 6 years ago

@abbeycode this is done here:

https://github.com/abbeycode/UnrarKit/blob/4fea60b2b940504e1d14e62720f94158703088c7/Classes/URKArchive.mm#L149-L154

Is that what you asked for? Glad to see beta 10!

abbeycode commented 6 years ago

@aonez That was the block I thought you were talking about, but I don't think it quite tells you if you have a multi-volume archive in all cases. If the archive object is created with the path to the first part of the archive, then this code wouldn't know the difference from a single-volume archive, would it?

aonez commented 6 years ago

You're right @abbeycode, the first part of an old convention naming RAR volume will not match that code, anything else will. Maybe it's safer to leave hasMultipleVolumes as is now.

abbeycode commented 6 years ago

Thanks for the suggestion anyway!