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)



- Zenshi - 2011-07-31

Hello giftie,

I'm sorry for my ignorance, but i've been trying to add a smb:// to the path to music library and for the life of me I can't do it!

I may add that all my systems are Mac (iMac, aTV 2, Macbook and iPad) and the samba shares are on a Windows System, protected by username and password and i'm using the mysql database and a shared thumbnails folder to all the systems.

Thanks for the help,

Zenshi.


- giftie - 2011-07-31

Zenshi Wrote:Hello giftie,

I'm sorry for my ignorance, but i've been trying to add a smb:// to the path to music library and for the life of me I can't do it!

I may add that all my systems are Mac (iMac, aTV 2, Macbook and iPad) and the samba shares are on a Windows System, protected by username and password and i'm using the mysql database and a shared thumbnails folder to all the systems.

Thanks for the help,

Zenshi.

You need to add the 'path' in File manager first. It needs to be available in XBMC as a source for Skins and scripts.. This is also the path to you Music(not the actual DB file) I just reused a term from skins.


- Zenshi - 2011-07-31

giftie Wrote:You need to add the 'path' in File manager first. It needs to be available in XBMC as a source for Skins and scripts.. This is also the path to you Music(not the actual DB file) I just reused a term from skins.

Ahh, never add to add paths, only on my "master" client (the one that makes to updates to the library) and only on the Videos section...
I've added the smb share using the File Manager but get and error, it says:
Code:
"Error:

Make sure the selected folder is writable"
I'm sure I can read and write to the folder, i've given admin privileges to a "xbmc" user on the Windows Server.


- giftie - 2011-07-31

Zenshi Wrote:Ahh, never add to add paths, only on my "master" client (the one that makes to updates to the library) and only on the Videos section...
I've added the smb share using the File Manager but get and error, it says:
Code:
"Error:

Make sure the selected folder is writable"
I'm sure I can read and write to the folder, i've given admin privileges to a "xbmc" user on the Windows Server.

Do you get the error in File Manager or in the script?


- Zenshi - 2011-07-31

giftie Wrote:Do you get the error in File Manager or in the script?

In the script.

I think I got it now, but now I get this error:

Code:
01:27:54 T:2953850880 M:556904448   DEBUG: Process - Entering source directory /Users/johndaback/Library/Application Support/XBMC/addons/script.cdartmanager
01:27:54 T:2953850880 M:556904448   DEBUG: Instantiating addon using automatically obtained id of "script.cdartmanager" dependent on version 2.0 of the xbmc.python api
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - ############################################################
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    cdART Manager Script                                  #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #        default.py module                                 #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    script.cdartmanager                                   #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    Giftie                                                #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    1.4.3                                                 #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    Ppic, Reaven, Imaginos, redje, Jair,                  #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    Chaos_666, Magnatism, Kode                            #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    Thanks for the help guys...                           #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - ############################################################
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon Work Folder: /Users/johndaback/Library/Application Support/XBMC/userdata/addon_data/script.cdartmanager/
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon Database: /Users/johndaback/Library/Application Support/XBMC/userdata/addon_data/script.cdartmanager/l_cdart.db
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon settings: /Users/johndaback/Library/Application Support/XBMC/userdata/addon_data/script.cdartmanager/settings.xml
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Looking for settings.xml
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon Work Folder Found, Checking For Database
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon Db not found, Must Be First Run
01:27:55 T:2953850880 M:556253184    INFO: -->Python script returned the following error<--
01:27:55 T:2953850880 M:556253184   ERROR: Error Type: <type 'exceptions.ImportError'>
01:27:55 T:2953850880 M:556253184   ERROR: Error Contents: No module named PIL
01:27:55 T:2953850880 M:556167168   ERROR: Traceback (most recent call last):
                                              File "/Users/johndaback/Library/Application Support/XBMC/addons/script.cdartmanager/default.py", line 154, in <module>
                                                import gui
                                              File "/Users/johndaback/Library/Application Support/XBMC/addons/script.cdartmanager/resources/lib/gui.py", line 15, in <module>
                                                from PIL import Image
                                            ImportError: No module named PIL
01:27:55 T:2953850880 M:556167168    INFO: -->End of Python script error report<--
01:27:55 T:2953850880 M:556167168    INFO: Python script stopped
01:27:55 T:2953850880 M:556167168   DEBUG: Thread XBPyThread 2953850880 terminating
01:27:55 T:2695312704 M:556019712   DEBUG: waiting for python thread 3 to stop
01:27:55 T:2695312704 M:556085248   DEBUG: python thread 3 destructed

I'm running the latest nightly build (29 July) in all my systems.

EDIT:
The script failure happened when i used the shortcut I created for cdART on the homepage, but when I ran the "Build Database in Background" from the script Settings, it started working, weird...


- giftie - 2011-07-31

Zenshi Wrote:In the script.

I think I got it now, but now I get this error:

