Kodi Community Forum
[RELEASE] - Rating Update v1.3.7 - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Add-ons Help and Support (/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] - Rating Update v1.3.7 (/showthread.php?tid=107331)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31


RE: [RELEASE] - Rating Update - m4x1m - 2012-07-21 18:32

(2012-07-21 17:03)papampi Wrote:  
(2012-07-21 15:52)m4x1m Wrote:  Can you post your advancedsettings.xml content?

here is my advancedsettings.xml

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<advancedsettings>
<splash>false</splash>
<videoscanner>
<ignoreerrors>true</ignoreerrors> <!-- Set to true to silently ignore errors while scanning videos-->
</videoscanner>
   <videodatabase>
        <type>mysql</type>
        <host>192.168.1.14</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
        <name>MyVideos</name>
    </videodatabase>
    <musicdatabase>
        <type>mysql</type>
        <host>192.168.1.14</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
        <name>MyMusic</name>
    </musicdatabase>
<pathsubstitution>
    <substitute>
        <from>special://masterprofile/Thumbnails</from>
        <to>smb://user:pass@PAYAM-UBUNTU/XBMCThumbnails</to>
    </substitute>
</pathsubstitution>
</advancedsettings>

From: http://wiki.xbmc.org/index.php?title=Userdata/advancedsettings.xml
Code:
name

    Not needed by default, and some users report issues when defining the this tag. When not used "MyVideos"+DB number will be used.

Could you try to remove, set None or add the DB number in the name tag in advancedsettings.xml?

Your changes in dbutils.py are not needed the script automatically reads the tag values ​​in advancedsettings.xml!

dbutils.py is not mine and I no way to test the mysql db at this moment. If these steps don't work you must give me some time to install a version of mysql.

EDIT: Try to change last line in dbutils.py
from : return mysql.connector.Connect( host = host, port = port, database = name, user = user, password = pswd )
to: return mysql.connector.Connect( host = host, user = user, password = pswd, database = name, port = port )

just as the last attempt :-D


RE: [RELEASE] - Rating Update - papampi - 2012-07-21 19:13

thanks for trying to help !!!!
I already tested without the <name> in the advacedsettings and same error was there !
also tried your solution to correct the last line and still no go ...
the problem is if also if put my ubuntu ip it gives me error and also with my hostname which is payam-ubntu and also local host all gave me this error :
Code:
21:42:00 T:2665286464   ERROR: return mysql.connector.Connect( host = payam-ubuntu, port = 3306, database = MyVideos60, user = xbmc, password = xbmc )
21:42:00 T:2665286464   ERROR: NameError
21:42:00 T:2665286464   ERROR: :
21:42:00 T:2665286464   ERROR: global name 'payam' is not defined
or :

Code:
21:43:06 T:2732428096   ERROR: global name 'localhost' is not defined


and when change the order in last line
i get this :
Code:
21:49:27 T:2661661504    INFO: -->Python script returned the following error<--
21:49:27 T:2661661504   ERROR: Error Type: <type 'exceptions.IndentationError'>
21:49:27 T:2661661504   ERROR: Error Contents: ('unexpected indent', ('/home/payam/.xbmc/addons/script.ratingupdate/resources/lib/dbutils.py', 68, 9, '         return mysql.connector.Connect( host = host, user = user, password = pswd, database = name, port = port )\n'))
21:49:27 T:2661661504   ERROR: Traceback (most recent call last):
                                              File "/home/payam/.xbmc/addons/script.ratingupdate/resources/lib/ratings_all.py", line 12, in <module>
                                                from dbutils import RawXbmcDb
                                            IndentationError: ('unexpected indent', ('/home/payam/.xbmc/addons/script.ratingupdate/resources/lib/dbutils.py', 68, 9, '         return mysql.connector.Connect( host = host, user = user, password = pswd, database = name, port = port )\n'))
21:49:27 T:2661661504    INFO: -->End of Python script error report<--



RE: [RELEASE] - Rating Update - m4x1m - 2012-07-23 11:23

