|
|
@ -430,6 +430,7 @@ def set_nfo_uid_updated(*args, **kwargs): |
|
|
|
|
|
|
|
|
|
|
|
def remove_default_attr(*args, **kwargs): |
|
|
|
try: |
|
|
|
from .. import db |
|
|
|
msg = 'Changing Kodi Nfo' |
|
|
|
sickbeard.classes.loading_msg.set_msg_progress(msg, '0%') |
|
|
@ -437,6 +438,7 @@ def remove_default_attr(*args, **kwargs): |
|
|
|
kodi = metadata_class() |
|
|
|
num_shows = len(sickbeard.showList) |
|
|
|
for n, cur_show_obj in enumerate(sickbeard.showList): |
|
|
|
try: |
|
|
|
changed = False |
|
|
|
with cur_show_obj.lock: |
|
|
|
# call for progress with value |
|
|
@ -490,6 +492,7 @@ def remove_default_attr(*args, **kwargs): |
|
|
|
# episodes |
|
|
|
episodes = cur_show_obj.get_all_episodes(has_location=True) |
|
|
|
for cur_ep_obj in episodes: |
|
|
|
try: |
|
|
|
changed = False |
|
|
|
nfo_path = kodi.get_episode_file_path(cur_ep_obj) |
|
|
|
if nfo_path and ek.ek(os.path.isfile, nfo_path): |
|
|
@ -513,9 +516,17 @@ def remove_default_attr(*args, **kwargs): |
|
|
|
helpers.indent_xml(xmltree.getroot()) |
|
|
|
helpers.write_file(nfo_path, xmltree, xmltree=True, utf8=True) |
|
|
|
|
|
|
|
except(BaseException, Exception): |
|
|
|
pass |
|
|
|
|
|
|
|
except(BaseException, Exception): |
|
|
|
pass |
|
|
|
|
|
|
|
db.DBConnection().set_flag('kodi_nfo_default_removed') |
|
|
|
sickbeard.classes.loading_msg.set_msg_progress(msg, '100%') |
|
|
|
|
|
|
|
except(BaseException, Exception): |
|
|
|
pass |
|
|
|
|
|
|
|
# present a standard "interface" from the module |
|
|
|
metadata_class = KODIMetadata |
|
|
|