diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00001.ts (renamed from tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00001.ts) | 0 | ||||
-rw-r--r-- | tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00002.ts (renamed from tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00002.ts) | 0 | ||||
-rw-r--r-- | tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00003.ts (renamed from tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00003.ts) | 0 | ||||
-rw-r--r-- | tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00004.ts (renamed from tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00004.ts) | 0 | ||||
-rw-r--r-- | tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/info (renamed from tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/info) | 0 | ||||
-rw-r--r-- | tests/test_gettattr.py | 8 | ||||
-rw-r--r-- | tests/test_mpg.py | 2 | ||||
-rw-r--r-- | tests/test_nfo.py | 2 | ||||
-rw-r--r-- | vdrnfofs/filesystemnodes.py | 6 | ||||
-rw-r--r-- | vdrnfofs/vdrnfofs.py | 2 |
11 files changed, 18 insertions, 3 deletions
@@ -2,6 +2,7 @@ version 0.8 - Use cStringIO instead of string concatenation - about 3 times faster (Patch provided by Ed Hein) - Fixed license header in source files - it's the BSD licence now! + - Set mtime of file nodes to recording time (parsed from *.rec) version 0.7 - Fixed file/dir node permissions diff --git a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00001.ts b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00001.ts index 6a537b5..6a537b5 100644 --- a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00001.ts +++ b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00001.ts diff --git a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00002.ts b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00002.ts index c76a964..c76a964 100644 --- a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00002.ts +++ b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00002.ts diff --git a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00003.ts b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00003.ts index 6a537b5..6a537b5 100644 --- a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00003.ts +++ b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00003.ts diff --git a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00004.ts b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00004.ts index c76a964..c76a964 100644 --- a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/00004.ts +++ b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/00004.ts diff --git a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/info b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/info index 08787fc..08787fc 100644 --- a/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.99.99.rec/info +++ b/tests/sample_video_dir/sample-vdr1.7/2008-03-28.20.13.10-1.rec/info diff --git a/tests/test_gettattr.py b/tests/test_gettattr.py index 6b215e5..f0af089 100644 --- a/tests/test_gettattr.py +++ b/tests/test_gettattr.py @@ -32,6 +32,7 @@ import sys import os import unittest import stat +import datetime sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) @@ -56,7 +57,14 @@ class TestPathToNodeMapping(unittest.TestCase): def test_mpg(self): attr = self.fs.getattr('/sample_2008-03-28.20.13.99.99.rec.mpg') self.assertEqual(stat.S_IFREG | 0444, attr.st_mode) + self.assertEqual(datetime.datetime(2008,3,28,20,13), datetime.datetime.fromtimestamp(attr.st_mtime)) def test_nfo(self): attr = self.fs.getattr('/sample_2008-03-28.20.13.99.99.rec.nfo') self.assertEqual(stat.S_IFREG | 0444, attr.st_mode) + self.assertEqual(datetime.datetime(2008,3,28,20,13), datetime.datetime.fromtimestamp(attr.st_mtime)) + + def test_nfo_new(self): + attr = self.fs.getattr('/sample-vdr1.7_2008-03-28.20.13.10-1.rec.nfo') + self.assertEqual(stat.S_IFREG | 0444, attr.st_mode) + self.assertEqual(datetime.datetime(2008,3,28,20,13), datetime.datetime.fromtimestamp(attr.st_mtime)) diff --git a/tests/test_mpg.py b/tests/test_mpg.py index 1b93878..cebfec9 100644 --- a/tests/test_mpg.py +++ b/tests/test_mpg.py @@ -51,7 +51,7 @@ class TestMpg(unittest.TestCase): self.assertEqual('1234567890abcdefghij1234567890abcdefghij', node.read(0, 4096)) def test_mpg_new(self): - node = get_node(self.video, '/sample-vdr1.7_2008-03-28.20.13.99.99.rec.mpg') + node = get_node(self.video, '/sample-vdr1.7_2008-03-28.20.13.10-1.rec.mpg') self.assertEqual(40, node.size()) self.assertEqual('1234567890abcdefghij1234567890abcdefghij', node.read(0, 4096)) diff --git a/tests/test_nfo.py b/tests/test_nfo.py index 5e6cb2d..71c352d 100644 --- a/tests/test_nfo.py +++ b/tests/test_nfo.py @@ -52,7 +52,7 @@ class TestNfo(unittest.TestCase): self.assertEqual('A movie about something', nfo.find('plot').text) def test_nfo_new(self): - node = get_node(self.video, '/sample-vdr1.7_2008-03-28.20.13.99.99.rec.nfo') + node = get_node(self.video, '/sample-vdr1.7_2008-03-28.20.13.10-1.rec.nfo') nfo = xml.etree.ElementTree.fromstring(node.read(0, 4096)) self.assertEqual('Movie Title', nfo.find('title').text) self.assertEqual('A movie about something', nfo.find('plot').text) diff --git a/vdrnfofs/filesystemnodes.py b/vdrnfofs/filesystemnodes.py index f6d7673..c5eaade 100644 --- a/vdrnfofs/filesystemnodes.py +++ b/vdrnfofs/filesystemnodes.py @@ -32,6 +32,8 @@ import glob import os import fuse import stat +import datetime +import time from concatenated_file_reader import * from vdr import * @@ -76,6 +78,8 @@ class MpgNode: attr.st_mode = stat.S_IFREG | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH attr.st_nlink = 1 attr.st_size = self.size() + timevalues = self.path.rsplit('/', 1)[1][:16].replace('.', '-').split('-') + attr.st_mtime = time.mktime(datetime.datetime(*[ int(s) for s in timevalues ]).timetuple()) return attr @@ -107,6 +111,8 @@ class NfoNode: attr.st_mode = stat.S_IFREG | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH attr.st_nlink = 1 attr.st_size = self.size() + timevalues = self.path.rsplit('/', 1)[1][:16].replace('.', '-').split('-') + attr.st_mtime = time.mktime(datetime.datetime(*[ int(s) for s in timevalues ]).timetuple()) return attr def release(self): diff --git a/vdrnfofs/vdrnfofs.py b/vdrnfofs/vdrnfofs.py index a1d807e..6e9cc8b 100644 --- a/vdrnfofs/vdrnfofs.py +++ b/vdrnfofs/vdrnfofs.py @@ -105,7 +105,7 @@ class VdrNfoFs(fuse.Fuse): return node.get_stat() return -errno.ENOENT except: - syslog.syslog('VdrFuseFs: Unexpected error for getattr(%s): %s' % path) + syslog.syslog('VdrFuseFs: Unexpected error for getattr(%s)' % path) def readdir(self, path, offset): try: |