Folder.jpg album art script
#1
Hello - is there a script in existence that will take the *.tbn thumbnails in the Userdata/Thumbnail/Music directory and save them off to the actual location of my albums as folder.jpg?

The reason why I am looking for this is because I have recently spent a considerable amount of time looking up cover art using xbmc. And, I would prefer to save these thumbnails off as local thumbnails so the next time my thumbnail cache becomes obsolete due to a database upgrade, they will all be saved off. Additionally, I may one day have an iPod and it would be nice to have all of the cover art for that.

Thanks in advance.
Reply
#2
Sort of,

Here is a work in progress. It works well for video thumbs, but I didn't have as good results with the music.db.

http://xbmc-scripting.googlecode.com/svn...porter.zip

Run the script and then just follow along.

I don't have time to play with it now, maybe someone else can make it work better.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#3
Thanks very much. You're right, it works great for videos. For me it didn't get too far with music. I am using the 5/20 build, so I wonder if it has something to do with the new database setup. I'll take a look at the code this weekend (I'm no python coder, but I may be able to intepret some of what is going on).

Thanks again.
Reply
#4
good luck, post the script back if you fix it.

part of the problem with music may be filename it combines album and artist.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#5
OK - I think I got part of it working. I think there was an issue with the query that pulled the music database info (it just clocked when I tried running it through SQL explorer). So, I used the following:

Code:
select distinct a.strpath, c.stralbum, d.strartist from path a,song b,album c,artist d where a.idpath = b.idpath and b.idalbum = c.idalbum and c.idartist = d.idartist

This worked great in saving the *.tbn files back locally to the xbox. However, I tried to save as folder.jpg back to my smb share hoping that it would know exactly which directory to save the folder.jpg to. It really quickly zipped through a library of 1,000 albums. But, when I check my smb share there was nothing out there. I checked the log file and the only info out there was:

Code:
17:58:53 M: 33312768 WARNING: FileSmb::OpenForWrite() called with overwriting enabled! - smb://SIMPLESHARE/NetFolder/My%20Music/1
18:03:18 M: 36368384   ERROR: Unable to wait for NTP reply from the SNTP server, GetLastError returns 10060
18:03:23 M: 36368384   ERROR: Unable to wait for NTP reply from the SNTP server, GetLastError returns 10060
18:03:28 M: 36368384   ERROR: Unable to wait for NTP reply from the SNTP server, GetLastError returns 10060
18:03:33 M: 36368384   ERROR: Unable to wait for NTP reply from the SNTP server, GetLastError returns 10060
18:03:38 M: 36368384   ERROR: Unable to wait for NTP reply from the SNTP server, GetLastError returns 10060

Any thoughts would be greatly appreciated. The end result I am hoping for is to have the folder.jpg files saved back to the path where the actual album resides.

Thanks again for pointing my in the direction of this script.
Reply
#6
Saving directly to a samba share, you will need to import a couple modules and do special handling.

Someone posted the methods for doing so in the development forum, I forget which thread, something with me though. I may have started the thread.

I also just submitted a patch to the team to fix the getCacheThumbName() method. It currently does not work with unicode strings.

Using the distinct is the correct way to get all the thumbs, nice catch. With my submitted change and your sql statement, it works for all my thumbs.

You will need to separate the artist and album. send that to copy_thumbs() as a separate argument, so you can create the proper folder when using a music database.
Artist\\Album\\folder.jpg instead of AlbumArtist\\folder.jpg

Edit: http://xbmc-scripting.googlecode.com/svn...20Exporter
This has a fatx renaming function and properly creates the folder for music db, no samba support.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#7
Thanks for posting the update. I found a workaround to loading directly to my smb share. I saved the folder.jpgs locally to the xbox then ftp'd them over to my smb share. Worked great!

Thanks again.
Reply

Logout Mark Read Team Forum Stats Members Help
Folder.jpg album art script0