Code:
01:27:54 T:2953850880 M:556904448   DEBUG: Process - Entering source directory /Users/johndaback/Library/Application Support/XBMC/addons/script.cdartmanager
01:27:54 T:2953850880 M:556904448   DEBUG: Instantiating addon using automatically obtained id of "script.cdartmanager" dependent on version 2.0 of the xbmc.python api
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - ############################################################
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    cdART Manager Script                                  #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #        default.py module                                 #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    script.cdartmanager                                   #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    Giftie                                                #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    1.4.3                                                 #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    Ppic, Reaven, Imaginos, redje, Jair,                  #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    Chaos_666, Magnatism, Kode                            #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - #    Thanks for the help guys...                           #
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - ############################################################
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon Work Folder: /Users/johndaback/Library/Application Support/XBMC/userdata/addon_data/script.cdartmanager/
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon Database: /Users/johndaback/Library/Application Support/XBMC/userdata/addon_data/script.cdartmanager/l_cdart.db
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon settings: /Users/johndaback/Library/Application Support/XBMC/userdata/addon_data/script.cdartmanager/settings.xml
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Looking for settings.xml
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon Work Folder Found, Checking For Database
01:27:54 T:2953850880 M:556675072  NOTICE: [script.cdartmanager] - Addon Db not found, Must Be First Run
01:27:55 T:2953850880 M:556253184    INFO: -->Python script returned the following error<--
01:27:55 T:2953850880 M:556253184   ERROR: Error Type: <type 'exceptions.ImportError'>
01:27:55 T:2953850880 M:556253184   ERROR: Error Contents: No module named PIL
01:27:55 T:2953850880 M:556167168   ERROR: Traceback (most recent call last):
                                              File "/Users/johndaback/Library/Application Support/XBMC/addons/script.cdartmanager/default.py", line 154, in <module>
                                                import gui
                                              File "/Users/johndaback/Library/Application Support/XBMC/addons/script.cdartmanager/resources/lib/gui.py", line 15, in <module>
                                                from PIL import Image
                                            ImportError: No module named PIL
01:27:55 T:2953850880 M:556167168    INFO: -->End of Python script error report<--
01:27:55 T:2953850880 M:556167168    INFO: Python script stopped
01:27:55 T:2953850880 M:556167168   DEBUG: Thread XBPyThread 2953850880 terminating
01:27:55 T:2695312704 M:556019712   DEBUG: waiting for python thread 3 to stop
01:27:55 T:2695312704 M:556085248   DEBUG: python thread 3 destructed

I'm running the latest nightly build (29 July) in all my systems.

Are you building your own? If so, your build is missing script.module.pil. You can also get around this by adding the python module to the system python. I'm not sure how to do this on a Mac, just a Linux/Windows user here..

The old README.OSX states the following

Code:
$ cd $HOME/XBMC
$ ./bootstrap
$ make -C lib/librtmp
$ sudo make -C lib/librtmp install
$ ./configure
$ make clean
$ make xcode_depends
$ make -C lib/addons/script.module.pil
$ make -C lib/addons/script.module.pysqlite
$ sh lib/librtmp/darwin_package_librtmp.sh

don't know how valid this is or not...

pysqlite is not need anymore as it is included in python 2.6&2.7


- Zenshi - 2011-07-31

giftie Wrote:Are you building your own?

Nopes, i'm using the nightly build available on the site.
Maybe they forgot to add it or something?
Gonna download some older ones and test if they forgot to include it or not...


- giftie - 2011-07-31

Zenshi Wrote:Nopes, i'm using the nightly build available on the site.
Maybe they forgot to add it or something?
Gonna download some older ones and test if they forgot to include it or not...

The Dharma Version should have it. You could alway install Dhrama, then pull the script.module.pil from the XBMC folder(same place that skin.confluence is located) then copy to a safe place, then when you install a Nightly version, copy it to the xbmc/addons folder(the one for scripts, plugins, skins)

You also only need to have the script on one XBMC machine as well if you XBMC box share the same music directories, since the script copies to those directories.


- Zenshi - 2011-07-31

giftie Wrote:The Dharma Version should have it. You could alway install Dhrama, then pull the script.module.pil from the XBMC folder(same place that skin.confluence is located) then copy to a safe place, then when you install a Nightly version, copy it to the xbmc/addons folder(the one for scripts, plugins, skins)

Yup, had to do that, the nightly builds from 27, 29 and 30 of July none have the lib compiled...

giftie Wrote:You also only need to have the script on one XBMC machine as well if you XBMC box share the same music directories, since the script copies to those directories.

Yes, I will only use it on the machine that makes the updates to my library.

Thanks for the help giftie!!!

Cheers,

Zenshi.


- giftie - 2011-07-31

Zenshi Wrote:Yup, had to do that, the nightly builds from 27, 29 and 30 of July none have the lib compiled...
I found the output from the BuildBot and it fails to find Python so it can not build the module. I'll post a Trac ticket.


- Zenshi - 2011-07-31

solidsatras Wrote: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.

I also have this problem that solisatras reported, I know that in php you can use url_enconde() or htmlspecialchars() functions in php to parse the "/" or "\" if they are part of the Movie, TV Show or Artist, but since the script is in python, dunno if there are any functions like those...

Cheers,

