Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Commit

Permalink
Commented out file handling, adding more name cleaning from igitur
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Hoad committed May 6, 2011
1 parent 9583d38 commit 432eb62
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
OUTPUT_FILE = xbmcplugin.getSetting(handle, "output_file");

if not OUTPUT_FILE:
OUTPUT_FILE = 'missing-movies.txt'
OUTPUT_FILE = '/home/xbmc/missing-movies.txt'

def remove_duplicates(files):
# converting it to a set and back drops all duplicates
Expand All @@ -38,6 +38,8 @@ def clean_name(text):
text = text.replace('%5c', '\\')
text = text.replace('%2f', '/')
text = text.replace('%2c', ',')
text = text.replace('%5f', '_')
text = text.replace('%20', ' ')

return text

Expand Down Expand Up @@ -253,24 +255,24 @@ def show_movie_submenu():

f = None

try:
tmp = """try:
f = open(OUTPUT_FILE, 'a')
except IOError:
f = open(OUTPUT_FILE, 'w')
now = datetime.datetime.now()
f.write('%s: search results for missing movies using the missing movies plugin:' % now.strftime('%Y-%m-%d %H:%M'))

"""
for movie_file in missing:
# get the end of the filename without the extension
if os.path.splitext(movie_file.lower())[0].endswith("trailer"):
print "%s is a trailer and will be ignored!" % movie_file
else:
addDirectoryItem(movie_file, isFolder=False, totalItems=len(missing))
f.write(tv_file)
#f.write(tv_file)

f.close()
#f.close()

xbmcplugin.endOfDirectory(handle=handle, succeeded=True)

Expand All @@ -294,20 +296,20 @@ def show_tvshow_submenu():

f = None

try:
tmp = """try:
f = open(OUTPUT_FILE, 'a')
except IOError:
f = open(OUTPUT_FILE, 'w')
now = datetime.datetime.now()
f.write('%s: search results for missing tv shows using the missing movies plugin:' % now.strftime('%Y-%m-%d %H:%M'))

"""
for tv_file in missing:
addDirectoryItem(tv_file, isFolder=False)
f.write(tv_file)
#f.write(tv_file)

f.close()
#f.close()

nothing = """
for tv_file in tv_files:
Expand Down

0 comments on commit 432eb62

Please sign in to comment.