mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-02 17:33:37 +00:00
Fix detection of existing files.
Change add sanitize 'imdbid' field in tvdb_api v2. Change indexer_id in imdb_info (switchIndexer).
This commit is contained in:
parent
cca7c32a8a
commit
0a50d35f82
4 changed files with 31 additions and 4 deletions
|
@ -1,4 +1,11 @@
|
||||||
### 0.16.22 (2018-08-18 12:30:00 UTC)
|
### 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
|
* Change TVDB data parsing for gueststars, writers and genre
|
||||||
|
|
||||||
|
|
|
@ -639,6 +639,12 @@ class Tvdb:
|
||||||
v = None
|
v = None
|
||||||
else:
|
else:
|
||||||
v = None
|
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:
|
else:
|
||||||
v = self._clean_data(v)
|
v = self._clean_data(v)
|
||||||
if k in map_show:
|
if k in map_show:
|
||||||
|
|
|
@ -180,7 +180,8 @@ class Quality:
|
||||||
If no quality is achieved it will try sceneQuality regex
|
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
|
# if we have our exact text then assume we put it there
|
||||||
for x in sorted(Quality.qualityStrings.keys(), reverse=True):
|
for x in sorted(Quality.qualityStrings.keys(), reverse=True):
|
||||||
|
@ -201,7 +202,8 @@ class Quality:
|
||||||
Return The quality from the scene episode File
|
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])
|
checkName = lambda quality_list, func: func([re.search(x, name, re.I) for x in quality_list])
|
||||||
|
|
||||||
|
|
|
@ -823,7 +823,7 @@ class TVShow(object):
|
||||||
logger.log('Since this file was renamed, file %s was checked and quality "%s" found'
|
logger.log('Since this file was renamed, file %s was checked and quality "%s" found'
|
||||||
% (file, Quality.qualityStrings[new_quality]), logger.DEBUG)
|
% (file, Quality.qualityStrings[new_quality]), logger.DEBUG)
|
||||||
status, quality = sickbeard.common.Quality.splitCompositeStatus(cur_ep.status)
|
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)
|
cur_ep.status = Quality.compositeStatus(DOWNLOADED, new_quality)
|
||||||
|
|
||||||
# check for status/quality changes as long as it's a new file
|
# check for status/quality changes as long as it's a new file
|
||||||
|
@ -860,6 +860,16 @@ class TVShow(object):
|
||||||
% (cur_ep.status, Quality.compositeStatus(new_status, new_quality)), logger.DEBUG)
|
% (cur_ep.status, Quality.compositeStatus(new_status, new_quality)), logger.DEBUG)
|
||||||
cur_ep.status = Quality.compositeStatus(new_status, new_quality)
|
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:
|
with cur_ep.lock:
|
||||||
result = cur_ep.get_sql()
|
result = cur_ep.get_sql()
|
||||||
if None is not result:
|
if None is not result:
|
||||||
|
@ -1355,6 +1365,8 @@ class TVShow(object):
|
||||||
self.ids[old_indexer]['status'] = MapStatus.NONE
|
self.ids[old_indexer]['status'] = MapStatus.NONE
|
||||||
self.ids[self.indexer]['status'] = MapStatus.SOURCE
|
self.ids[self.indexer]['status'] = MapStatus.SOURCE
|
||||||
self.ids[self.indexer]['id'] = self.indexerid
|
self.ids[self.indexer]['id'] = self.indexerid
|
||||||
|
if isinstance(self.imdb_info, dict):
|
||||||
|
self.imdb_info['indexer_id'] = self.indexerid
|
||||||
save_mapping(self)
|
save_mapping(self)
|
||||||
name_cache.remove_from_namecache(old_indexerid)
|
name_cache.remove_from_namecache(old_indexerid)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue