Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jvandenbroek committed Mar 8, 2016
1 parent 8ed94bb commit 8db47d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion resources/lib/utilfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def __copy_files_alt(source, destination, match):

def __delete_directory_alt(source):
dirs, files = xbmcvfs.listdir(source)
log("_delete_directory_alt dirs: %s files: %s" % dirs, files)
for d in dirs:
d = os.path.join(source, d)
__delete_directory(d)
Expand Down
21 changes: 11 additions & 10 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def __init__(self):
self.path = xbmc.validatePath(p)
else:
self.path = os.path.abspath(p)
log("Movie source path: %s" % self.path)
log("Movie self.path: %s" % self.path)
self.title = j['result']['item']['title']
self.playcount = j['result']['item']['playcount']
self.imdb = j['result']['item']['imdbnumber']
Expand Down Expand Up @@ -171,8 +171,8 @@ def __move(self, progress):
count = utilfile.count_manage_directory(alt_method, source)
if not dialog_warning(lang(30132), count):
raise Exception(lang(30609))
log("Movie source path (lib/title/files.*): %s" % source)
log("Movie destination path (lib/title/files.*): %s" % destination)
log("Movie.__move source (multiple): %s" % source)
log("Movie.__move destination (multiple): %s" % destination)
utilfile.move_directory(alt_method, source, destination)
self.path = os.path.join(destination, self.path.split(os.sep)[-2], os.path.basename(self.path))
log("Self path (lib/title/files.*): %s" % self.path)
Expand All @@ -181,8 +181,8 @@ def __move(self, progress):
count = utilfile.count_manage_files(alt_method, source, match)
if not dialog_warning(lang(30132), count):
raise Exception(lang(30609))
log("Movie source path: %s" % source)
log("Movie destination path: %s" % destination)
log("Movie.__move source (single): %s" % source)
log("Movie.__move destination (single): %s" % destination)
utilfile.move_files(alt_method, source, destination, match)
self.path = os.path.join(destination, os.path.basename(self.path))
log("Self path: %s" % self.path)
Expand Down Expand Up @@ -216,6 +216,7 @@ def __delete(self, progress):
else: # single folder
match = os.path.splitext(os.path.basename(self.path))[0]
count = utilfile.count_manage_files(alt_method, source, match)
log("Movie.__delete, match: %s" % match)
if not dialog_warning(lang(30133), count):
raise Exception(lang(30609))
utilfile.delete_files(alt_method, source, match, remove_empty)
Expand Down Expand Up @@ -400,7 +401,7 @@ def __init__(self):
self.path = xbmc.validatePath(p)
else:
self.path = os.path.abspath(p)
log("Episode source path: %s" % self.path)
log("Episode self.path: %s" % self.path)
self.title = j['result']['item']['title']
self.playcount = j['result']['item']['playcount']
self.rating = None
Expand All @@ -425,13 +426,13 @@ def __move(self, progress):
count = utilfile.count_manage_files(alt_method, source, match)
if not dialog_warning(lang(30132), count):
raise Exception(lang(30609))
log("Episode source path: %s" % source)
log("Episode.__move source path: %s" % source)
if setting('fm_episodes_structure') == '0': # multiple folders
destination = os.path.join(destination, self.path.split(os.sep)[-3], self.path.split(os.sep)[-2])
log("Episode destination path (lib/title/season/files.*): %s" % destination)
log("Episode.__move destination (multiple): %s" % destination)
else: # single folder
destination = os.path.join(destination, self.path.split(os.sep)[-2])
log("Episode destination path (lib/title/files.*): %s" % destination)
log("Episode.__move destination (single): %s" % destination)
utilfile.move_files(alt_method, source, destination, match, True)
self.path = os.path.join(destination, os.path.basename(self.path))
if setting('update_library') == 'true':
Expand All @@ -457,7 +458,7 @@ def __delete(self, progress):
alt_method = setting('fm_alternate') == 'true'
remove_empty = setting('fm_episodes_remove_empty') == 'true'
match = os.path.splitext(os.path.basename(self.path))[0]
log("__delete, match: %s" % match)
log("Episode.__delete, match: %s" % match)
count = utilfile.count_manage_files(alt_method, source, match)
if not dialog_warning(lang(30133), count):
raise Exception(lang(30609))
Expand Down

0 comments on commit 8db47d1

Please sign in to comment.