diff --git a/couchpotato/core/plugins/quality/main.py b/couchpotato/core/plugins/quality/main.py index e38b818..9dbd967 100644 --- a/couchpotato/core/plugins/quality/main.py +++ b/couchpotato/core/plugins/quality/main.py @@ -184,16 +184,17 @@ class QualityPlugin(Plugin): # Check on unreliable stuff if loose: - # Check extension + filesize - if list(set(quality.get('ext', [])) & set(words)) and size >= quality['size_min'] and size <= quality['size_max']: - log.debug('Found %s via ext %s in %s' % (quality['identifier'], quality.get('ext'), words)) - return self.setCache(hash, quality) # Last check on resolution only if quality.get('width', 480) == extra.get('resolution_width', 0): log.debug('Found %s via resolution_width: %s == %s' % (quality['identifier'], quality.get('width', 480), extra.get('resolution_width', 0))) return self.setCache(hash, quality) + # Check extension + filesize + if list(set(quality.get('ext', [])) & set(words)) and size >= quality['size_min'] and size <= quality['size_max']: + log.debug('Found %s via ext and filesize %s in %s' % (quality['identifier'], quality.get('ext'), words)) + return self.setCache(hash, quality) + # Try again with loose testing if not loose: @@ -202,4 +203,4 @@ class QualityPlugin(Plugin): return self.setCache(hash, quality) log.debug('Could not identify quality for: %s' % files) - return self.setCache(hash, self.single('dvdrip')) + return None diff --git a/couchpotato/core/plugins/scanner/main.py b/couchpotato/core/plugins/scanner/main.py index e71d5c2..358d992 100644 --- a/couchpotato/core/plugins/scanner/main.py +++ b/couchpotato/core/plugins/scanner/main.py @@ -180,15 +180,18 @@ class Scanner(Plugin): # Normal identifier identifier = self.createStringIdentifier(file_path, folder, exclude_filename = is_dvd_file) + identifiers = [identifier] # Identifier with quality quality = fireEvent('quality.guess', [file_path], single = True) if not is_dvd_file else {'identifier':'dvdr'} - identifier_with_quality = '%s %s' % (identifier, quality.get('identifier', '')) + if quality: + identifier_with_quality = '%s %s' % (identifier, quality.get('identifier', '')) + identifiers = [identifier_with_quality, identifier] if not movie_files.get(identifier): movie_files[identifier] = { 'unsorted_files': [], - 'identifiers': [identifier_with_quality, identifier], + 'identifiers': identifiers, 'is_dvd': is_dvd_file, } @@ -495,7 +498,7 @@ class Scanner(Plugin): 'identifier': imdb_id }, update_after = False, single = True) - log.error('No imdb_id found for %s.' % group['identifiers']) + log.error('No imdb_id found for %s. Add a NFO file with IMDB id or add the year to the filename.' % group['identifiers']) return {} def getCPImdb(self, string):