Solved Make "Votes" a integer (even if only in the Smart Playlist editor)
#1
Is it possible to make the variable "Votes" an integer? Presently it is useless for anything other than looking at.

It cannot be used in smart playlists in any capacity (unless you have some bizarre need to find only movies that have exactly 13,223 votes, and not even 13223)

"Votes" are acknowledged as being a number, right? So exactly how is it useful to have only
Code:
is
is not
contains
does not contain
starts with
ends with
as smart playlist comparators?

I can understand how it makes sense to keep it a string so that it looks nice displayed as a label, so maybe it could just be a number as far as the smart playlist editor is concerned?
So that we could use it as way to filter "Blockbusters", you know, "Votes > 60,000", or as a way to find old data that should be re-scraped "Votes < 100"?

Skinners and users alike have been having issues with this forever, are there plans to resolve this?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#2
makes sense to make it an int. In some countries they use a . as thousand separate so you already need to take in account 60,000 or 60.000
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
Will the new database updates have the effect of fixing this at some point?

Image

This screenshot is from 15.0 beta 2.
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#4
Nothing has changed afaik
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#5
I support this "Feature request"!

Having 'votes' stored as string with ',' or '.' feels like a bug to me, as there should be no presentation logic in the database.
As a workaround i changed the views for movies and tvshows in the MySQL DB to use votes as integer. Seems to be working fine on Isengard RC1 and Aeon MQ5 MOD.
Reply
#6
Too late to make it into 15?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#7
Yep, but v16 is planned for the end of the year, so there is hope :)
Reply
#8
Image

for 16. Smile

Thanks guys.
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#9
For the time being i changed the 'movie_view' view in the MySQL database like this:

Code:
select `MyVideos93`.`movie`.`idMovie` AS `idMovie`,`MyVideos93`.`movie`.`idFile` AS `idFile`,`MyVideos93`.`movie`.`c00` AS `c00`,`MyVideos93`.`movie`.`c01` AS `c01`,`MyVideos93`.`movie`.`c02` AS `c02`,`MyVideos93`.`movie`.`c03` AS `c03`,cast(replace(`MyVideos93`.`movie`.`c04`,',','') as unsigned) AS `c04`,`MyVideos93`.`movie`.`c05` AS `c05`,`MyVideos93`.`movie`.`c06` AS `c06`,`MyVideos93`.`movie`.`c07` AS `c07`,`MyVideos93`.`movie`.`c08` AS `c08`,`MyVideos93`.`movie`.`c09` AS `c09`,`MyVideos93`.`movie`.`c10` AS `c10`,`MyVideos93`.`movie`.`c11` AS `c11`,`MyVideos93`.`movie`.`c12` AS `c12`,`MyVideos93`.`movie`.`c13` AS `c13`,`MyVideos93`.`movie`.`c14` AS `c14`,`MyVideos93`.`movie`.`c15` AS `c15`,`MyVideos93`.`movie`.`c16` AS `c16`,`MyVideos93`.`movie`.`c17` AS `c17`,`MyVideos93`.`movie`.`c18` AS `c18`,`MyVideos93`.`movie`.`c19` AS `c19`,`MyVideos93`.`movie`.`c20` AS `c20`,`MyVideos93`.`movie`.`c21` AS `c21`,`MyVideos93`.`movie`.`c22` AS `c22`,`MyVideos93`.`movie`.`c23` AS `c23`,`MyVideos93`.`movie`.`idSet` AS `idSet`,`MyVideos93`.`sets`.`strSet` AS `strSet`,`MyVideos93`.`files`.`strFilename` AS `strFileName`,`MyVideos93`.`path`.`strPath` AS `strPath`,`MyVideos93`.`files`.`playCount` AS `playCount`,`MyVideos93`.`files`.`lastPlayed` AS `lastPlayed`,`MyVideos93`.`files`.`dateAdded` AS `dateAdded`,`MyVideos93`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,`MyVideos93`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds` from ((((`MyVideos93`.`movie` left join `MyVideos93`.`sets` on((`MyVideos93`.`sets`.`idSet` = `MyVideos93`.`movie`.`idSet`))) join `MyVideos93`.`files` on((`MyVideos93`.`files`.`idFile` = `MyVideos93`.`movie`.`idFile`))) join `MyVideos93`.`path` on((`MyVideos93`.`path`.`idPath` = `MyVideos93`.`files`.`idPath`))) left join `MyVideos93`.`bookmark` on(((`MyVideos93`.`bookmark`.`idFile` = `MyVideos93`.`movie`.`idFile`) and (`MyVideos93`.`bookmark`.`type` = 1))))

The 'tvshow_view' view is modified the same way (using the 'c03' column of course).

I am running multiple instances of Kodi 15.0 with Aeon MQ5 Isengard MOD. So far no side effects, a proper change should be easy then - i hope!

Edit: The Playlists still have to be created manually of course, like this (for Top TV Shows):

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="tvshows">
    <name>Top TV Shows</name>
    <match>all</match>
    <rule field="votes" operator="greaterthan">
        <value>1000</value>
    </rule>
    <limit>50</limit>
    <order direction="descending">rating</order>
</smartplaylist>
Reply
#10
(2015-07-21, 09:25)Ned Scott Wrote: Yep, but v16 is planned for the end of the year, so there is hope Smile

Still a chance?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#11
probably
Reply
#12
Someone is working on it? Because I can try to fix this since it's not a difficult change..
Reply
#13
(2015-09-15, 19:24)phate89 Wrote: Someone is working on it? Because I can try to fix this since it's not a difficult change..

afaik no one.
You are free to try and if have any questions don't hesitate to ask. Smile
All it takes is just some one who willing to look at it and get the job done.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#14
(2015-09-15, 19:26)Martijn Wrote: afaik no one.
You are free to try and if have any questions don't hesitate to ask. Smile

I was actually looking into something strictly related (add more than one rating in kodi library). I'm not sure if I found a good solution and if I will be able to finish it so I thought I can start to move votes as integer since I already tackled it there.
I can create a new "votes" column in movie, tvshow and episode tables and fill it with the parsed votes but I have a question. What do I do with the old cXX field? Kodi always parses all as string and needs to put it in a variable. Do I simply leave the column and "m_strVotes" variable and add a new "m_iVotes" variable?
Reply
#15
Create the pull request and I'll kick some devs your way
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply

Logout Mark Read Team Forum Stats Members Help
Make "Votes" a integer (even if only in the Smart Playlist editor)0