Skip to content

Commit

Permalink
v1.20.0
Browse files Browse the repository at this point in the history
Co-Authored-By: reyterak <4528673+reyterak@users.noreply.github.com>
  • Loading branch information
IIeTp and ReyterAK committed Jul 12, 2020
1 parent bdc1493 commit 9815fb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
5 changes: 2 additions & 3 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
from updater import Updater
from utils import *

FileBotMod = filebot_is(Prefs['xattr_id'])
if FileBotMod != False:
if module_add_syspath('../../../Scanners/Common/', 'filebot.py') == True:
from filebot import *
Log('FileBot Xattr is founded')
FileBot = True
Expand Down Expand Up @@ -234,7 +233,7 @@ def PerformTMDbMovieSearch(results, media, lang, manual, get_imdb_id=False):
# Looking for tmdb or imdb ID in the movie name, file name, FileBot XATTR metadata, and use it.
if media.filename:
file = media.items[0].parts[0].file
attr = xattr_metadata(file) if FileBot == True else None
attr = xattr_metadata(file) if FileBot == True and Prefs['xattr_id'] == True else None
mid = movie_id(attr) if attr is not None else None
if mid is None:
mid = ''
Expand Down
19 changes: 2 additions & 17 deletions Contents/Libraries/Shared/utils.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
import re, importlib, sys, os, importlib
from os.path import *

def import_ext_module(mod_path, mod_name):
def module_add_syspath(mod_path, mod_name):
module_file = os.path.isfile(os.path.realpath(os.path.join(mod_path + mod_name)))
if module_file == True:
module_path = os.path.realpath(os.path.join(mod_path))
sys.path.append(module_path)
my_mod = importlib.import_module(mod_name[:(len(mod_name)-3)])
return my_mod
else:
return False

def filebot_is(prefs_is):
if prefs_is == True:
import_mod = import_ext_module('../../../Scanners/Common/', 'filebotid.py')
if import_mod != False:
return import_mod
else:
import_mod = import_ext_module('../../../Scanners/Common/', 'filebot.py')
if import_mod != False:
return import_mod
else:
return False
return True
else:
return False

Expand Down
2 changes: 1 addition & 1 deletion Contents/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.20
v1.20.0

0 comments on commit 9815fb5

Please sign in to comment.