Merge pull request #315 from cewert/issue313

Hide the star icon when community rating is invalid
This commit is contained in:
Anthony Lavado 2020-11-29 13:02:43 -05:00 committed by GitHub
commit 704ee3abe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -31,9 +31,15 @@ sub itemContentChanged()
m.top.overhangTitle = itemData.name
setFieldText("releaseYear", itemData.productionYear)
setFieldText("officialRating", itemData.officialRating)
setFieldText("communityRating", itemData.communityRating)
setFieldText("overview", itemData.overview)
if itemData.communityRating <> invalid then
setFieldText("communityRating", itemData.communityRating)
else
' hide the star icon
m.top.findNode("communityRatingGroup").visible = false
end if
if itemData.CriticRating <> invalid then
setFieldText("criticRatingLabel" , itemData.criticRating)
if itemData.CriticRating > 60 then

View File

@ -10,7 +10,7 @@
<Label id="releaseYear" />
<Label id="runtime" />
<Label id="officialRating" />
<LayoutGroup layoutDirection="horiz" itemSpacings="[-5]">
<LayoutGroup id="communityRatingGroup" layoutDirection="horiz" itemSpacings="[-5]">
<Poster id="star" uri="pkg:/images/sharp_star_white_18dp.png" height="32" width="32" blendColor="#cb272a" />
<Label id="communityRating" />
</LayoutGroup>