DeviceDetector.NET icon indicating copy to clipboard operation
DeviceDetector.NET copied to clipboard

Updating regexes from the PHP project now produces runtime errors

Open echodreamz opened this issue 3 years ago • 2 comments

The latest yml files from the PHP project now include a versions property in the oss.yml file.

` #webOS

regex: '(?:Web0S; .*WEBOS|webOS|web0S|Palm webOS|hpwOS)(?:[/]?(\d+[.\d]+))?' name: 'webOS' version: '$1' versions: regex: 'WEBOS(\d+[.\d]+)' version: '$1' regex: 'Web0S; Linux/SmartTV.+Chrome/68' version: '5' regex: 'Web0S; Linux/SmartTV.+Chrome/53' ` This causes runtime errors stating that Class.Os does not contain a "versions" property. To get around this, I simply added...

[YamlMember(Alias = "versions")] public Os[] Versions { get; set; }

And the runtime error goes away, though, this is definitely not the correct fix.

echodreamz avatar Dec 23 '21 17:12 echodreamz

https://github.com/matomo-org/device-detector/releases/tag/5.0.0

sanchezzzhak avatar Jan 19 '22 10:01 sanchezzzhak

Hello @echodreamz I am interested on how can I use the regexes from PHP project, the mobiles.yml file. I am Angular developer so my knowledge here is limited. Is there an easy way to include that file if you are importing the project using Nuget Packages?

fpl1976 avatar Jun 21 '22 10:06 fpl1976

Hi @echodreamz , @sanchezzzhak , @fpl1976 ,

I just release new version v6.1.0, check this version.

Thanks 👍

totpero avatar Mar 05 '23 18:03 totpero