diff --git a/CHANGES.md b/CHANGES.md index 7a8afe5f..37cadef4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -29,6 +29,13 @@ +### 0.16.23 (2018-08-21 21:00:00 UTC) + +* Fix detection of existing files +* Change add sanitize 'imdbid' field in tvdb_api v2 +* Change indexer_id in imdb_info (switchIndexer) + + ### 0.16.22 (2018-08-18 12:30:00 UTC) * Change TVDB data parsing for gueststars, writers and genre diff --git a/lib/tvdb_api/tvdb_api.py b/lib/tvdb_api/tvdb_api.py index 7d4a38fe..91d8bd20 100644 --- a/lib/tvdb_api/tvdb_api.py +++ b/lib/tvdb_api/tvdb_api.py @@ -640,6 +640,12 @@ class Tvdb: v = None else: v = None + elif 'imdbid' == k: + if v: + if re.search(r'^(tt)?\d{1,7}$', v, flags=re.I): + v = self._clean_data(v) + else: + v = '' else: v = self._clean_data(v) if k in map_show: diff --git a/sickbeard/common.py b/sickbeard/common.py index 15379a08..29b8e301 100644 --- a/sickbeard/common.py +++ b/sickbeard/common.py @@ -180,7 +180,8 @@ class Quality: If no quality is achieved it will try sceneQuality regex """ - name = os.path.basename(name) + from sickbeard import encodingKludge as ek + name = ek.ek(os.path.basename, name) # if we have our exact text then assume we put it there for x in sorted(Quality.qualityStrings.keys(), reverse=True): @@ -201,7 +202,8 @@ class Quality: Return The quality from the scene episode File """ - name = os.path.basename(name) + from sickbeard import encodingKludge as ek + name = ek.ek(os.path.basename, name) checkName = lambda quality_list, func: func([re.search(x, name, re.I) for x in quality_list]) diff --git a/sickbeard/tv.py b/sickbeard/tv.py index a68818da..4af6d72c 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -820,7 +820,7 @@ class TVShow(object): logger.log('Since this file was renamed, file %s was checked and quality "%s" found' % (file, Quality.qualityStrings[new_quality]), logger.DEBUG) status, quality = sickbeard.common.Quality.splitCompositeStatus(cur_ep.status) - if Quality.UNKNOWN != new_quality or SKIPPED == status: + if Quality.UNKNOWN != new_quality or status in (SKIPPED, UNAIRED): cur_ep.status = Quality.compositeStatus(DOWNLOADED, new_quality) # check for status/quality changes as long as it's a new file @@ -857,6 +857,16 @@ class TVShow(object): % (cur_ep.status, Quality.compositeStatus(new_status, new_quality)), logger.DEBUG) cur_ep.status = Quality.compositeStatus(new_status, new_quality) + elif same_file: + status, quality = Quality.splitCompositeStatus(cur_ep.status) + if status in (SKIPPED, UNAIRED): + new_quality = Quality.nameQuality(file, self.is_anime) + if Quality.UNKNOWN == new_quality: + new_quality = Quality.fileQuality(file) + logger.log('Since this file has status: "%s", file %s was checked and quality "%s" found' + % (statusStrings[status], file, Quality.qualityStrings[new_quality]), logger.DEBUG) + cur_ep.status = Quality.compositeStatus(DOWNLOADED, new_quality) + with cur_ep.lock: result = cur_ep.get_sql() if None is not result: @@ -1371,6 +1381,8 @@ class TVShow(object): self.ids[old_indexer]['status'] = MapStatus.NONE self.ids[self.indexer]['status'] = MapStatus.SOURCE self.ids[self.indexer]['id'] = self.indexerid + if isinstance(self.imdb_info, dict): + self.imdb_info['indexer_id'] = self.indexerid save_mapping(self) name_cache.remove_from_namecache(old_indexerid)