-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Konrad Rieck
committed
Dec 14, 2015
1 parent
fd3e200
commit ca6177a
Showing
1 changed file
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) | ||
|
||
|
@@ -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 """ | ||
|
@@ -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 = """ | ||
|