Zenshi.


- giftie - 2011-07-31

Zenshi Wrote:I also have this problem that solisatras reported, I know that in php you can use url_enconde() or htmlspecialchars() functions in php to parse the "/" or "\" if they are part of the Movie, TV Show or Artist, but since the script is in python, dunno if there are any functions like those...

Cheers,

Zenshi.

It's not an issue with the script, the script only follows the format that skin developers have set(due to thier limitations.) For instance, here is the code from Transparency! for extrafanart(music)

Code:
<imagepath background="true">$INFO[Skin.String(Music_Folder_Path)]$INFO[ListItem.Artist,,/extrafanart/]</imagepath>

What this does is create a path, using the supplied music path(given in settings) then adds the Artist name(as provided by XBMC's Music Library) then adds 'extrafanart'

so if your music path is: smb://TOWER/Music
the artist is: AC/DC(which is how it is provided by XBMC)
the final path is: smb://TOWER/Music/AC/DC/extrafanart.

I think this is really the only special case, I also have my AC/DC music in the folder ACDC(proper directory name Smile ) I can change it, but then the extrafanart and the ClearLOGOs will not work for AC/DC Smile You might also find other folders pop up because XBMC does not always have the correct Artist Name - I had three ZZ Top directories(ZZ TOP, ZZTop ZZ Top) as XBMC recognizes all of them as proper. I fixed it by running MusicBrainz Picard on the offending files.. Smile Actually, you might be scared of my music layout, it is quite a mess, mostly organized, but also has everything I have come across in the last year of troubleshooting the script on other people systems.. Thankfully XBMC does a pretty good job of keeping things visually orgainzed in its library.


- Zenshi - 2011-07-31

giftie Wrote:It's not an issue with the script, the script only follows the format that skin developers have set(due to thier limitations.) For instance, here is the code from Transparency! for extrafanart(music)

Code:
<imagepath background="true">$INFO[Skin.String(Music_Folder_Path)]$INFO[ListItem.Artist,,/extrafanart/]</imagepath>

What this does is create a path, using the supplied music path(given in settings) then adds the Artist name(as provided by XBMC's Music Library) then adds 'extrafanart'

so if your music path is: smb://TOWER/Music
the artist is: AC/DC(which is how it is provided by XBMC)
the final path is: smb://TOWER/Music/AC/DC/extrafanart.

I think this is really the only special case, I also have my AC/DC music in the folder ACDC(proper directory name Smile ) I can change it, but then the extrafanart and the ClearLOGOs will not work for AC/DC Smile You might also find other folders pop up because XBMC does not always have the correct Artist Name - I had three ZZ Top directories(ZZ TOP, ZZTop ZZ Top) as XBMC recognizes all of them as proper. I fixed it by running MusicBrainz Picard on the offending files.. Smile Actually, you might be scared of my music layout, it is quite a mess, mostly organized, but also has everything I have come across in the last year of troubleshooting the script on other people systems.. Thankfully XBMC does a pretty good job of keeping things visually orgainzed in its library.

Tell me about organization, spent countless hours getting my movies and tv shows, now spending more countless hours organizing my music!

I'm using a good organization scheme, using artist as the top folder and then making the albuns as subdirectories.
One thing i noticed with XBMC is that if you put a folder.jpg on the artist folder they show up on the file view, if there was some way of the first extrafanart to go there and then the rest to the extrafanart folder would be awesome.
On a side note, I experimented with Picard, but found it too confusing, been using MediaMonkey with a fair amount of sucess (using the discogs tagger).

Cheers,

Zenshi.


- giftie - 2011-07-31

Zenshi Wrote:Tell me about organization, spent countless hours getting my movies and tv shows, now spending more countless hours organizing my music!

I'm using a good organization scheme, using artist as the top folder and then making the albuns as subdirectories.
One thing i noticed with XBMC is that if you put a folder.jpg on the artist folder they show up on the file view, if there was some way of the first extrafanart to go there and then the rest to the extrafanart folder would be awesome.
On a side note, I experimented with Picard, but found it too confusing, been using MediaMonkey with a fair amount of sucess (using the discogs tagger).

Cheers,

Zenshi.

The automatic download puts it into the extrafanart folder, if you manually choose the fanart, it will go into the Artist folder(or is supposed to..). This is done so you can choose the main fanart...

That seems to be the normal scheme now.. It is also a good idea to separate the multidisc album even further(they each have their own cdART Smile ) so it would go:

Artist
---->Album
-------->CD 1
-------->CD 2
...

At the moment; CD, Disc, Part, Pt are supported labels...

The script uses the folder path to determine the disc number and final cdART/Cover Art path.


- Zenshi - 2011-07-31

giftie Wrote:The automatic download puts it into the extrafanart folder, if you manually choose the fanart, it will go into the Artist folder(or is supposed to..). This is done so you can choose the main fanart...

Ouch, having to go manually in a library of more than 400 artists? No

giftie Wrote:Artist
---->Album
-------->CD 1
-------->CD 2
...

That's the organization scheme that i'm using Wink

Cheers,

Zenshi.