jdel / sspks

A very simple Synology Package Server, reverse engineered from the official Synology package repository and SynoCommunity.
GNU General Public License v3.0
258 stars 64 forks source link

Fix metadata beta determination #51

Closed itn3rd77 closed 6 years ago

itn3rd77 commented 6 years ago

The if clause always returned false because the value of $this->metadata['beta'] is yes. I have replaced the in_array check with the already existing check $this->parseBool.

Now a beta package is correctly show as Beta in the Synology Package Center.

jdel commented 6 years ago

LGTM. @mbirth, does that make sense to you ? According to the synology documentation, beta should be set to yes in the INFO file. Any other value assumes it's false.

jdel commented 6 years ago

Just seen this while going quickly through tests. Why don't we move this logic in the isBeta() method and use it ?

It is used in the tests but nowhere in the code.

The package filter could also be amended to use isBeta()

@mbirth: what do you think ? Any reason why isBeta is not used other than in tests ?

itn3rd77 commented 6 years ago

I have seen this method but didn't want to dig to deep into the code. Seem reasonable to me to use this method. Is there any reason why $this->collectMetadata(); is not called once in the constructor but in nearly every method inside Package.php?

Should I refactor and update my pull request?

jdel commented 6 years ago

@itn3rd77 : Most of the code you see here, if not all has been written by @mbirth.

I'd like his input before we start refactoring heavily.