summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_path_to_node_mapping.py4
-rw-r--r--vdrnfofs/filesystemnodes.py6
-rw-r--r--vdrnfofs/vdrnfofs.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_path_to_node_mapping.py b/tests/test_path_to_node_mapping.py
index 9e81828..51e7852 100644
--- a/tests/test_path_to_node_mapping.py
+++ b/tests/test_path_to_node_mapping.py
@@ -38,12 +38,12 @@ from vdrnfofs.vdrnfofs import *
class TestPathToNodeMapping(unittest.TestCase):
def setUp(self):
- self.video = self.video_dir = os.path.abspath(os.path.dirname(__file__) + '/sample_video_dir')
+ self.video = os.path.abspath(os.path.dirname(__file__) + '/sample_video_dir')
def test_root(self):
node = get_node(self.video, '/')
self.assertEqual('', node.file_system_name)
- self.assertEqual(self.video, node.path)
+ self.assertEqual(self.video + '/', node.path)
def test_subdir(self):
node = get_node(self.video, '/folder')
diff --git a/vdrnfofs/filesystemnodes.py b/vdrnfofs/filesystemnodes.py
index 9c61168..6600859 100644
--- a/vdrnfofs/filesystemnodes.py
+++ b/vdrnfofs/filesystemnodes.py
@@ -53,7 +53,7 @@ class NodeAttributes(fuse.Stat):
class MpgNode:
def __init__(self, path):
- self.path = os.path.normpath(path)
+ self.path = path
self.mpeg_files = glob.glob(path + '/[0-9]*.vdr')
if not self.mpeg_files:
self.mpeg_files = glob.glob(path + '/[0-9]*.ts')
@@ -85,7 +85,7 @@ class MpgNode:
class NfoNode:
def __init__(self, path):
- self.path = os.path.normpath(path)
+ self.path = path
self.file_system_name = os.path.basename(os.path.abspath(path + '/..')) + '_' + os.path.basename(path) + '.nfo'
if os.path.exists(path + '/info.vdr'):
info_vdr = InfoVdr(path + '/info.vdr')
@@ -120,7 +120,7 @@ class NfoNode:
class DirNode:
def __init__(self, path):
- self.path = os.path.normpath(path)
+ self.path = path
self.file_system_name = os.path.basename(path)
self.cache = []
diff --git a/vdrnfofs/vdrnfofs.py b/vdrnfofs/vdrnfofs.py
index df80294..8e32a79 100644
--- a/vdrnfofs/vdrnfofs.py
+++ b/vdrnfofs/vdrnfofs.py
@@ -52,7 +52,7 @@ def get_node(video, path):
if virtual_file_extension in ['.mpg', '.nfo']:
p = virtual_path.rfind('_')
if p > 0:
- video_path = '/'.join((video, virtual_path[0:p], virtual_path[p+1:]))
+ video_path = '/'.join((video, virtual_path[1:p], virtual_path[p+1:]))
if not os.path.isdir(video_path):
return None
elif virtual_file_extension == '.mpg':
@@ -60,7 +60,7 @@ def get_node(video, path):
elif virtual_file_extension == '.nfo':
return NfoNode(video_path)
else:
- dir = video + '/' + path
+ dir = video + path
if os.path.isdir(dir):
return DirNode(dir)
return None