Commas being removed from ratings (number of votes)
#1
Can someone from Team Kodi tell me why ratings are being incorrectly formatted with the upgrade to Isengard?

I am told these values are stored in a Kodi database. Using this addon, ratings are losing the comma delineation, making 100,000 votes appear as 100000. Commas are removed for all titles.

Is there any way to reverse this behavior at the addon level or within the code for the main branch?
Reply
#2
(2015-06-29, 23:22)Warner306 Wrote: Can someone from Team Kodi tell me why ratings are being incorrectly formatted with the upgrade to Isengard?

They're not. I've got several databases here that have all been upgraded with Isengard and they all have votes formatted with commas.

If you're losing your commas, it's most likely due to some add-on you are using that is storing plain numeric values without the commas.

Whether commas should be stored, or even the votes stored as a string, is a more interesting question...

(2015-06-29, 23:22)Warner306 Wrote: I am told these values are stored in a Kodi database. Using this addon, ratings are losing the comma delineation, making 100,000 votes appear as 100000. Commas are removed for all titles.

Is there any way to reverse this behavior at the addon level or within the code for the main branch?

And there's your problem. Since that addon queries omdbapi.com for updated votes, and the add-on neither adds or removes commas, it's pretty clear the problem is that omdbapi.com now returns votes without commas (I think it returned votes with commas in the past) and this add-on is now storing comma-free vote values into your database.

Here's an example omdbapi.com - note "imdbVotes":"338369", sans commas.

You might want to suggest to the add-on maintainer that they add in the now missing commas, but this is a less than ideal solution for users that don't use commas as a numeric grouping. Perhaps the add-on could format the number according to the users regional setting before storing the resulting value in the database.

The better, and more correct, long-term solution for Kodi would be to never store commas in the votes field even when the source data includes them, and in fact the votes should be stored as plain integers and not strings at all.

Once votes are held as a plain number, the votes value should be formatted with the users regional numeric grouping whenever it is displayed in the GUI, although this then might become a skin issue.

In the short term, you need an updated add-on. Note that the script in my sig can also be used (texturecache.py imdb movies), and it will add the missing commas.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#3
Thanks,

This information has been passed on to the addon creator.
Reply
#4
(2015-06-30, 04:16)Milhouse Wrote:
(2015-06-29, 23:22)Warner306 Wrote: Can someone from Team Kodi tell me why ratings are being incorrectly formatted with the upgrade to Isengard?

They're not. I've got several databases here that have all been upgraded with Isengard and they all have votes formatted with commas.

If you're losing your commas, it's most likely due to some add-on you are using that is storing plain numeric values without the commas.

Whether commas should be stored, or even the votes stored as a string, is a more interesting question...

(2015-06-29, 23:22)Warner306 Wrote: I am told these values are stored in a Kodi database. Using this addon, ratings are losing the comma delineation, making 100,000 votes appear as 100000. Commas are removed for all titles.

Is there any way to reverse this behavior at the addon level or within the code for the main branch?

And there's your problem. Since that addon queries omdbapi.com for updated votes, and the add-on neither adds or removes commas, it's pretty clear the problem is that omdbapi.com now returns votes without commas (I think it returned votes with commas in the past) and this add-on is now storing comma-free vote values into your database.

Here's an example omdbapi.com - note "imdbVotes":"338369", sans commas.

You might want to suggest to the add-on maintainer that they add in the now missing commas, but this is a less than ideal solution for users that don't use commas as a numeric grouping. Perhaps the add-on could format the number according to the users regional setting before storing the resulting value in the database.

The better, and more correct, long-term solution for Kodi would be to never store commas in the votes field even when the source data includes them, and in fact the votes should be stored as plain integers and not strings at all.

Once votes are held as a plain number, the votes value should be formatted with the users regional numeric grouping whenever it is displayed in the GUI, although this then might become a skin issue.

In the short term, you need an updated add-on. Note that the script in my sig can also be used (texturecache.py imdb movies), and it will add the missing commas.

first: yeah, xbmc should store votes as numeric values, where can I vote for it? Wink

I play around with the python locale library and can't get the formatting to get it right:

Code:
import locale
locale.setlocale( locale.LC_ALL, '' )
'{:n}'.format(1000000)

will work in the python shell but not in xbmc, for some reaseon the locale will never be set.
how do you solve this problem?
Reply
#5
(2015-06-30, 23:26)Jandalf Wrote: first: yeah, xbmc should store votes as numeric values, where can I vote for it? Wink

I think you just did. Smile

(2015-06-30, 23:26)Jandalf Wrote: I play around with the python locale library and can't get the formatting to get it right:

I don't know the answer, unfortunately, but you may have more luck asking in the Add-ons section.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply

Logout Mark Read Team Forum Stats Members Help
Commas being removed from ratings (number of votes)0