Skip to content

Commit 30420ff

Browse files
committed
Music Organizer: Add option to delete unrecognized extensions.
1 parent 1b3479a commit 30420ff

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

python2.7/music-organizer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
help='''Operate in 'artist' mode and copy all songs to the
3838
root of the directory and cleanly format the names to
3939
be easily typed and navigated in a shell.''')
40+
parser.add_argument('--delete-unrecognized-extensions', action='store_true',
41+
dest='delete_unrecognized')
4042
args = parser.parse_args()
4143

4244
if args.collection and args.artist:
@@ -126,8 +128,9 @@ def artist(artistDir):
126128
elif ext == ".pdf":
127129
pass
128130
else:
129-
print("Error: Unrecognized file extension in '" + filename + "'")
130-
sys.exit(-42)
131+
if not args.delete_unrecognized:
132+
print("Error: Unrecognized file extension in '" + filename + "'")
133+
sys.exit(-42)
131134

132135
# Delete all subdirectories.
133136
for subdirname in dirnames:

0 commit comments

Comments
 (0)