[RELEASE] Movie Set Artwork Automator

  Thread Rating:
  • 3 Votes - 4.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
trentf Offline
Junior Member
Posts: 49
Joined: Jan 2013
Reputation: 4
Location: Australia
Post: #1
This is my first XBMC addon, and first use of Python. So go easy!

Basically this script removes the hassle of right clicking Movie Sets and setting the folder/fanart artwork manually. I wrote it because there didn't seem to be anything else out there and it is a pain to do it manually for a large collection.

You have the option of letting the script search for common parent folders of movies within a set and use folder.jpg and fanart.jpg files, or you can specify a single artwork folder containing artwork for all your movie sets (containing <set name>-folder.jpg and <set name>-fanart.jpg).

Example using common folders (movies stored in a single set folder)
\Blu-ray\Alien Anthology\fanart.jpg
\Blu-ray\Alien Anthology\folder.jpg
\Blu-ray\Alien Anthology\Alien (1979) [BDRip] [1080p] [q18] [FLAC].mkv
\Blu-ray\Alien Anthology\Aliens (1986) [BDRip] [1080p] [q20] [FLAC].mkv

Example using common folders (movies stored in own folders under set folder)
\Blu-ray\Alien Anthology\fanart.jpg
\Blu-ray\Alien Anthology\folder.jpg
\Blu-ray\Alien Anthology\Alien\Alien (1979) [BDRip] [1080p] [q18] [FLAC].mkv
\Blu-ray\Alien Anthology\Aliens\Aliens (1986) [BDRip] [1080p] [q20] [FLAC].mkv

Example using single artwork folder
\Blu-ray\Alien\Alien (1979) [BDRip] [1080p] [q18] [FLAC].mkv
\Blu-ray\Aliens\Aliens (1986) [BDRip] [1080p] [q20] [FLAC].mkv
\Blu-ray\Artwork\Alien Anthology-fanart.jpg
\Blu-ray\Artwork\Alien Anthology-folder.jpg

Thanks go to Frost (passion-xbmc.org) for the great Movie Sets plugin from which I have re-used the video database HTTP code for the Eden version. For Frodo, I was forced to change the way the addon works so that it goes direct to the database (and therefore web server is not required).

Note: This is not a scraper, it just uses existing artwork that, if like me, you have painstakingly downloaded, processed and organised with your media.

Direct Download:
Eden: Version 0.1.0
Frodo/Gotham: Version 0.2.1

[Image: script.moviesetart.eden.0.1.0.jpg]

Changelog
0.2.1
- Removed Python version dependency so addon works in latest Gotham
0.2.0
- Fixed support for MySQL with default database name
0.1.9
- Added support for Gotham
- Added support for separate thumb/poster artwork
- Added support for banner.jpg, logo and clearart artwork
- Added setting to force database updates, to help with invalid texture caching
- Added French translation
- Fixed mangled network artwork filenames on Windows
0.1.8
- Added support for non-default database names (mysql and sqlite3)
- Added support for configuring multiple artwork filenames (comma separated)
- Added option to use the set name as a prefix for artwork files in common folder mode
- Added Dutch language file
0.1.7
- Fix for unicode characters in single artwork folder filenames
0.1.6
- Added support for movie sets where no artwork is currently assigned
- Added support for movies in a set stored under a single folder name but across multiple paths (request)
0.1.5
- Fix for using a remote artwork folder over SMB
- Only update database if value changed, reports better stats
0.1.4
- Added support for all movies in a set within the same folder
0.1.3
- Added support for MySQL
0.1.2
- Added setting for subfolder search of artwork folder
- Add lenient filename comparisons when looking for files in artwork folder
- Changed database code to update only existing artwork types
0.1.1
- Added settings for filenames used for artwork (eg folder.jpg vs poster.jpg)
0.1.0
- Initial version
(This post was last modified: 2013-11-09 05:09 by trentf.)
find quote
TRaSH Offline
Fan
Posts: 537
Joined: Jul 2011
Reputation: 1
Location: Holland, The Netherlands
Post: #2
looks intresting,
but does it also work on frodo ?
or eden only ?

Windows 7, 64-bit | XBMC Frodo | Aeon Nox | MONEUAL 320B | Intel® Core™ i5 CPU 661 | Sapphire HD 6570 1GB DDR3
Onkyo TX-SR875 | Teufel System 5 THX Cinema 5.1
HP Microserver N40L WHS 2011 8TB
[Image: all-banner@2x.jpg]
find quote
thrak76 Offline
Moderator
Posts: 1,199
Joined: Mar 2011
Reputation: 21
Location: Lake Michigan Shoreline
Post: #3
(2013-01-27 12:24)TRaSH Wrote:  looks intresting,
but does it also work on frodo ?
or eden only ?

Really?

It's in the topic title, and mentioned in the post that it's currently Eden only.
find quote
TRaSH Offline
Fan
Posts: 537
Joined: Jul 2011
Reputation: 1
Location: Holland, The Netherlands
Post: #4
sorry my bad,
had to many tabs open at once and missed that. Sleepy

Windows 7, 64-bit | XBMC Frodo | Aeon Nox | MONEUAL 320B | Intel® Core™ i5 CPU 661 | Sapphire HD 6570 1GB DDR3
Onkyo TX-SR875 | Teufel System 5 THX Cinema 5.1
HP Microserver N40L WHS 2011 8TB
[Image: all-banner@2x.jpg]
find quote
PatK Offline
Donor
Posts: 2,997
Joined: Mar 2010
Reputation: 72
Location: Canada
Post: #5
I look forward to a Gotham release.
(This post was last modified: 2014-02-04 19:15 by PatK.)
find quote
trentf Offline
Junior Member
Posts: 49
Joined: Jan 2013
Reputation: 4
Location: Australia
Post: #6
Update: I have been making changes to the script to try and get it to work on Frodo, but I am not sure it is possible at the moment.

The way this addon works is by copying the selected artwork to the thumbnail cache associated with the movie set, rather than changing the database to point to new artwork files. The problem in Frodo however is it looks like the way images are loaded from the cache has changed. If the cached thumb doesn't match the source image, it isn't used. So when you first scan the movies into the database, artwork for the set will be assigned from one of the movies in the set. If that artwork is not updated, it doesn't matter what I write to the cache for the movie set, it keeps showing the artwork for the movie originally assigned to the set.

http://wiki.xbmc.org/index.php?title=Thumbnails/Cache

The only way around this I see would be update the database itself containing the source filenames of image artwork assigned to the movie set (rather than just the temporary cache). But the JSON-RPC API doesn't have a method to write back new values for Movie Set artwork, only read.

http://wiki.xbmc.org/index.php?title=JSO...SetDetails
find quote
aeronics Offline
Junior Member
Posts: 5
Joined: May 2012
Reputation: 0
Post: #7
Why don't you triyng to download the folder and the fan-art from themoviedb instead of searching it in local files? So that i think the addon will be more useful.
(This post was last modified: 2013-01-29 00:14 by aeronics.)
find quote
trentf Offline
Junior Member
Posts: 49
Joined: Jan 2013
Reputation: 4
Location: Australia
Post: #8
Yeah, I am not really interested in writing a scraper (and I think there are already options for that). Like a lot of XBMC users, I handle all scraping using offline tools like Media Companion, as I am borderline OCD and need to have everything perfect ;-)
find quote
trentf Offline
Junior Member
Posts: 49
Joined: Jan 2013
Reputation: 4
Location: Australia
Post: #9
Update: I have now added a Frodo version! The script now writes to the database directly using sqlite libs. This is not the recommended approach for database access, but I will update the script if the needed functionality is added to the JSON-RPC API.
find quote
Tomkun Offline
Fan
Posts: 558
Joined: Jul 2004
Reputation: 4
Location: Japan
Post: #10
Wow, thanks a lot for this! It's going to make things much easier.

