|
|
@ -5,7 +5,7 @@ import os
|
|
|
|
from app.config import settings
|
|
|
|
from app.config import settings
|
|
|
|
from app.database import TableShows, database, select
|
|
|
|
from app.database import TableShows, database, select
|
|
|
|
from constants import MINIMUM_VIDEO_SIZE
|
|
|
|
from constants import MINIMUM_VIDEO_SIZE
|
|
|
|
from languages.get_languages import audio_language_from_alpha2
|
|
|
|
from languages.get_languages import audio_language_from_name
|
|
|
|
from utilities.path_mappings import path_mappings
|
|
|
|
from utilities.path_mappings import path_mappings
|
|
|
|
from utilities.video_analyzer import embedded_audio_reader
|
|
|
|
from utilities.video_analyzer import embedded_audio_reader
|
|
|
|
from sonarr.info import get_sonarr_info
|
|
|
|
from sonarr.info import get_sonarr_info
|
|
|
@ -122,13 +122,13 @@ def episodeParser(episode):
|
|
|
|
item = episode['episodeFile']['language']
|
|
|
|
item = episode['episodeFile']['language']
|
|
|
|
if isinstance(item, dict):
|
|
|
|
if isinstance(item, dict):
|
|
|
|
if 'name' in item:
|
|
|
|
if 'name' in item:
|
|
|
|
audio_language.append(audio_language_from_alpha2(item['name']))
|
|
|
|
audio_language.append(audio_language_from_name(item['name']))
|
|
|
|
elif 'languages' in episode['episodeFile'] and len(episode['episodeFile']['languages']):
|
|
|
|
elif 'languages' in episode['episodeFile'] and len(episode['episodeFile']['languages']):
|
|
|
|
items = episode['episodeFile']['languages']
|
|
|
|
items = episode['episodeFile']['languages']
|
|
|
|
if isinstance(items, list):
|
|
|
|
if isinstance(items, list):
|
|
|
|
for item in items:
|
|
|
|
for item in items:
|
|
|
|
if 'name' in item:
|
|
|
|
if 'name' in item:
|
|
|
|
audio_language.append(audio_language_from_alpha2(item['name']))
|
|
|
|
audio_language.append(audio_language_from_name(item['name']))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
audio_language = database.execute(
|
|
|
|
audio_language = database.execute(
|
|
|
|
select(TableShows.audio_language)
|
|
|
|
select(TableShows.audio_language)
|
|
|
|