Fix for refiner when mediaInfo isn'T available from API because Sonarr and Radarr do not analyse video file.

pull/310/head
Louis Vézina 6 years ago
parent 1cdec28202
commit 4d9e7b0cd1

@ -83,11 +83,15 @@ def sync_episodes():
format = episode['episodeFile']['quality']['quality']['name'] format = episode['episodeFile']['quality']['quality']['name']
resolution = str(episode['episodeFile']['quality']['quality']['resolution']) + 'p' resolution = str(episode['episodeFile']['quality']['quality']['resolution']) + 'p'
videoCodec = episode['episodeFile']['mediaInfo']['videoCodec'] if 'mediaInfo' in episode['episodeFile']:
videoCodec = SonarrFormatVideoCodec(videoCodec) videoCodec = episode['episodeFile']['mediaInfo']['videoCodec']
videoCodec = SonarrFormatVideoCodec(videoCodec)
audioCodec = episode['episodeFile']['mediaInfo']['audioCodec'] audioCodec = episode['episodeFile']['mediaInfo']['audioCodec']
audioCodec = SonarrFormatAudioCodec(audioCodec) audioCodec = SonarrFormatAudioCodec(audioCodec)
else:
videoCodec = None
audioCodec = None
# Add episodes in sonarr to current episode list # Add episodes in sonarr to current episode list
current_episodes_sonarr.append(episode['id']) current_episodes_sonarr.append(episode['id'])

@ -86,17 +86,21 @@ def update_movies():
format = movie['movieFile']['quality']['quality']['name'] format = movie['movieFile']['quality']['quality']['name']
resolution = movie['movieFile']['quality']['quality']['resolution'].lstrip('r').lower() resolution = movie['movieFile']['quality']['quality']['resolution'].lstrip('r').lower()
videoFormat = movie['movieFile']['mediaInfo']['videoFormat'] if 'mediaInfo' in movie['movieFile']:
videoCodecID = movie['movieFile']['mediaInfo']['videoCodecID'] videoFormat = movie['movieFile']['mediaInfo']['videoFormat']
videoProfile = movie['movieFile']['mediaInfo']['videoProfile'] videoCodecID = movie['movieFile']['mediaInfo']['videoCodecID']
videoCodecLibrary = movie['movieFile']['mediaInfo']['videoCodecLibrary'] videoProfile = movie['movieFile']['mediaInfo']['videoProfile']
videoCodec = RadarrFormatVideoCodec(videoFormat, videoCodecID, videoProfile, videoCodecLibrary) videoCodecLibrary = movie['movieFile']['mediaInfo']['videoCodecLibrary']
videoCodec = RadarrFormatVideoCodec(videoFormat, videoCodecID, videoProfile, videoCodecLibrary)
audioFormat = movie['movieFile']['mediaInfo']['audioFormat']
audioCodecID = movie['movieFile']['mediaInfo']['audioCodecID'] audioFormat = movie['movieFile']['mediaInfo']['audioFormat']
audioProfile = movie['movieFile']['mediaInfo']['audioProfile'] audioCodecID = movie['movieFile']['mediaInfo']['audioCodecID']
audioAdditionalFeatures = movie['movieFile']['mediaInfo']['audioAdditionalFeatures'] audioProfile = movie['movieFile']['mediaInfo']['audioProfile']
audioCodec = RadarrFormatAudioCodec(audioFormat, audioCodecID, audioProfile, audioAdditionalFeatures) audioAdditionalFeatures = movie['movieFile']['mediaInfo']['audioAdditionalFeatures']
audioCodec = RadarrFormatAudioCodec(audioFormat, audioCodecID, audioProfile, audioAdditionalFeatures)
else:
videoCodec = None
audioCodec = None
# Add movies in radarr to current movies list # Add movies in radarr to current movies list
current_movies_radarr.append(unicode(movie['tmdbId'])) current_movies_radarr.append(unicode(movie['tmdbId']))

Loading…
Cancel
Save