Skip to content

Commit 37835b0

Browse files
author
Konrad Rieck
committed
code re-formated
1 parent 13e11ab commit 37835b0

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

perplex.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
import shutil
99
import json
1010
import gzip
11-
1211
import progressbar as pb
1312

1413
# Default path to metadata database
1514
dbpath = "Plug-in Support/Databases/com.plexapp.plugins.library.db"
1615

17-
def build_db(plex_dir, movies = {}):
16+
17+
def build_db(plex_dir, movies={}):
1818
""" Build movie database from sqlite database """
1919

2020
dbfile = os.path.join(plex_dir, *dbpath.split("/"))
@@ -41,7 +41,7 @@ def build_db(plex_dir, movies = {}):
4141
return movies
4242

4343

44-
def build_map(movies, mapping = []):
44+
def build_map(movies, mapping=[]):
4545
""" Build mapping to new names """
4646

4747
for title, year, files in movies.values():
@@ -59,22 +59,20 @@ def build_map(movies, mapping = []):
5959

6060

6161
def copy_rename(mapping, dest):
62-
6362
pbar = pb.ProgressBar()
6463
for old_name, new_name in pbar(mapping):
6564
dp = os.path.join(dest, os.path.dirname(new_name))
6665
fp = os.path.join(dp, os.path.basename(new_name))
6766

68-
try:
67+
try:
6968
if not os.path.exists(dp):
7069
os.makedirs(dp)
7170

72-
if not os.path.exists(fp):
71+
if not os.path.exists(fp):
7372
shutil.copy(old_name, fp)
74-
73+
7574
except Exception, e:
76-
print str(e)
77-
75+
print str(e)
7876

7977

8078
if __name__ == "__main__":

0 commit comments

Comments
 (0)