Skip to content

Commit

Permalink
fix that some files where never found
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnKaijser committed Dec 23, 2013
1 parent cf28717 commit 2e25484
Show file tree
Hide file tree
Showing 6 changed files with 363 additions and 359 deletions.
564 changes: 282 additions & 282 deletions LICENSE.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<addon
id="script.artwork.downloader"
name="Artwork Downloader"
version="12.0.21"
version="12.0.22"
provider-name="Martijn"
>
<requires>
Expand Down
91 changes: 47 additions & 44 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,120 +1,123 @@
[B]12.0.21[/B]
v12.0.22
- Fix that some files where never found or downloaded

v12.0.21
- Fix change image url for TheMovieDB

[B]12.0.20[/B]
v12.0.20
- Fix local scraping

[B]12.0.19[/B]
v12.0.19
- Gracefully fail if a non library item is send to the script
- Fix not downloading extrafanart any more
- Correct local scraper behaviour
- Catch edge cases where it can't get data from library
- Fix skin calling methods

[B]12.0.18[/B]
v12.0.18
- Fixed wrong variable

[B]12.0.17[/B]
v12.0.17
- Fixed wrong filename for season landscape
- Fixed extra slash for BDMV and VIDEO_TS

[B]12.0.16[/B]
v12.0.16
- A lot of code cleanup
- Updated language files from Transifex

[B]12.0.15[/B]
v12.0.15
- Fixed custom mode
- Added option to show image selection directly if type is specified

[B]12.0.14[/B]
v12.0.14
- Fixed missing brackets

[B]12.0.13[/B]
v12.0.13
- Add better support for local artwork: allow selection in gui mode and also scrape local artwork without a valid media id
- Update language files

[B]12.0.12[/B]
v12.0.12
- Update languages
- Fix script error on some season artwork

[B]12.0.10[/B]
v12.0.10
- Bump dependency versions to prevent being marked as broken

[B]12.0.10[/B]
v12.0.10
- Fixed correct check on season artwork so it isn't downloaded again and again
- Added quick hack to support local artwork if nothing present on fanart.tv

[B]12.0.9[/B]
v12.0.9
- Fix wrong filename for season landscape
- Remove old code

[B]12.0.7[/B]
v12.0.7
- Change API url

[B]12.0.6[/B]
v12.0.6
- Fix report on wrong setting combination
- Enable some artwork by default
- Change poster and banner filenaming to match Frodo

[B]12.0.5[/B]
v12.0.5
- Force overwrite when using GUI mode

[B]12.0.4[/B]
v12.0.4
- Directly add the image URL to the databse
- Option to override with local file

[B]12.0.1[/B]
v12.0.1
- Fix bulk downloading for a single movie/tvshow

[B]12.0.0[/B]
v12.0.0
- XBMC12.0 Frodo version
- use ListItem.DBID for matching media items
- Depricate use of ListItem.Title and ListItem.Path
- Remove db caching because it's not needed anymore

[B]1.0.19[/B]
v1.0.19
- Add fix (again) for Frodo users

[B]1.0.18[/B]
v1.0.18
- Add fix for Frodo users

[B]1.0.17[/B]
v1.0.17
- Forgot to update settings.xml

[B]1.0.16[/B]
v1.0.16
- Added: Movie Thumb
- Added: Movie Banner
- Added: HD artwork takes priority

[B]1.0.15[/B]
v1.0.15
- Disable autorun
- Disable fanart deletion and reduce max number of image

[B]1.0.14[/B]
v1.0.14
- Fixed: Possible empty library list when there was no season data

[B]1.0.13[/B]
v1.0.13
- Fixed: Forgot to remove test line

[B]1.0.12[/B]
v1.0.12
- Fixed: Didn't cache empty results
- Fixed: Should now also work for multipath://
- Changed: Improved coding in some parts

[B]1.0.11[/B]
v1.0.11
- Fixed: Image selection wasn't working when there was a username/password in source

[B]1.0.10[/B]
v1.0.10
- Added: Korean translation (thx piodio)
- Added: Debug option
- Change: Code handling

[B]1.0.9[/B]
v1.0.9
- Changed: increase the API cache expire time to stop trashing the fanart.tv site
- Added: Only show artwork types in GUI mode that are avaiable
- Fixed: Unicode error in custom/gui mode search

[B]1.0.8[/B]
v1.0.8
- Added: Increased speed by using commingcache for library JSON when using custom/gui mode (expires after 1 hour)
- Added: Greek translation (thx CutSickAss)
- Added: Spanish translation (thx PatOso)
Expand All @@ -131,19 +134,19 @@
- Changed: Switched to the new fanart.tv API
- Changed: increase caching of API calls because provider data doesn't change that (24->48 hours)

[B]1.0.7[/B]
v1.0.7
- Changed: Revert 1.0.6 because dependencies are now met. Meaning options from 1.0.5 are now active
- Fixed: Limit TMDB by rating not by number of votes

[B]1.0.6[/B]
v1.0.6

- Fixed: Revert 1.0.5 because dependencies were not met yet

[B]1.0.5[/B]
v1.0.5
- Added: Use commoncache module to decrease API load on providers
- Added: TV Show seasonbanners "seasonx-banner.jpg"

[B]1.0.4[/B]
v1.0.4
- Fixed: After doing ID conversion it skipped that movie
- Fixed: Some mayor bug that no ones has noticed so far
- Fixed: When no exact title match was found it downloaded the entire library
Expand All @@ -165,15 +168,15 @@
- Added: Added musicvideo section that uses the title to search for artwork on TMDB
Needs extra argument from skin (see runscript.txt)

[B]1.0.3[/B]
v1.0.3
- Fixed: Error below limit check
- Fixed: Custom download for specific movie artwork only
- Fixed: Downloads artwork for selected movie when multiple exist with same name
Needs extra argument from skin (see runscript.txt)
- Fixed: Did not run service when set to 00->09
- Added: Try conversion of non standard IMDB Id

[B]1.0.2[/B]
v1.0.2
- Added: Log summary on failed/missing items
- Added: Support the providers message on finished
- Added: Custom mode pops-up a image selection when run on single tvshow/movie
Expand All @@ -184,14 +187,14 @@
- Fixed: Show correct download count in log
- Fixed: Don't show dialog.OK when finished run in silent mode

[B]1.0.1[/B]
v1.0.1
- Added: Ability for skinners to run a custom mode specifying artwork types
see /resources/docs/runscript.txt
- Fixed: Downloading logos in overwrite all mode
- Fixed: Problems with folder creation for .rar media
- Removed: Version/settings.xml check

[B]1.0.0[/B]
v1.0.0
- Name change: Extrafanart Downloader -> Artwork Downloader
- Fixed: Refactored JSON query to prevent reg-ex problems
- Fixed: Total refactor on downloading and limiting
Expand All @@ -214,12 +217,12 @@
- Added: 'silent=true' add-on start argument (displays notification on finished)
- Added: Add-on can be run as service and at startup

[B]0.4.1[/B]
v0.4.1
- Added: Extrathumbs support for Movies
- Fixed: New TMDB image locations on site
Advisable is to delete all existing movie extrafanart folders

[B]0.4.0[/B]
v0.4.0
- Added: Silent downloading in background
- Added: Extrafanart limiter (maximum fanart/language/no text)
- Added: Download backup folder for fanart
Expand All @@ -228,13 +231,13 @@
- Added: Open Settings on first run
- Updated: Skin integration examples

[B]0.3.8[/B]
v0.3.8
- Added: option to centralize fanart storage
- Splitting code into libraries

[B]0.3.7[/B]
v0.3.7
- Added: Skin integration options (see readme file)

[B]0.3.6[/B]
v0.3.6
- Initial commit
- Initial version for official XBMC-repo
38 changes: 14 additions & 24 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,10 @@ def download_artwork(self, media_list, providers):
currentmedia['extrathumbsdirs'] = extrathumbsdirs
# this part check for local files when enabled
scan_more = True
missing = False
if setting['files_local']:
local_list = []
local_list, scan_more = local().get_image_list(currentmedia)
local_list, scan_more, missing = local().get_image_list(currentmedia)
# append local artwork
for item in local_list:
image_list.append(item)
Expand All @@ -334,9 +335,14 @@ def download_artwork(self, media_list, providers):
elif currentmedia['mediatype'] == 'tvshow' and currentmedia['id'].startswith('tt'):
log('- IMDB ID found for TV show, skipping')
failed_items.append('[%s]: TVDB ID %s' %(currentmedia['name'], __localize__(32022)))

