2019-11-12, 11:25
I only update them with edited fields. If no .nfo is there it does nothing.
Because different .nfo editing tools store different additional informations that Kodi isn't using. I don't want to remove those.
'file' is returning me the path where the movie, tvshow, episode, musicvideo is stored.
Because different .nfo editing tools store different additional informations that Kodi isn't using. I don't want to remove those.
'file' is returning me the path where the movie, tvshow, episode, musicvideo is stored.
Code:
def update_nfo(file,elem,value,dbtype,dbid):
if not ADDON.getSettingBool('nfo_updating'):
return
if dbtype == 'tvshow':
path = os.path.join(file,'tvshow.nfo')
else:
path = file.replace(os.path.splitext(file)[1], '.nfo')
UpdateNFO(path, elem, value, dbtype, dbid)
# support for additional movie.nfo
if dbtype == 'movie':
path = file.replace(os.path.basename(file), 'movie.nfo')
UpdateNFO(path, elem, value, dbtype, dbid)