Skip to content

Improved detection of Sony TV models #5718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 21, 2018
Merged

Improved detection of Sony TV models #5718

merged 5 commits into from
Mar 21, 2018

Conversation

JanMachEU
Copy link
Contributor

@JanMachEU JanMachEU commented Mar 19, 2018

RegEx now detects
SONY KDL-65W859C as KDL-65W859
Mozilla/5.0 (Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36 OPR/22.0.1481.0 OMI/4.2.12.48.ALSAN3.122 HbbTV/1.2.1 (; Sony; KDL-65W859C; v3.925; 2015;) sony.hbbtv.tv.2015HE

SONY KD-55XD8577 as KD-55XD8577
Mozilla/5.0 (Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36 OPR/22.0.1481.0 OMI/4.2.12.48.ALSAN3.122 HbbTV/1.2.1 (; Sony; KD-55XD8577; v3.925; 2015;) sony.hbbtv.tv.2015HE

RegEx now detects 
SONY KDL-65W859C
SONY KD-55XD8577
@@ -213,7 +213,7 @@ Sony:
regex: 'Sony'
device: 'tv'
models:
- regex: '(KDL[0-9]{2}[A-Z]{1,2}[0-9]{3})'
- regex: '(KD[L\-]{0,2}[0-9]{2}[A-Z]{1,2}[0-9]{3,4}[A-Z]{0,1})'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KD[L\-]{0,2}

This might match incorrect stuff, as it also matches KDLL, KD-L or KD-- Guess it should match KDL, KDL-, KD and KD-, so try KDL?-?

And instead of {0,1} your could simply use a ?

@JanMachEU
Copy link
Contributor Author

Thank you for Your help. I'm new to regex but I need this for work.

@JanMachEU
Copy link
Contributor Author

JanMachEU commented Mar 20, 2018

RegEx now ignores last letter(not numeric) in KDL-65W859C -> KDL-65W859 so it does not conflict with other models.

@sgiehl
Copy link
Member

sgiehl commented Mar 21, 2018

I've added the user agents you mentioned above as new tests to prove they will work in the future.

@sgiehl sgiehl merged commit 0ae81f8 into matomo-org:master Mar 21, 2018
@JanMachEU
Copy link
Contributor Author

Thank You for Your help. :)

@JanMachEU JanMachEU deleted the patch-1 branch March 22, 2018 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants