Kodi Community Forum
[RELEASE] cdART Manager Script - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] cdART Manager Script (/showthread.php?tid=77031)



- jasonlcox - 2011-07-18

Everything working fine I think, nice job giftie and very much appreciated!

I still have to manually create "extrafanart" folders, I guess you haven't found a way around that yet? Or should that also be fixed now?


- solidsatras - 2011-07-18

@jasonlcox
giftie Wrote:The main fix in these is now the script has the ability to make directories on samba shares.

btt:
will try the new eden version tomorrow and report.


- giftie - 2011-07-18

jasonlcox Wrote:Everything working fine I think, nice job giftie and very much appreciated!

I still have to manually create "extrafanart" folders, I guess you haven't found a way around that yet? Or should that also be fixed now?

It should create them now... Have you checked your settings? I had to add user/pass for samba shares, if it is protected, otherwise it tries to log-in as Guest. It worked with my paths too(smb://user:pass@Tower/Music/ where my path had the username and password as part of the path)

I am unable to test on 10.1 Live which I think you are on.. Could you post a copy of your debug log when trying to Autodownload Fanart/ClearLOGOs?

Thanks..


- jasonlcox - 2011-07-19

Yeah, I'm using a Live 10.1 system. The smb share on my Win7 system isn't password protected.

Here's the log for an attempted fanart auto download:

http://pastebin.com/LZc0CF4W

Would you like me to do one for logos as well?


- solidsatras - 2011-07-19

as promised my report on v.1.4.0:

-smb-directory creation works on my end (today´s windows nightly)

a few little glitches:
- after the fanart search the settings window popped up, i think it shouldn´t Wink
- the fanart for AC/DC was stored in the folder: AC\DC\extrafanart , the correct one would be: \ACDC\extrafanart . Since the bands name on fanart.tv
is AC/DC ...maybe that´s the problem. not sure if it can be avoided within cdART.

Here is a debug log.


- giftie - 2011-07-20

solidsatras Wrote:as promised my report on v.1.4.0:

-smb-directory creation works on my end (today´s windows nightly)
That's good...

Quote:a few little glitches:
Gotta love glitches....
Quote:- after the fanart search the settings window popped up, i think it shouldn´t Wink
You're right, it shouldn't. Just tested on my and it does not do this.. I gotta keep an eye on this...
Quote:- the fanart for AC/DC was stored in the folder: AC\DC\extrafanart , the correct one would be: \ACDC\extrafanart . Since the bands name on fanart.tv
is AC/DC ...maybe that´s the problem. not sure if it can be avoided within cdART.
With extrafanart and ClearLOGOS, the skins take the Music Path that you set in settings, then adds the Artist Name(I actually do the exact same thing). for example: //Tower/Music/ + AC/DC becomes //Tower/Music/AC/DC which is has the final directory for AC/DC as DC. Need more AC/DC fanart to be sure, but I think it works(Just tested with Transparency!, had to download an Fanart off of htbackdrops.com - shame on me.... ) I know it can make a mess of your music folder(you can have your music path set so it is just Fanarts and ClearLOGOs.) cdARTs and Cover Arts are not affected this way as the path to the 'Album' is determined by the XBMC's Music Database, so if your folder is /Tower/Music/ACDC/Back In Black your cdARTs and Cover arts make it to this folder, but ClearLOGOs and extrafanarts end up /Tower/Music/AC/DC/

I also through the FanArt in to that 'new' folder AC/DC instead of ACDC. I also have it this way because I don't think any skins have the ability to remove the '/' from the Artist name.(I can easily.. but then it won't work on the skin)
Quote:Here is a debug log.


Thanks for the log...

I just looked over your log, Did you have a problem building cdART's database? I ask this because I noticed that you have artists that don't have a MusicBrainz ID(Distant ID) where they should(I know I have the same artists.)


- giftie - 2011-07-20

jasonlcox Wrote:Yeah, I'm using a Live 10.1 system. The smb share on my Win7 system isn't password protected.

Here's the log for an attempted fanart auto download:

http://pastebin.com/LZc0CF4W

Would you like me to do one for logos as well?

Thanks for the debug log.. Found the error.. If it still does not create the folders, try turning on the option for "Protected Share" and put "guest" in as a username(nothing for the password) I hope it works with out doing this though(just means another small fix if it works after putting the 'guest' username)

Here's a link to the fixed version: http://www.mediafire.com/file/ab8pj3dbtmyaftr/script.cdartmanager.dharma.1.4.1.zip

Thanks again.


- giftie - 2011-07-20

Small update for Dharma Users, I forgot to carry changes over from the pre-Eden Version.

http://www.mediafire.com/file/ab8pj3dbtmyaftr/script.cdartmanager.dharma.1.4.1.zip

No updates for pre-Eden as the error was not present in the code...

Edit....

Thanks to a very recent commit by spiff, a new pre-Eden version is available(if you build your own or not, make sure it contains commit: https://github.com/xbmc/xbmc/commit/6bc1b32f046cd050a4b3b544c9d09b69f43ee844):

http://www.mediafire.com/file/cojr26exxccafew/script.cdartmanager.1.4.1.zip


- Martijn - 2011-07-20

Hey Giftie,

I send you a pull request for Pre-Eden Dutch language update.
Also one for cinema experience


- solidsatras - 2011-07-20

giftie Wrote:I just looked over your log, Did you have a problem building cdART's database?
It looks like I have...

tested v.1.4.1:

smb-folder creation still works Smile

I think there is something wrong with building the database on my end.
Since it´s a very big log, i will try to help a little:

This error keeps showing up:
Code:
14:55:49 T:3696 M:2632806400   ERROR: [script.cdartmanager] - Error: HTTP Error 503:      (Service unavailable)
maybe scraping too fast?

some unicode related problems with the albums:
"The Beatles/Sgt. Pepper’S Lonely Hearts Club Band (1967)"
Code:
14:58:43 T:3696 M:2639327232   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\database.py", line 146, in retrieve_album_details_full
14:58:43 T:3696 M:2639327232   ERROR:     a_title = album_artist["title"].encode("utf-8")
14:58:43 T:3696 M:2639327232   ERROR: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 11: ordinal not in range(128)

"P!Nk/Greatest Hits... So Far!!! (2010)"
Code:
14:59:27 T:3696 M:2639962112   ERROR: Traceback (most recent call last):
14:59:27 T:3696 M:2639962112   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\gui.py", line 149, in onInit
14:59:27 T:3696 M:2639884288   ERROR:     self.setup_all()
14:59:27 T:3696 M:2639884288   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\gui.py", line 1033, in setup_all
14:59:27 T:3696 M:2639884288   ERROR:     local_album_count, local_artist_count, local_cdart_count = new_database_setup( self.background )
14:59:27 T:3696 M:2639884288   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\database.py", line 335, in new_database_setup
14:59:27 T:3696 M:2639884288   ERROR:     c.execute('''create table counts(artists INTEGER, albums INTEGER, cdarts INTEGER, version TEXT)''')
14:59:27 T:3696 M:2639884288   ERROR: OperationalError: table counts already exists

"Rammstein/Liebe Ist Für Alle Da (2009)"
Code:
14:59:47 T:2696 M:2639998976   ERROR: Traceback (most recent call last):
14:59:47 T:2696 M:2639994880   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\database.py", line 220, in store_alblist
14:59:47 T:2696 M:2639994880   ERROR:     c.execute("insert into alblist(album_id, title, artist, path, cdart, cover, disc, musicbrainz_albumid, musicbrainz_artistid) values (?, ?, ?, ?, ?, ?, ?, ?, ?)", ( album["local_id"], album["title"], album["artist"], album["path"].replace("\\\\" , "\\"), ("False","True")[album["cdart"]], ("False","True")[album["cover"]], album["disc"], album["musicbrainz_albumid"], album["musicbrainz_artistid"] ))
14:59:47 T:2696 M:2639994880   ERROR: ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.

The database building hangs at 100%.
Image
As I can see in the debug log the building for 137 albums only took about 5 Minutes.
I waited over an hour before I interfered...but I couldn´t close the window, so ALT+F4 it was...

debug log - building database
debug log - automatic search


In the end it could all be some user error...since i tried building the database several times(to start fresh I deleted the folder: /userdata/addon_data/script.cdartmanager)
2 out of 6 times building the database seems to have worked.
Here is a log of a "good" build:
debug
and a log for automatic search with this "good" database:
debug

I really hope I don´t confuse you and sorry for the mediafire dumps...pastebins size limit is too low Sad


- giftie - 2011-07-21

solidsatras Wrote:It looks like I have...

tested v.1.4.1:

smb-folder creation still works Smile

I think there is something wrong with building the database on my end.
Since it´s a very big log, i will try to help a little:

This error keeps showing up:
Code:
14:55:49 T:3696 M:2632806400   ERROR: [script.cdartmanager] - Error: HTTP Error 503:      (Service unavailable)
maybe scraping too fast?

some unicode related problems with the albums:
"The Beatles/Sgt. Pepper’S Lonely Hearts Club Band (1967)"
Code:
14:58:43 T:3696 M:2639327232   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\database.py", line 146, in retrieve_album_details_full
14:58:43 T:3696 M:2639327232   ERROR:     a_title = album_artist["title"].encode("utf-8")
14:58:43 T:3696 M:2639327232   ERROR: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 11: ordinal not in range(128)

"P!Nk/Greatest Hits... So Far!!! (2010)"
Code:
14:59:27 T:3696 M:2639962112   ERROR: Traceback (most recent call last):
14:59:27 T:3696 M:2639962112   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\gui.py", line 149, in onInit
14:59:27 T:3696 M:2639884288   ERROR:     self.setup_all()
14:59:27 T:3696 M:2639884288   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\gui.py", line 1033, in setup_all
14:59:27 T:3696 M:2639884288   ERROR:     local_album_count, local_artist_count, local_cdart_count = new_database_setup( self.background )
14:59:27 T:3696 M:2639884288   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\database.py", line 335, in new_database_setup
14:59:27 T:3696 M:2639884288   ERROR:     c.execute('''create table counts(artists INTEGER, albums INTEGER, cdarts INTEGER, version TEXT)''')
14:59:27 T:3696 M:2639884288   ERROR: OperationalError: table counts already exists

"Rammstein/Liebe Ist Für Alle Da (2009)"
Code:
14:59:47 T:2696 M:2639998976   ERROR: Traceback (most recent call last):
14:59:47 T:2696 M:2639994880   ERROR:   File "C:\Users\HTPC\AppData\Roaming\XBMC\addons\script.cdartmanager\resources\lib\database.py", line 220, in store_alblist
14:59:47 T:2696 M:2639994880   ERROR:     c.execute("insert into alblist(album_id, title, artist, path, cdart, cover, disc, musicbrainz_albumid, musicbrainz_artistid) values (?, ?, ?, ?, ?, ?, ?, ?, ?)", ( album["local_id"], album["title"], album["artist"], album["path"].replace("\\\\" , "\\"), ("False","True")[album["cdart"]], ("False","True")[album["cover"]], album["disc"], album["musicbrainz_albumid"], album["musicbrainz_artistid"] ))
14:59:47 T:2696 M:2639994880   ERROR: ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.

The database building hangs at 100%.
Image
As I can see in the debug log the building for 137 albums only took about 5 Minutes.
I waited over an hour before I interfered...but I couldn´t close the window, so ALT+F4 it was...

debug log - building database
debug log - automatic search


In the end it could all be some user error...since i tried building the database several times(to start fresh I deleted the folder: /userdata/addon_data/script.cdartmanager)
2 out of 6 times building the database seems to have worked.
Here is a log of a "good" build:
debug
and a log for automatic search with this "good" database:
debug

I really hope I don´t confuse you and sorry for the mediafire dumps...pastebins size limit is too low Sad

From the 'database hang debug log' I can see some how you cause it to run the building of the database twice, which seems to be causeing most of the creation errors(the 503's and the error about building the counts "ERROR: OperationalError: table counts already exists") The other errors are really more warnings that I use for debuging, I need to keep the database format Unicode, but a lot of items use a different language codec(often latin-1 though I have seen some odd ones) The Script tries once to decode it, if an error happens(the 8-bit bytestring one or "ascii" one), then it tries to encoding it. Usually it passes on the first try, so no error.(I've seen iTunes has often created this issue) I guess I need to put in extra code to stop database building if it already is.

Though I'm not sure how you got it to run twice, well maybe, did you select 'Build Database' from settings, then run the script?


- solidsatras - 2011-07-21

giftie Wrote:To activate this, in settings(after you set up all the settings) under extra settings, click on 'Build Database' then click on OK.

I honestly don´t know how...but obviously i´m doing it wrong Cool

When I enter the program, the settings window shows up. I select my directory´s, hit build database and OK. The database building process starts...


- jasonlcox - 2011-07-21

Giftie, it still isn't making the extrafanart folders for me (with, or without the "protected share" option turned on).

Here is a log (using "protected samba share" option, with "guest" as user):

http://pastebin.com/WWuK1zQT

Would you like me to make another log without the "protected share" option?


- giftie - 2011-07-22

solidsatras Wrote:I honestly don´t know how...but obviously i´m doing it wrong Cool

When I enter the program, the settings window shows up. I select my directory´s, hit build database and OK. The database building process starts...

I see what is going on... Smile I have the settings showing up if it finds an unrecoverable error in the database(it tries it's best to recover, or delete if it needs to) But it also will start to build the database once the settings are closed. With you selecting 'Build Database' from the settings, then closing the settings two instances of the Building the Database start. One in the background(I guess I should re-label that to 'Build Database in Background') and one in the main script. So if you were to delete your l_cdart.db and l_cdart.db.journal, then restart the script. I'll add some logic to stop this from happening in the next version...


- m4x1m - 2011-07-23

Code:
15:54:07 T:2720119664 M:3962204160   ERROR: Error Type: <type 'exceptions.ImportError'>
15:54:07 T:2720119664 M:3962204160   ERROR: Error Contents: cannot import name mkdir
15:54:07 T:2720119664 M:3962204160   ERROR: Traceback (most recent call last):
                                              File "/home/m4x1m/.xbmc/addons/script.cdartmanager/default.py", line 42, in <module>
                                                from utils import empty_tempxml_folder
                                              File "/home/m4x1m/.xbmc/addons/script.cdartmanager/resources/lib/utils.py", line 32, in <module>
                                                from xbmcvfs import mkdir
                                            ImportError: cannot import name mkdir
15:54:07 T:2720119664 M:3962204160    INFO: -->End of Python script error report<--

Latest xbmc-pvr and script.cdartmanager 1.4.1
Maybe I missed something? Nerd