[RELEASE] - Rating Update v1.3.7

  Thread Rating:
  • 4 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
m4x1m Offline
Fan
Posts: 311
Joined: Mar 2011
Reputation: 22
Location: Italy
Post: #151
(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=Use...ttings.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

LG M227WD - ASUS S1-AT5NM10E - LOGITECH HARMONY 300i - MINI KEYBOARD USB
Running Ubuntu Precise 12.04.04 - FRODO 12.03 - Transparency!
Movies: 996 - TV Show: 98 - Albums: 1161

My Script: Rating Update - Thumbnails Cleaner
(This post was last modified: 2012-07-21 18:42 by m4x1m.)
find quote
papampi Offline
Senior Member
Posts: 169
Joined: Feb 2005
Reputation: 0
Post: #152
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<--

Proud xbmp/xbmc user since early days of 1st gen xbox

XBMC on :
Tronsmart S89 Quad Core - AMLinux
Atv1 + Crystall HD - Crystalbuntu
Raspberry Pi - Openelec
Xios DS - Linux the-hydra
1st gen xbox, JB Atv2, Ouya, ...
(This post was last modified: 2012-07-21 19:22 by papampi.)
find quote
m4x1m Offline
Fan
Posts: 311
Joined: Mar 2011
Reputation: 22
Location: Italy
Post: #153
(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=2471A1221...84AA%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!

LG M227WD - ASUS S1-AT5NM10E - LOGITECH HARMONY 300i - MINI KEYBOARD USB
Running Ubuntu Precise 12.04.04 - FRODO 12.03 - Transparency!
Movies: 996 - TV Show: 98 - Albums: 1161

My Script: Rating Update - Thumbnails Cleaner
find quote
papampi Offline
Senior Member
Posts: 169
Joined: Feb 2005
Reputation: 0
Post: #154
(2012-07-23 11:23)m4x1m Wrote:  Go to: https://skydrive.live.com/?cid=2471A1221...84AA%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...

Proud xbmp/xbmc user since early days of 1st gen xbox

XBMC on :
Tronsmart S89 Quad Core - AMLinux
Atv1 + Crystall HD - Crystalbuntu
Raspberry Pi - Openelec
Xios DS - Linux the-hydra
1st gen xbox, JB Atv2, Ouya, ...
(This post was last modified: 2012-07-24 09:00 by papampi.)
find quote
papampi Offline
Senior Member
Posts: 169
Joined: Feb 2005
Reputation: 0
Post: #155
when another xbmc access library, Rating Update stops with no error !

Proud xbmp/xbmc user since early days of 1st gen xbox

XBMC on :
Tronsmart S89 Quad Core - AMLinux
Atv1 + Crystall HD - Crystalbuntu
Raspberry Pi - Openelec
Xios DS - Linux the-hydra
1st gen xbox, JB Atv2, Ouya, ...
(This post was last modified: 2012-07-24 09:03 by papampi.)
find quote
m4x1m Offline
Fan
Posts: 311
Joined: Mar 2011
Reputation: 22
Location: Italy
Post: #156
(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.

LG M227WD - ASUS S1-AT5NM10E - LOGITECH HARMONY 300i - MINI KEYBOARD USB
Running Ubuntu Precise 12.04.04 - FRODO 12.03 - Transparency!
Movies: 996 - TV Show: 98 - Albums: 1161

My Script: Rating Update - Thumbnails Cleaner
find quote
papampi Offline
Senior Member
Posts: 169
Joined: Feb 2005
Reputation: 0
Post: #157
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 ...

Proud xbmp/xbmc user since early days of 1st gen xbox

XBMC on :
Tronsmart S89 Quad Core - AMLinux
Atv1 + Crystall HD - Crystalbuntu
Raspberry Pi - Openelec
Xios DS - Linux the-hydra
1st gen xbox, JB Atv2, Ouya, ...
find quote
PatrickBateman Offline
Posting Freak
Posts: 1,676
Joined: Mar 2011
Reputation: 17
Location: Another Earth
Post: #158
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~
find quote
m4x1m Offline
Fan
Posts: 311
Joined: Mar 2011
Reputation: 22
Location: Italy
Post: #159
(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!

LG M227WD - ASUS S1-AT5NM10E - LOGITECH HARMONY 300i - MINI KEYBOARD USB
Running Ubuntu Precise 12.04.04 - FRODO 12.03 - Transparency!
Movies: 996 - TV Show: 98 - Albums: 1161

My Script: Rating Update - Thumbnails Cleaner
(This post was last modified: 2012-07-31 13:49 by m4x1m.)
find quote
adsi Offline
Member
Posts: 84
Joined: Oct 2011
Reputation: 0
Post: #160
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.
(This post was last modified: 2012-08-10 05:44 by adsi.)
find quote
m4x1m Offline
Fan
Posts: 311
Joined: Mar 2011
Reputation: 22
Location: Italy
Post: #161
(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.

LG M227WD - ASUS S1-AT5NM10E - LOGITECH HARMONY 300i - MINI KEYBOARD USB
Running Ubuntu Precise 12.04.04 - FRODO 12.03 - Transparency!
Movies: 996 - TV Show: 98 - Albums: 1161

My Script: Rating Update - Thumbnails Cleaner
find quote
Vaikin Offline
Posting Freak
Posts: 861
Joined: Mar 2012
Reputation: 24
Location: Toronto, Canada
Post: #162
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.
find quote
skullmonkey Offline
Senior Member
Posts: 206
Joined: Dec 2010
Reputation: 1
Post: #163
How do you run this script/addon? I installed it and nothing happened. The ratings are still incorrect.

Thanks,
S@
(This post was last modified: 2012-08-18 16:35 by skullmonkey.)
find quote
solidsatras Offline
Senior Member
Posts: 297
Joined: Mar 2010
Reputation: 10
Post: #164
(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
find quote
skullmonkey Offline
Senior Member
Posts: 206
Joined: Dec 2010
Reputation: 1
Post: #165
(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...
find quote
Post Reply