Commit dae67f8d authored by echel0n's avatar echel0n
Browse files

Refactored os.path for pathlib.Path

parent 4b7cdaef
......@@ -19,11 +19,12 @@
import operator
import os.path
import re
from collections import UserDict
from functools import reduce
import pathlib
from sickrage.core.helpers.metadata import get_file_metadata, get_resolution
### CPU Presets for sleep timers
......@@ -260,7 +261,7 @@ class Quality(object):
if not name:
return ret
name = os.path.basename(name)
name = pathlib.Path(name).name
check_name = lambda l, func: func([, name, re.I) for x in l])
......@@ -375,7 +376,7 @@ class Quality(object):
data = {}
quality = Quality.UNKNOWN
if os.path.isfile(filename):
if pathlib.Path(filename).is_file():
meta = get_file_metadata(filename)
......@@ -388,7 +389,7 @@ class Quality(object):
return quality
base_filename = os.path.basename(filename)
base_filename = pathlib.Path(filename).name
bluray ="blue?-?ray|hddvd|b[rd](rip|mux)", base_filename, re.I) is not None
webdl ="\bweb\b|web.?dl|web(rip|mux|hd)", base_filename, re.I) is not None
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment