• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 38
[RELEASE] Movie Set Artwork Automator
#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.2
Matrix: Version 0.3.0

Image

Changelog
0.3.0
- Support for Kodi 19 (Matrix)
- Upgrade to Python 3
- Fix for issue raised by vbat99 where you can have double slashes in path when using SMB artwork folder
0.2.2
- Changed Gotham and later versions to use JSON API over direct database access
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
Reply
#2
looks intresting,
but does it also work on frodo ?
or eden only ?
LibreElec Kodi | Aeon MQ ?
Reply
#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.
Quick Links: debug log (wiki) | userdata (wiki) | advancedsettings (wiki) | adding videos to the library (wiki)
Reply
#4
sorry my bad,
had to many tabs open at once and missed that. Sleepy

LibreElec Kodi | Aeon MQ ?
Reply
#5
I look forward to a Gotham release.
Reply
#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
Reply
#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.
Reply
#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 ;-)
Reply
#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.
Reply
#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?
Reply
#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.
Reply
#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?
Reply
#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
Reply
#14
New version doesn't work I'm afraid - I changed the thumbnail to poster.jpg, but it didn't find anything.
Reply
#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.tbn
[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
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 38

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Movie Set Artwork Automator6