(2012-07-21 19:13)papampi Wrote:  thanks for trying to help !!!!
I already tested without the <name> in the advacedsettings and same error was there !
also tried your solution to correct the last line and still no go ...
the problem is if also if put my ubuntu ip it gives me error and also with my hostname which is payam-ubntu and also local host all gave me this error :
Code:
21:42:00 T:2665286464   ERROR: return mysql.connector.Connect( host = payam-ubuntu, port = 3306, database = MyVideos60, user = xbmc, password = xbmc )
21:42:00 T:2665286464   ERROR: NameError
21:42:00 T:2665286464   ERROR: :
21:42:00 T:2665286464   ERROR: global name 'payam' is not defined
or :

Code:
21:43:06 T:2732428096   ERROR: global name 'localhost' is not defined


and when change the order in last line
i get this :
Code:
21:49:27 T:2661661504    INFO: -->Python script returned the following error<--
21:49:27 T:2661661504   ERROR: Error Type: <type 'exceptions.IndentationError'>
21:49:27 T:2661661504   ERROR: Error Contents: ('unexpected indent', ('/home/payam/.xbmc/addons/script.ratingupdate/resources/lib/dbutils.py', 68, 9, '         return mysql.connector.Connect( host = host, user = user, password = pswd, database = name, port = port )\n'))
21:49:27 T:2661661504   ERROR: Traceback (most recent call last):
                                              File "/home/payam/.xbmc/addons/script.ratingupdate/resources/lib/ratings_all.py", line 12, in <module>
                                                from dbutils import RawXbmcDb
                                            IndentationError: ('unexpected indent', ('/home/payam/.xbmc/addons/script.ratingupdate/resources/lib/dbutils.py', 68, 9, '         return mysql.connector.Connect( host = host, user = user, password = pswd, database = name, port = port )\n'))
21:49:27 T:2661661504    INFO: -->End of Python script error report<--

Go to: https://skydrive.live.com/?cid=2471A122156584AA&id=2471A122156584AA%21722

Download dbutils.py and replace the old with this new. If works, I'll release a new version!

I've tested with this parameters
Code:
<advancedsettings>
        <videodatabase>
                <type>mysql</type>
                <host>localhost</host>
                <name>MyVideos</name> <!-- Is not really necessary -->
                <port>3306</port>
                <user>xbmc</user>
                <pass>xbmc</pass>
        </videodatabase>
</advancedsettings>

and seems to be working!


RE: [RELEASE] - Rating Update - papampi - 2012-07-23 22:22

(2012-07-23 11:23)m4x1m Wrote:  Go to: https://skydrive.live.com/?cid=2471A122156584AA&id=2471A122156584AA%21722
Download dbutils.py and replace the old with this new. If works, I'll release a new version!
and seems to be working!
Thanks man !
its working now...


RE: [RELEASE] - Rating Update - papampi - 2012-07-23 22:46

when another xbmc access library, Rating Update stops with no error !


RE: [RELEASE] - Rating Update - m4x1m - 2012-07-24 11:26

(2012-07-23 22:46)papampi Wrote:  when another xbmc access library, Rating Update stops with no error !

New Version:
script.ratingupdate-1.2.4.zip

Code:
v 1.2.4:
- Fixed error in dbutils.py that prevented to connect to mysql database.

Try this I've reduced the xbmc.executehttpapi query to only one to prevent the freeze.


RE: [RELEASE] - Rating Update - papampi - 2012-07-29 18:15

Thanks for the fix !
I have a question :
When you start the script it ask if you want to update all your movies if you answer yes then it update all but if you answer no it should only update new movies, right ?
but it wont update at all ...


RE: [RELEASE] - Rating Update - PatrickBateman - 2012-07-30 13:32

Hey,
Quick question, as my movies were scraped using tmdb and therefore many dates are different from IMDB (for some reason tmdb and imdb have drastically different release dates for almost all movies) will this affect the plugin when it tries to update the rating?

For example,
The movie insidious is a 2011 movie on TMDB but s a 2010 movie on imdb. Will this affect this scraper when it runs?

Thanks in advance,
Pat~


RE: [RELEASE] - Rating Update - m4x1m - 2012-07-31 13:41

