@ -806,17 +806,24 @@ Remove it if you want it to be renamed (again, or at least let it try again)
Release . status_id . in_ ( [ snatched_status . get ( ' id ' ) , seeding_status . get ( ' id ' ) , missing_status . get ( ' id ' ) ] )
) . all ( )
if not rels :
#No releases found that need status checking
self . checking_snatched = False
return True
release_downloads = fireEvent ( ' download.status ' , merge = True )
if not release_downloads :
log . debug ( ' Download status functionality is not implemented for active downloaders. ' )
fireEvent ( ' renamer.scan ' )
self . checking_snatched = False
return True
scan_releases = [ ]
scan_required = False
if rels :
log . debug ( ' Checking status snatched releases... ' )
release_downloads = fireEvent ( ' download.status ' , merge = True )
if not release_downloads :
log . debug ( ' Download status functionality is not implemented for active downloaders. ' )
scan_required = True
else :
try :
for rel in rels :
rel_dict = rel . to_dict ( { ' info ' : { } } )
@ -827,29 +834,49 @@ Remove it if you want it to be renamed (again, or at least let it try again)
fireEvent ( ' release.update_status ' , rel . id , status = ignored_status , single = True )
continue
# Check if download ID is available
if not rel_dict [ ' info ' ] . get ( ' download_id ' ) :
log . debug ( ' Download status functionality is not implemented for downloader ( %s ) of release %s . ' , ( rel_dict [ ' info ' ] . get ( ' download_downloader ' , ' unknown ' ) , rel_dict [ ' info ' ] [ ' name ' ] ) )
scan_required = True
# Continue with next release
continue
# check statu s
# Find release in downloader s
nzbname = self . createNzbName ( rel_dict [ ' info ' ] , movie_dict )
found = False
for release_download in release_downloads :
found_release = False
if rel_dict [ ' info ' ] . get ( ' download_id ' ) :
if release_download [ ' id ' ] == rel_dict [ ' info ' ] [ ' download_id ' ] and release_download [ ' downloader ' ] == rel_dict [ ' info ' ] [ ' download_downloader ' ] :
log . debug ( ' Found release by id: %s ' , release_download [ ' id ' ] )
found_release = True
break
else :
if release_download [ ' name ' ] == nzbname or rel_dict [ ' info ' ] [ ' name ' ] in release_download [ ' name ' ] or getImdb ( release_download [ ' name ' ] ) == movie_dict [ ' library ' ] [ ' identifier ' ] :
log . debug ( ' Found release by release name or imdb ID: %s ' , release_download [ ' name ' ] )
found_release = True
break
if not found_release :
log . info ( ' %s not found in downloaders ' , nzbname )
if found_release :
#Check status if already missing and for how long, if > 1 week, set to ignored else to missing
if rel . status_id == missing_status . get ( ' id ' ) :
if rel . last_edit < int ( time . time ( ) ) - 7 * 24 * 60 * 60 :
fireEvent ( ' release.update_status ' , rel . id , status = ignored_status , single = True )
else :
# Set the release to missing
fireEvent ( ' release.update_status ' , rel . id , status = missing_status , single = True )
# Continue with next release
continue
# Log that we found the release
timeleft = ' N/A ' if release_download [ ' timeleft ' ] == - 1 else release_download [ ' timeleft ' ]
log . debug ( ' Found %s : %s , time to go: %s ' , ( release_download [ ' name ' ] , release_download [ ' status ' ] . upper ( ) , timeleft ) )
# Check status of release
if release_download [ ' status ' ] == ' busy ' :
# Set the release to snatched if it was missing before
fireEvent ( ' release.update_status ' , rel . id , status = snatched_status , single = True )
@ -884,8 +911,11 @@ Remove it if you want it to be renamed (again, or at least let it try again)
if self . conf ( ' next_on_failed ' ) :
fireEvent ( ' movie.searcher.try_next_release ' , media_id = rel . movie_id )
elif release_download [ ' status ' ] == ' completed ' :
log . info ( ' Download of %s completed! ' , release_download [ ' name ' ] )
#Make sure the downloader sent over a path to look in
if self . statusInfoComplete ( release_download ) :
# If the release has been seeding, process now the seeding is done
@ -915,20 +945,6 @@ Remove it if you want it to be renamed (again, or at least let it try again)
else :
scan_required = True
found = True
break
if not found :
log . info ( ' %s not found in downloaders ' , nzbname )
#Check status if already missing and for how long, if > 1 week, set to ignored else to missing
if rel . status_id == missing_status . get ( ' id ' ) :
if rel . last_edit < int ( time . time ( ) ) - 7 * 24 * 60 * 60 :
fireEvent ( ' release.update_status ' , rel . id , status = ignored_status , single = True )
else :
# Set the release to missing
fireEvent ( ' release.update_status ' , rel . id , status = missing_status , single = True )
except :
log . error ( ' Failed checking for release in downloader: %s ' , traceback . format_exc ( ) )
@ -953,7 +969,6 @@ Remove it if you want it to be renamed (again, or at least let it try again)
fireEvent ( ' renamer.scan ' )
self . checking_snatched = False
return True
def extendReleaseDownload ( self , release_download ) :