Skip to content

Commit

Permalink
code for filtering certain chars
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Rieck committed Dec 14, 2015
1 parent fd3e200 commit ca6177a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion perplex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Perplex - A Movie Renamer for Plex Metadata
# Copyright (c) 2015 Konrad Rieck ([email protected])

Expand All @@ -12,6 +13,8 @@

import progressbar as pb

# Chars to remove from titles
del_chars = '.[]()'

def find_db(plex_dir, name):
""" Search for database file in directory """
Expand All @@ -36,8 +39,9 @@ def build_db(plex_dir, movies={}):
WHERE metadata_type = 1 AND originally_available_at """

for row in db.execute(query):
title = filter(lambda x: x not in del_chars, row[1])
year = row[2].split('-')[0]
movies[row[0]] = (row[1], year, [])
movies[row[0]] = (title, year, [])

# Get files for each movie
query = """
Expand Down

0 comments on commit ca6177a

Please sign in to comment.