(2012-07-29 18:15)papampi Wrote:  Thanks for the fix !
I have a question :
When you start the script it ask if you want to update all your movies if you answer yes then it update all but if you answer no it should only update new movies, right ?
but it wont update at all ...

The confirmation is only for prevent an erroneous start, you can disable it in the add-on settings. When you answer no, the script come back to the menu without scanning movies.
(2012-07-30 13:32)PatrickBateman Wrote:  Hey,
Quick question, as my movies were scraped using tmdb and therefore many dates are different from IMDB (for some reason tmdb and imdb have drastically different release dates for almost all movies) will this affect the plugin when it tries to update the rating?

For example,
The movie insidious is a 2011 movie on TMDB but s a 2010 movie on imdb. Will this affect this scraper when it runs?

Thanks in advance,
Pat~

How it works
Use the IMDbPHP Class locally to retrieve only the actual ratings and top250 without additional data. The XBMC database is only updated if necessary. The searches are made ​​through IMDb ID, if in your database doesn't exist IMDb ID the script will fail.

I don't think that TMDB uses an IMDB ID, please be careful!


RE: [RELEASE] - Rating Update - adsi - 2012-08-10 05:19

Hi~ m4x1m

Some questions need your answer, thank you.

1.I use nfo files to inport imdb scraper data into xbmc's database, if i install your add-on and scan all the movies successfully then export them to nfo files(separate method), it'll only change "rate" in nfo files, not include my movie title or others, right?

2.If i execute "clean library" in order to remove some un-exist movies due to wrong patch or rename folder case, will imdb rate still keep in the lastest update value?

PS.In fact, i'm confused that why movies still can be shown in XBMC when i execute "clean library" except for not export to nfo file movies, it's very strange for me.


RE: [RELEASE] - Rating Update - m4x1m - 2012-08-10 12:48

(2012-08-10 05:19)adsi Wrote:  1.I use nfo files to inport imdb scraper data into xbmc's database, if i install your add-on and scan all the movies successfully then export them to nfo files(separate method), it'll only change "rate" in nfo files, not include my movie title or others, right?

Use the IMDbPHP Class locally to retrieve only the actual ratings and top250 without additional data.

Yes, only rate and voters number will be upgraded

(2012-08-10 05:19)adsi Wrote:  2.If i execute "clean library" in order to remove some un-exist movies due to wrong patch or rename folder case, will imdb rate still keep in the lastest update value?

PS.In fact, i'm confused that why movies still can be shown in XBMC when i execute "clean library" except for not export to nfo file movies, it's very strange for me.

When you use "clean library" xbmc will remove all movies that are no more in the path of scan. If you do a reimport from an nfo files with a not updated rate probably it will be different, if you do a scrape from internet the rate will be updated.


RE: [RELEASE] - Rating Update - Vaikin - 2012-08-17 20:58

A faster way to update fields, way less code and maybe safer(as it doesn't involve directly querying the database):

Code:
json_response = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.SetMovieDetails", "params": { "movieid" : %s, "rating" : %s, "votes" : "%s" }, "id": %s}' % (movieId, float(rating), votes, movieId))
json_response = unicode(json_response, 'utf-8', errors='ignore')
jsonobject = simplejson.loads(json_response)

Just a thought.


RE: [RELEASE] - Rating Update - skullmonkey - 2012-08-18 16:34

How do you run this script/addon? I installed it and nothing happened. The ratings are still incorrect.

Thanks,
S@


RE: [RELEASE] - Rating Update - solidsatras - 2012-08-18 19:00

(2012-08-18 16:34)skullmonkey Wrote:  How do you run this script/addon? I installed it and nothing happened. The ratings are still incorrect.
Thanks,
S@

by following the instructions in the first post


RE: [RELEASE] - Rating Update - skullmonkey - 2012-08-18 20:44

(2012-08-18 19:00)solidsatras Wrote:  
(2012-08-18 16:34)skullmonkey Wrote:  How do you run this script/addon? I installed it and nothing happened. The ratings are still incorrect.
Thanks,
S@

by following the instructions in the first post

Still dont get it. I need fix that will only need the actual XBMC to fix the rating. This need installind... coding...