Do the set folder names need to be exactly the same as the set names?
find quote
trentf Offline
Junior Member
Posts: 49
Joined: Jan 2013
Reputation: 4
Location: Australia
Post: #11
(2013-01-29 09:22)Tomkun Wrote:  Wow, thanks a lot for this! It's going to make things much easier.

Do the set folder names need to be exactly the same as the set names?

If you are using the common folder mode (default), then no. It will just search for the parent folders of all the movies in the set, and select the most common one (if all movies are under one folder, there is only one to choose from).

When using the single artwork folder mode, the artwork must be prefixed with the exact name of the movie set.

When both modes are enabled, it will first search the artwork folder, and if not found, fall-back to searching for a common folder.
find quote
Tomkun Offline
Fan
Posts: 558
Joined: Jul 2004
Reputation: 4
Location: Japan
Post: #12
Fantastic, I'm gonna try it now - I'll report back soon.
Well, for a start the fanart worked beautifully. My posters on the other hand are named 'poster.jpg', and so were not detected - I guess the script only detects 'folder.jpg' at the moment?

Could I put that in as a feature request?
(This post was last modified: 2013-01-29 10:32 by Tomkun.)
find quote
trentf Offline
Junior Member
Posts: 49
Joined: Jan 2013
Reputation: 4
Location: Australia
Post: #13
(2013-01-29 10:26)Tomkun Wrote:  Fantastic, I'm gonna try it now - I'll report back soon.
Well, for a start the fanart worked beautifully. My posters on the other hand are named 'poster.jpg', and so were not detected - I guess the script only detects 'folder.jpg' at the moment?

Could I put that in as a feature request?

Sure you can. In fact, I have just posted version 0.1.1 of the Frodo edition with your request Smile

You can now specify the filenames to use in the settings.

[Image: script.moviesetart.frodo.0.1.1.settings.jpg]
find quote
Tomkun Offline
Fan
Posts: 558
Joined: Jul 2004
Reputation: 4
Location: Japan
Post: #14
New version doesn't work I'm afraid - I changed the thumbnail to poster.jpg, but it didn't find anything.
find quote
trentf Offline
Junior Member
Posts: 49
Joined: Jan 2013
Reputation: 4
Location: Australia
Post: #15
Hmm, I specifically tested that case. Could you check C:\Users\<user>\AppData\Roaming\XBMC\addons\script.moviesetart (I assume Windows?) has actually been updated? I have noticed install from zip doesn't always seem to work on upgrade. Perhaps blow that folder away and install again.

If you still have trouble, feel free to enable debugging and send me the log. You should see something like...

[Movie Set Artwork Automator (Frodo)] - ------------------------------------------------------------
[Movie Set Artwork Automator (Frodo)] - Processing movie set: Alien Anthology
[Movie Set Artwork Automator (Frodo)] - ------------------------------------------------------------
[Movie Set Artwork Automator (Frodo)] - Existing cached thumb: C:\Users\Trent\AppData\Roaming\XBMC\userdata\Thumbnails\Video\7\7dfb035a.tbn
[Movie Set Artwork Automator (Frodo)] - Existing fanart: C:\Users\Trent\AppData\Roaming\XBMC\userdata\Thumbnails\Video\Fanart\7dfb035a.tb​n
[Movie Set Artwork Automator (Frodo)] - Processing movie: Alien
[Movie Set Artwork Automator (Frodo)] - Processing movie: Aliens
[Movie Set Artwork Automator (Frodo)] - Processing movie: Alien 3
[Movie Set Artwork Automator (Frodo)] - Processing movie: Alien 4: Resurrection
[Movie Set Artwork Automator (Frodo)] - Possible thumbnails: [u'D:\\Alien Anthology\\poster.jpg']
[Movie Set Artwork Automator (Frodo)] - Selected thumbnail: D:\Alien Anthology\poster.jpg
[Movie Set Artwork Automator (Frodo)] - Updating video database
Set: 1
Artwork: thumb
File: D:\Alien Anthology\poster.jpg
find quote
Post Reply