# If correct ID found continue
#skip scanning for more if local files have been found and not run in gui / custom mode
elif not scan_more and not startup['mode'] in ['gui', 'custom']:
log('- Already have all files local')
pass
# If correct ID found and don't already have all artwork retrieve from providers
else:
log('- Still missing some files')
log(missing)
temp_image_list = []
# Run through all providers getting their imagelisting
failcount = 0
Expand All @@ -345,9 +351,6 @@ def download_artwork(self, media_list, providers):
break
artwork_result = ''
xmlfailcount = 0
#skip skanning for more if local files have been found and not run in gui / custom mode
if not scan_more and not startup['mode'] in ['gui', 'custom']:
artwork_result = 'pass'
while not artwork_result == 'pass' and not artwork_result == 'skipping':
if artwork_result == 'retrying':
xbmc.sleep(setting['api_timedelay'])
Expand Down Expand Up @@ -449,21 +452,6 @@ def _download_art(self, currentmedia, art_item, targetdirs):
if len(final_image_list) == 0:
log(' - Nothing to download')
else:
# This total hack adds temporary ability to use local images that are not on fanart.tv
# This should be removed asap when rewrite is done
arttypes = ['clearlogo','clearart','landscape','discart']
if setting['files_local'] and art_item['art_type'] in arttypes:
for targetdir in targetdirs:
localfile = os.path.join(targetdir, art_item['filename']).encode('utf-8')
if self.fileops._exists(localfile):
final_image_list.append({'url': localfile,
'art_type': [art_item['art_type']],
'language': pref_language,
'discnumber': '1',
'disctype': currentmedia['disctype']})
break
# End of hack

# Do some language shit
# loop two times than skip
while (i < 2 and not imagefound):
Expand Down Expand Up @@ -575,9 +563,11 @@ def _download_art(self, currentmedia, art_item, targetdirs):
if not self.fileops._exists(os.path.join(targetdir, item['filename'])):
missingfiles = True
# Check if image already exist in database
elif (not art_item['art_type'] in ['seasonlandscape','seasonbanner','seasonposter'] and not
artcheck.get(art_item['art_type'])):
missingfiles = True
elif not art_item['art_type'] in ['seasonlandscape','seasonbanner','seasonposter']:
if setting['files_local']and not self.fileops._exists(item['localfilename']):
missingfiles = True
elif not artcheck.get(art_item['art_type']):
missingfiles = True
if missingfiles:
# If missing add to list
imagefound = True
Expand Down
6 changes: 3 additions & 3 deletions lib/apply_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ def fanart(data):
reason = 'Has text'
limited = True
# Correct language
elif limit.get('limit_artwork') and not data.get('artwork')['language'] in [data.get('language'), 'n/a']:
reason = "Doesn't match preferred language: %s" % limit.get('limit_preferred_language')
limited = True
#elif limit.get('limit_artwork') and not data.get('artwork')['language'] in [data.get('language'), 'n/a']:
# reason = "Doesn't match preferred language: %s" % limit.get('limit_preferred_language')
# limited = True
return [limited, reason]

def extrafanart(data):
Expand Down
Loading

1 comment on commit 2e25484

@jdierkse
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Martijn,

The following block of code (@ line 535 in the current version (12.0.29)) suggests that season posters will never be downloaded:

                                    artcheck = artwork['art']
                                    # Check if extrathumbs/extrafanart image already exist local
                                    if art_item['art_type'] in ['extrathumbs','extrafanart']:
                                        for targetdir in artwork['targetdirs']:
                                            if not self.fileops._exists(os.path.join(targetdir, artwork['filename'])):
                                                missingfiles = True
                                    # Check if image already exist in database
                                    elif not art_item['art_type'] in ['seasonlandscape','seasonbanner','seasonposter']:
                                        if setting['files_local']and not self.fileops._exists(artwork['localfilename']):
                                            missingfiles = True
                                        elif not artcheck.get(art_item['art_type']):
                                            missingfiles = True
                                    if missingfiles:
                                        # If missing add to list
                                        imagefound = True
                                        log(' - Adding to download list (does not exist in all target directories): %s' % artwork['filename'])
                                        download_list.append(artwork)
                                    else:
                                        imagefound = True
                                        log(' - Ignoring (Exists in all target directories): %s' % artwork['filename'])

missingfiles is set to false in the beginning of the method, and seasonposter is explicitly ignored here.
Is my assumption right, or am I missing something?

Please sign in to comment.